spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [spark] sunchao commented on pull request #29565: [SPARK-24994][SQL] Simplify casts for literal types
Date Sat, 29 Aug 2020 23:32:22 GMT

sunchao commented on pull request #29565:
URL: https://github.com/apache/spark/pull/29565#issuecomment-683352883


   > I wondered how it handles null literal, might want to add a test case like this:
   > 
   > ```
   >   test("unwrap casts when literal is null") {
   >     val intLit = Literal.create(null, IntegerType)
   >     val shortLit = Literal.create(null, ShortType)
   >     assertEquivalent('a > intLit, 'a > shortLit)
   >     assertEquivalent('a >= intLit, 'a >= shortLit)
   >     assertEquivalent('a === intLit, 'a === shortLit)
   >     assertEquivalent('a <=> intLit, 'a <=> shortLit)
   >     assertEquivalent('a <= intLit, 'a <= shortLit)
   >     assertEquivalent('a < intLit, 'a < shortLit)
   >   }
   > ```
   
   Sure. I can add tests for this. But notice that nulls should have already been handled
by `NullPropagation` though so the binary comparisons should have been transformed to `null`
or something else.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Mime
View raw message