Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bug with count star and partition values #52

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/functions/delta_scan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,9 @@ void DeltaMultiFileReader::FinalizeBind(const MultiFileReaderOptions &file_optio
if (!file_metadata->partition_map.empty()) {
for (idx_t i = 0; i < global_column_ids.size(); i++) {
column_t col_id = global_column_ids[i];
if (IsRowIdColumnId(col_id)) {
continue;
}
auto col_partition_entry = file_metadata->partition_map.find(global_names[col_id]);
if (col_partition_entry != file_metadata->partition_map.end()) {
// Todo: use https://github.com/delta-io/delta/blob/master/PROTOCOL.md#partition-value-serialization
Expand Down
41 changes: 40 additions & 1 deletion test/sql/dat/all.test
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ query I rowsort nested_types
SELECT *
FROM delta_scan('${DAT_PATH}/out/reader_tests/generated/nested_types/delta')
----

query I rowsort nested_types
SELECT *
FROM parquet_scan('${DAT_PATH}/out/reader_tests/generated/nested_types/expected/latest/**/*.parquet')
Expand All @@ -43,6 +42,16 @@ SELECT *
FROM parquet_scan('${DAT_PATH}/out/reader_tests/generated/basic_append/expected/latest/**/*.parquet')
----

query I rowsort basic_append_count
SELECT count(*)
FROM delta_scan('${DAT_PATH}/out/reader_tests/generated/basic_append/delta')
----

query I rowsort basic_append_count
SELECT count(*)
FROM parquet_scan('${DAT_PATH}/out/reader_tests/generated/basic_append/expected/latest/**/*.parquet')
----

# with_schema_change
query I rowsort with_checkpoint
SELECT *
Expand All @@ -54,6 +63,16 @@ SELECT *
FROM parquet_scan('${DAT_PATH}/out/reader_tests/generated/with_schema_change/expected/latest/**/*.parquet')
----

query I rowsort with_checkpoint_count
SELECT count(*)
FROM delta_scan('${DAT_PATH}/out/reader_tests/generated/with_schema_change/delta')
----

query I rowsort with_checkpoint_count
SELECT count(*)
FROM parquet_scan('${DAT_PATH}/out/reader_tests/generated/with_schema_change/expected/latest/**/*.parquet')
----

# basic_partitioned
query I rowsort basic_partitioned
SELECT *
Expand All @@ -65,6 +84,16 @@ SELECT *
FROM parquet_scan('${DAT_PATH}/out/reader_tests/generated/basic_partitioned/expected/latest/**/*.parquet')
----

query I rowsort basic_partitioned_count
SELECT count(*)
FROM delta_scan('${DAT_PATH}/out/reader_tests/generated/basic_partitioned/delta')
----

query I rowsort basic_partitioned_count
SELECT count(*)
FROM parquet_scan('${DAT_PATH}/out/reader_tests/generated/basic_partitioned/expected/latest/**/*.parquet')
----

# multi_partitioned
query I rowsort multi_partitioned
SELECT *
Expand All @@ -76,6 +105,16 @@ SELECT letter, date, decode(data) as data, number
FROM parquet_scan('${DAT_PATH}/out/reader_tests/generated/multi_partitioned/expected/latest/**/*.parquet')
----

query I rowsort multi_partitioned_count
SELECT count(*)
FROM delta_scan('${DAT_PATH}/out/reader_tests/generated/multi_partitioned/delta')
----

query I rowsort multi_partitioned_count
SELECT count(*)
FROM parquet_scan('${DAT_PATH}/out/reader_tests/generated/multi_partitioned/expected/latest/**/*.parquet')
----

# TODO: fix this
require notwindows

Expand Down
Loading