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_r309965669
##########
File path:
sql/hive/compatibility/src/test/scala/org/apache/spark/sql/hive/execution/HiveCompatibilitySuite.scala
##########
@@ -1086,7 +1090,6 @@ class HiveCompatibilitySuite extends HiveQueryFileTest
with BeforeAndAfter {
"udf_sum",
"udf_tan",
"udf_tinyint",
- "udf_to_byte",
Review comment:
This is within expectation. There are two cases in `udf_to_byte` that failed
after this PR:
```
SELECT CAST(-129 AS TINYINT) FROM src tablesample (1 rows);
SELECT CAST(CAST(-1025 AS BIGINT) AS TINYINT) FROM src tablesample (1 rows);
```
The results will be null for Spark, while the result of HIve is not null.
I will change the migration guide if this looks ok to you.
----------------------------------------------------------------
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]