frisbeeman commented on code in PR #1968:
URL: https://github.com/apache/iceberg-rust/pull/1968#discussion_r2650934819


##########
crates/integrations/datafusion/src/physical_plan/expr_to_predicate.rs:
##########
@@ -214,6 +217,26 @@ fn scalar_value_to_datum(value: &ScalarValue) -> 
Option<Datum> {
         ScalarValue::LargeUtf8(Some(v)) => Some(Datum::string(v.clone())),
         ScalarValue::Date32(Some(v)) => Some(Datum::date(*v)),
         ScalarValue::Date64(Some(v)) => Some(Datum::date((*v / MILLIS_PER_DAY) 
as i32)),
+        ScalarValue::TimestampSecond(Some(v), Some(tz)) if 
tz.as_ref().eq(UTC_TIME_ZONE) => {
+            Some(Datum::timestamptz_micros(*v * MICROS_PER_SEC))
+        }
+        ScalarValue::TimestampSecond(Some(v), None) => {
+            Some(Datum::timestamp_micros(*v * MICROS_PER_SEC))
+        }
+        ScalarValue::TimestampMillisecond(Some(v), Some(tz)) if 
tz.as_ref().eq(UTC_TIME_ZONE) => {
+            Some(Datum::timestamptz_micros(*v * MICROS_PER_MILLIS))
+        }
+        ScalarValue::TimestampMillisecond(Some(v), None) => {
+            Some(Datum::timestamp_micros(*v * MICROS_PER_MILLIS))
+        }
+        ScalarValue::TimestampMicrosecond(Some(v), Some(tz)) if 
tz.as_ref().eq(UTC_TIME_ZONE) => {
+            Some(Datum::timestamptz_micros(*v))
+        }
+        ScalarValue::TimestampMicrosecond(Some(v), None) => 
Some(Datum::timestamp_micros(*v)),
+        ScalarValue::TimestampNanosecond(Some(v), Some(tz)) if 
tz.as_ref().eq(UTC_TIME_ZONE) => {
+            Some(Datum::timestamptz_nanos(*v))
+        }
+        ScalarValue::TimestampNanosecond(Some(v), None) => 
Some(Datum::timestamp_nanos(*v)),

Review Comment:
   Yes, because if you map `Some(tz)` in when `tz!=UTC` to 
`Datum::timestamp_nanos` without adjusting to the `tz` you select invalid set 
of files from catalog because of it. It's better drop this use case and 
implement the support of non-UTC case later when Datum will support timezone 
modifier.  



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