gengliangwang commented on a change in pull request #25300: [SPARK-28503][SQL]
Return null result on cast an out-of-range value to a integral type
URL: https://github.com/apache/spark/pull/25300#discussion_r309984934
##########
File path:
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/ResolveGroupingAnalyticsSuite.scala
##########
@@ -285,7 +285,7 @@ class ResolveGroupingAnalyticsSuite extends AnalysisTest {
GroupingSets(Seq(Seq(), Seq(unresolved_a), Seq(unresolved_a,
unresolved_b)),
Seq(unresolved_a, unresolved_b), r1, Seq(unresolved_a, unresolved_b)))
val expected = Project(Seq(a, b), Sort(
- Seq(SortOrder('aggOrder.byte.withNullability(false), Ascending)), true,
+ Seq(SortOrder('aggOrder.byte.withNullability(true), Ascending)), true,
Review comment:
In line 38
```
lazy val grouping_a = Cast(ShiftRight(gid, 1) & 1, ByteType,
Option(TimeZone.getDefault().getID))
```
The grouping expr is casting a integer to byte, so the nullability is true.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]