martin-g commented on code in PR #19377:
URL: https://github.com/apache/datafusion/pull/19377#discussion_r2634810269
##########
datafusion/sqllogictest/test_files/spark/datetime/date_add.slt:
##########
@@ -45,11 +45,15 @@ SELECT date_sub('2016-07-30'::date, 0::int);
----
2016-07-30
-query error DataFusion error: Arrow error: Arithmetic overflow: date_add
-SELECT date_add('2016-07-30'::date, 2147483647::int);
+query I
+SELECT date_add('2016-07-30'::date, 2147483647::int)::int;
+----
+-2147466637
-query error DataFusion error: Arrow error: Arithmetic overflow: date_sub
-SELECT date_sub('1969-01-01'::date, 2147483647::int);
+query I
+SELECT date_sub('1969-01-01'::date, 2147483647::int)::int;
+----
+2147483284
Review Comment:
Apache Spark 4.0.1 returns the same results:
```
❯ ./bin/spark-sql
WARNING: Using incubator modules: jdk.incubator.vector
Using Spark's default log4j profile:
org/apache/spark/log4j2-defaults.properties
Setting default log level to "WARN".
To adjust logging level use sc.setLogLevel(newLevel). For SparkR, use
setLogLevel(newLevel).
25/12/19 13:27:39 WARN NativeCodeLoader: Unable to load native-hadoop
library for your platform... using builtin-java classes where applicable
25/12/19 13:27:41 WARN ObjectStore: Version information not found in
metastore. hive.metastore.schema.verification is not enabled so recording the
schema version 2.3.0
25/12/19 13:27:41 WARN ObjectStore: setMetaStoreSchemaVersion called but
recording version is disabled: version = 2.3.0, comment = Set by MetaStore
[email protected]
Spark Web UI available at http://localhost:4040
Spark master: local[*], Application Id: local-1766143660589
spark-sql (default)> SELECT UNIX_DATE(date_add('2016-07-30', 2147483647));
-2147466637
Time taken: 0.028 seconds, Fetched 1 row(s)
spark-sql (default)> SELECT UNIX_DATE(date_sub('1969-01-01', 2147483647));
2147483284
Time taken: 0.03 seconds, Fetched 1 row(s)
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]