ddrinka opened a new issue, #6120:
URL: https://github.com/apache/iceberg/issues/6120
### Feature Request / Improvement
Consider the `PartitionSummary` in a `ManifestFile`. The lower and upper
bounds can be resolved with `conversions.from_bytes`, resulting in types
according to the definitions in `conversions.py`. For instance, a date of
2022-04-01 results in a `long(19083)`.
Now consider `ManifestEntry.data_file.partition`. The instance of a
partition definition should resolve into the same datatypes as the
`PartitionSummary`. But here, since the Avro reader is used, the date above is
resolved to `date(2022, 04, 01)`.
I like the work being done in `expressions/literals.py`. For matching up
partitions of different datatypes, I'm testing out converting the partition
values to literals. A workaround to the disconnect above would be to allow
`DateLiteral`s to be created directly from `date`s.
#### literals.py
```python
@literal.register(date)
def _(value: date) -> Literal[int]:
# We should not convert to and from a string here but I'm trying to
reduce the surface area of this example code
return DateLiteral(date_to_days(value.isoformat()))
```
With this change in place I can create a `Literal` from both resulting
representations of a date above and check equality and gt/lt.
### Query engine
_No response_
--
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]