Fokko commented on code in PR #6346: URL: https://github.com/apache/iceberg/pull/6346#discussion_r1038403903
########## python/pyiceberg/io/pyarrow.py: ########## @@ -409,22 +418,22 @@ def visit_not_null(self, term: BoundTerm[Any]) -> pc.Expression: return pc.field(term.ref().field.name).is_valid() def visit_equal(self, term: BoundTerm[Any], literal: Literal[Any]) -> pc.Expression: - return pc.field(term.ref().field.name) == literal.value + return pc.field(term.ref().field.name) == _convert_scalar(literal.value, term.ref().field.field_type) Review Comment: We explicitly state micros in the schema, and we cast the PyArrow scalar to it: ```python @_iceberg_to_pyarrow_type.register def _(_: TimestampType) -> pa.DataType: return pa.timestamp(unit="us") @_iceberg_to_pyarrow_type.register def _(_: TimestamptzType) -> pa.DataType: return pa.timestamp(unit="us", tz="+00:00") ``` https://github.com/apache/iceberg/blob/master/python/pyiceberg/io/pyarrow.py#L369-L376 It also looks like PyArrow is doing the conversion from seconds and milliseconds to microseconds: https://github.com/apache/iceberg/pull/6070 We don't support nanoseconds because then we would lose precision. -- 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