alamb commented on code in PR #15486:
URL: https://github.com/apache/datafusion/pull/15486#discussion_r2020130924


##########
datafusion/sqllogictest/test_files/timestamps.slt:
##########
@@ -416,6 +416,33 @@ SELECT to_timestamp(123456789.123456789) as c1, 
cast(123456789.123456789 as time
 ----
 1973-11-29T21:33:09.123456784 1973-11-29T21:33:09.123456784 
1973-11-29T21:33:09.123456784
 
+# to_timestamp Decimal128 inputs
+
+query PPP
+SELECT to_timestamp(arrow_cast(1.1, 'Decimal128(2,1)')) as c1, 
cast(arrow_cast(1.1, 'Decimal128(2,1)') as timestamp) as c2, arrow_cast(1.1, 
'Decimal128(2,1)')::timestamp as c3;
+----
+1970-01-01T00:00:01.100 1970-01-01T00:00:01.100 1970-01-01T00:00:01.100
+
+query PPP
+SELECT to_timestamp(arrow_cast(-1.1, 'Decimal128(2,1)')) as c1, 
cast(arrow_cast(-1.1, 'Decimal128(2,1)') as timestamp) as c2, arrow_cast(-1.1, 
'Decimal128(2,1)')::timestamp as c3;

Review Comment:
   what is the value of computing the same value 3 times?
   
   Perhaps it would make more sense to use different types with the same value 
to show the timestamp that comes back is the same and consistent?
   
   ```suggestion
   SELECT to_timestamp(arrow_cast(-1.1, 'Int64')) as c1, cast(arrow_cast(-1.1, 
'Decimal128(2,1)') as timestamp) as c2, arrow_cast(-1.1, 
'Decimal128(9,8)')::timestamp as c3;
   ```
   
   (and similarly for the other tests)



-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to