mhatipog opened a new issue, #27455:
URL: https://github.com/apache/datafusion/issues/27455

   `evaluate_partition_prefix` turns `part_col = literal` into a listing prefix 
built from the literal's `to_string()`, so only that one spelling is listed. 
Directories holding the same typed value under another valid spelling are 
skipped. The most common case is a TIMESTAMP partition written by pyarrow:
   
   ```python
   import datetime as dt, pyarrow as pa, pyarrow.dataset as ds, datafusion
   t = pa.table({"k": pa.array([1, 2], pa.int32()),
                 "t": pa.array([dt.datetime(2020, 1, 2, 3, 4, 5, 
tzinfo=dt.timezone.utc)] * 2, pa.timestamp("us", tz="UTC"))})
   ds.write_dataset(t, "/tmp/x1", format="parquet", partitioning=["t"], 
partitioning_flavor="hive")
   ctx = datafusion.SessionContext()
   ctx.register_parquet("t", "/tmp/x1", table_partition_cols=[("t", 
pa.timestamp("us", tz="UTC"))], file_extension=".parquet")
   ctx.sql("SELECT k FROM t WHERE t = TIMESTAMP '2020-01-02 
03:04:05+00:00'").show()   # empty, expected 1, 2
   ctx.sql("SELECT k FROM t WHERE t >= TIMESTAMP '2020-01-02 
03:04:05+00:00'").show()  # 1, 2
   ```
   
   The same happens for an INT partition directory `p=01` (only `p=1` is 
listed) and a DECIMAL `d=1.5`.
   
   DataFusion 55.0.0. The code on main is unchanged. The existing guard only 
covers percent-encoded spellings. Using the prefix only for string partition 
columns, whose value is its spelling, would avoid this; other types would then 
be filtered after parsing, as range predicates already are.
   


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