xanderbailey commented on code in PR #26310:
URL: https://github.com/apache/datafusion/pull/26310#discussion_r4483627310
##########
datafusion/datasource/src/file_groups.rs:
##########
@@ -360,7 +360,7 @@ impl FileGroupPartitioner {
/// Partition column statistics are derived from the individual file partition
values:
/// - `min` = minimum partition value across all files in the group
/// - `max` = maximum partition value across all files in the group
Review Comment:
[33ba089](https://github.com/apache/datafusion/pull/26310/commits/33ba089b1e17881b6ab94c42beae0c67aec57759)
##########
datafusion/sqllogictest/test_files/listing_table_partitions.slt:
##########
@@ -127,3 +127,118 @@ select year, count(*) from root_file_test group by year
order by year;
----
2024 2
2025 1
+
+# Test: a null partition value, which Hive compliant writers spell with a
+# `__HIVE_DEFAULT_PARTITION__` directory, is read as NULL.
+
+query I
+copy (values(1, 'alice'))
+to
'test_files/scratch/listing_table_partitions/null_part/d=2024-01-01/data.parquet';
+----
+1
+
+query I
+copy (values(2, 'bob'))
+to
'test_files/scratch/listing_table_partitions/null_part/d=__HIVE_DEFAULT_PARTITION__/data.parquet';
+----
+1
+
+statement count 0
+create external table null_part (column1 int, column2 varchar, d date)
+stored as parquet
+partitioned by (d)
+location 'test_files/scratch/listing_table_partitions/null_part/';
+
+query ITD
+select column1, column2, d from null_part order by column1;
+----
+1 alice 2024-01-01
+2 bob NULL
+
+query ITD
+select column1, column2, d from null_part where d is null;
+----
+2 bob NULL
+
+# The null partition does not match an equality filter.
+query ITD
+select column1, column2, d from null_part where d = '2024-01-01';
+----
+1 alice 2024-01-01
+
+# ... nor an inequality filter.
+query ITD
+select column1, column2, d from null_part where d <> '2024-01-01';
+----
+
+query ITD
+select column1, column2, d from null_part where d not in ('2024-01-01');
+----
+
+# Statistics for the null partition count its rows as nulls.
+query I
+select count(d) from null_part;
+----
+1
+
+query DD
+select min(d), max(d) from null_part;
+----
+2024-01-01 2024-01-01
Review Comment:
[0a245a8](https://github.com/apache/datafusion/pull/26310/commits/0a245a87e69feb2b7242a0a35ba22eaed3375159)
--
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]