AdamGS commented on issue #25941:
URL: https://github.com/apache/datafusion/issues/25941#issuecomment-6586780126

   On current main (941146372a8915234682636e124abd3afb540963), this issue seems 
to be solved, the following SLT tests passes:
   
   ```
   statement ok
   CREATE TABLE t AS VALUES (TIMESTAMP '2024-01-01 10:00:00');
   
   statement ok
   CREATE TABLE l AS SELECT arrow_cast('2024-01-01T10:00:00+05:00', 
'Timestamp(Nanosecond, Some("+05:00"))') AS v;
   
   # Both sides are 2024-01-01T10:00:00+05:00
   query PP
   SELECT arrow_cast(column1, 'Timestamp(Nanosecond, Some("+05:00"))') AS lhs, 
v AS rhs FROM t, l;
   ----
   2024-01-01T10:00:00+05:00 2024-01-01T10:00:00+05:00
   
   # Compare against a column: 1 row (correct)
   query I
   SELECT count(*) FROM t, l
   WHERE arrow_cast(t.column1, 'Timestamp(Nanosecond, Some("+05:00"))') = l.v;
   ----
   1
   
   query I
   SELECT count(*) FROM t
   WHERE arrow_cast(column1, 'Timestamp(Nanosecond, Some("+05:00"))')
       = arrow_cast('2024-01-01T10:00:00+05:00', 'Timestamp(Nanosecond, 
Some("+05:00"))');
   ----
   1
   
   
   statement ok
   SET datafusion.execution.time_zone = '+05:00';
   
   statement ok
   CREATE TABLE t2 AS VALUES (TIMESTAMP '2024-01-01 10:00:00');
   
   
   # 2024-01-01T10:00:00+05:00
   query P
   SELECT column1::timestamptz FROM t2;
   ----
   2024-01-01T10:00:00+05:00
   
   # 0
   query I
   SELECT count(*) FROM t2 WHERE column1::timestamptz = TIMESTAMPTZ '2024-01-01 
10:00:00+05:00';
   ----
   1
   
   statement ok
   RESET datafusion.execution.time_zone;
   
   statement ok
   DROP TABLE t;
   
   statement ok
   DROP TABLE l;
   
   statement ok
   DROP TABLE t2;
   ```


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