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


##########
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:
   I took reference from other tests, and what i can check is that it shows 
different way of executing `to_timestamp`
   
   - `to_timestamp(value)` uses the UDF (User Defined Function) implementation 
in to_timestamp.rs
   - `CAST(value AS TIMESTAMP)` or equivalently value `AS TIMESTAMP` uses 
DataFusion's casting system which relies on Arrow's cast kernels
   - `value::TIMESTAMP` is SQL syntax sugar for CAST, and uses the same casting 
route as option 2
   



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