rdblue commented on code in PR #8067:
URL: https://github.com/apache/iceberg/pull/8067#discussion_r1280875259
##########
python/pyiceberg/avro/writer.py:
##########
@@ -78,22 +79,25 @@ def write(self, encoder: BinaryEncoder, val: float) -> None:
class DateWriter(Writer):
def write(self, encoder: BinaryEncoder, val: Any) -> None:
- encoder.write_date_int(val)
+ encoder.write_int(date_to_days(val))
Review Comment:
It's fine to have a writer that work with date, but right now we need one
that works with `int` because that's our internal representation. If someone
passes a filter that is `d < DATE '2023-08-01'` for example, we'll receive that
as something like this: `LessThan(Ref("d"), IntLiteral(1234))`. We want to
compare integers rather than dates because that's faster and more reliable.
When we read/write Avro, we want to go to that internal representation.
--
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]