alamb commented on code in PR #3939:
URL: https://github.com/apache/arrow-datafusion/pull/3939#discussion_r1003365789
##########
datafusion/optimizer/tests/integration-test.rs:
##########
@@ -225,6 +226,38 @@ fn concat_ws_literals() -> Result<()> {
Ok(())
}
+#[test]
+#[ignore]
+// https://github.com/apache/arrow-datafusion/issues/3938
+fn timestamp_nano_ts_none_predicates() -> Result<()> {
+ let sql = "SELECT col_int32
+ FROM test
+ WHERE col_ts_nano_none < (now() - interval '1 hour')";
+ let plan = test_sql(sql)?;
+ // a scan should have the now()... predicate folded to a single
+ // constant and compared to the column without a cast so it can be
+ // pushed down / pruned
+ let expected = "Projection: test.col_int32\n Filter: test.col_ts_nano_utc
< TimestampNanosecond(1666612093000000000, Some(\"UTC\"))\
+ \n TableScan: test projection=[col_int32,
col_ts_nano_none]";
+ assert_eq!(expected, format!("{:?}", plan));
+ Ok(())
+}
+
+#[test]
+fn timestamp_nano_ts_utc_predicates() -> Result<()> {
+ let sql = "SELECT col_int32
+ FROM test
+ WHERE col_ts_nano_utc < (now() - interval '1 hour')";
+ let plan = test_sql(sql)?;
+ // a scan should have the now()... predicate folded to a single
+ // constant and compared to the column without a cast so it can be
+ // pushed down / pruned
+ let expected = "Projection: test.col_int32\n Filter: test.col_ts_nano_utc
< TimestampNanosecond(1666612093000000000, Some(\"UTC\"))\
Review Comment:
this test -- with `UTC` timezone, works well (it is pretty cool to see it
doing the right thing)
--
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]