comphead commented on code in PR #18205:
URL: https://github.com/apache/datafusion/pull/18205#discussion_r2450018311
##########
datafusion/sqllogictest/test_files/spark/math/abs.slt:
##########
@@ -23,10 +23,103 @@
## Original Query: SELECT abs(-1);
## PySpark 3.5.5 Result: {'abs(-1)': 1, 'typeof(abs(-1))': 'int',
'typeof(-1)': 'int'}
-#query
-#SELECT abs(-1::int);
+query I
+SELECT abs(-1::int);
+----
+1
+
+statement ok
+CREATE TABLE test_nullable_integer(
+ c1 TINYINT,
+ c2 SMALLINT,
+ c3 INT,
+ c4 BIGINT,
+ dataset TEXT
+ )
+ AS VALUES
+ (NULL, NULL, NULL, NULL, 'nulls'),
+ (0, 0, 0, 0, 'zeros'),
+ (1, 1, 1, 1, 'ones');
+
+query I
+INSERT into test_nullable_integer values(-128, -32768, -2147483648,
-9223372036854775808, 'mins');
+----
+1
+
+# abs: signed int minimal values
+query IIII
+select abs(c1), abs(c2), abs(c3), abs(c4) from test_nullable_integer where
dataset = 'mins'
Review Comment:
wondering would be that easier to test like
```
query II
select abs(1), abs(-1)
----
1 1
```
?
instead of creating/dropping tables
--
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]