athlcode commented on code in PR #21933:
URL: https://github.com/apache/datafusion/pull/21933#discussion_r3176277123


##########
datafusion/sqllogictest/test_files/spark/math/floor.slt:
##########
@@ -15,28 +15,206 @@
 # specific language governing permissions and limitations
 # under the License.
 
-# This file was originally created by a porting script from:
-#   
https://github.com/lakehq/sail/tree/43b6ed8221de5c4c4adbedbb267ae1351158b43c/crates/sail-spark-connect/tests/gold_data/function
-# This file is part of the implementation of the datafusion-spark function 
library.
-# For more information, please see:
-#   https://github.com/apache/datafusion/issues/15914
-
-## Original Query: SELECT floor(-0.1);
-## PySpark 3.5.5 Result: {'FLOOR(-0.1)': Decimal('-1'), 'typeof(FLOOR(-0.1))': 
'decimal(1,0)', 'typeof(-0.1)': 'decimal(1,1)'}
-#query
-#SELECT floor(-0.1::decimal(1,1));
-
-## Original Query: SELECT floor(3.1411, -3);
-## PySpark 3.5.5 Result: {'floor(3.1411, -3)': Decimal('0'), 
'typeof(floor(3.1411, -3))': 'decimal(4,0)', 'typeof(3.1411)': 'decimal(5,4)', 
'typeof(-3)': 'int'}
-#query
-#SELECT floor(3.1411::decimal(5,4), -3::int);
-
-## Original Query: SELECT floor(3.1411, 3);
-## PySpark 3.5.5 Result: {'floor(3.1411, 3)': Decimal('3.141'), 
'typeof(floor(3.1411, 3))': 'decimal(5,3)', 'typeof(3.1411)': 'decimal(5,4)', 
'typeof(3)': 'int'}
-#query
-#SELECT floor(3.1411::decimal(5,4), 3::int);
-
-## Original Query: SELECT floor(5);
-## PySpark 3.5.5 Result: {'FLOOR(5)': 5, 'typeof(FLOOR(5))': 'bigint', 
'typeof(5)': 'int'}
-#query
-#SELECT floor(5::int);
+#############
+## Scalars ##
+#############
+
+# Float64 tests - returns Int64
+query IT
+SELECT floor(1.1), arrow_typeof(floor(1.1));
+----
+1 Int64
+
+query IT
+SELECT floor(-1.1), arrow_typeof(floor(-1.1));
+----
+-2 Int64
+
+query IT
+SELECT floor(0.0), arrow_typeof(floor(0.0));
+----
+0 Int64
+
+# Float32 tests - returns Int64
+query IT
+SELECT floor(arrow_cast(1.5, 'Float32')), arrow_typeof(floor(arrow_cast(1.5, 
'Float32')));
+----
+1 Int64

Review Comment:
   added tests for Nan/Infinity



-- 
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]

Reply via email to