kevinjqliu commented on code in PR #1150: URL: https://github.com/apache/iceberg-rust/pull/1150#discussion_r2023649923
########## crates/iceberg/src/transform/bucket.rs: ########## @@ -888,4 +904,66 @@ mod test { Datum::int(32) ); } + + #[test] + fn test_timestamptz_literal() { + let bucket = Bucket::new(100); + assert_eq!( + bucket + .transform_literal(&Datum::timestamptz_micros(1510871468000000)) + .unwrap() + .unwrap(), + Datum::int(7) + ); + } + + #[test] + fn test_timestamp_ns_literal() { + let bucket = Bucket::new(100); + let ns_value = 1510871468000000i64 * 1000; + assert_eq!( + bucket + .transform_literal(&Datum::timestamp_nanos(ns_value)) + .unwrap() + .unwrap(), + Datum::int(79) Review Comment: hm, since we're using the same time (`1510871468000000`) here should the bucket value for `bucket(100)` transform be the same for this test and the test above (`test_timestamptz_literal`)? -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org