Apply patches from main#323
Merged
Merged
Conversation
src/delta_utils.cpp — PredicateVisitor::VisitFilterExpression: - Added ResolveFilterColumnPath, which walks struct_extract / struct_extract_at subjects (via duckdb's TryGetStructExtractChildIndex + StructType::GetChildName) and rebuilds the dotted kernel path, e.g. i.a.b. Bare column refs still resolve to the top-level name. - Added a guard: a bare ref on a nested (struct/list/map) column is skipped. The instrumentation showed the same predicate arrives twice — once as struct_extract(struct_extract(i,'a'),'b') > 10 (resolvable) and once as #0 > 10 (path lost). The second was being pushed as a filter on i (a struct) → MissingColumnError. The struct_extract form still gives the kernel the correct predicate. src/functions/delta_scan/delta_multi_file_list.cpp — ReportFilterPushdown: made the file-count reporting tolerate multi-pass pushdown (keep max total_files / min filtered_files instead of asserting equality). Now that struct filters actually skip files, projecting i.a.b makes RemoveUnusedColumns re-run pushdown on the already-shrunken list, which tripped the old *_inconsistent assertions. Verification - write_stats_nested.test: 28 assertions, all pass (was erroring at :42). - Full test/*: 11 → 8 failures, no regressions. The struct test and both golden-table tests now pass; file-skipping counts (Scanning Files: 1/5, 0/2, 1/2) are correct. The remaining 8 are the non-struct items already triaged: 1. Partition-value type crash (part = 42 / part IS NULL) — real, duckdb#303 lineage, HIGH. 2. Stale .test fixtures vs new duckdb rendering (filter strings, EXPLAIN text, stats()) — LOW. 3. incremental_snapshot extra log reads — needs investigation, LOW.
DeltaMultiFileReader::BindOptions forwarded partition columns via hive_partitioning_indexes but never registered their types. Core's
GetHivePartitionValue defaults an unregistered partition column to VARCHAR, so the parsed value ("42") stayed VARCHAR while the pushed
ExpressionFilter was typed BIGINT → Vector::Reference type-mismatch crash in EvaluateWithConstant. One line registers the type:
options.hive_types_schema[part] = return_types[hive_partitioning_index];
Now core resolves the partition constant as the column type (and NULL partitions as a typed NULL), matching what the per-file constant_map
already did via DefaultCastAs.
Verification
- partition_equality_filter__issue_303: 11 assertions pass (was crashing on part = 42).
- write_null_partition: 10 assertions pass (was crashing on part IS NULL).
- Full test/*: 8 → 6 failures, no regressions.
1ed97cc to
e4e416b
Compare
2b31a18 to
296737d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Applies the
.github/patches/extensions/deltaset from duckdb2daa4fc, plus the fixups needed to build and pass tests against the diverged source.Applied patches
Base URL:
https://github.com/duckdb/duckdb/blob/2daa4fc9a48c638d10dcc613b1ed15d56c66f5b0/.github/patches/extensions/delta/WriteMetaData: stage values and emit oneDataChunk(STANDARD_VECTOR_SIZE-aware) instead of per-row..alias =→SetAlias(),->type→GetExpressionType().ConstantExpression::value→GetValue().TableFilter→ExpressionFilter(PredicateVisitor).expression_functions,schema_entry).delta_utils,multi_file_list,expression_functions).BoundConstantExpression::value→GetValue();func.function.GetName().FunctionExpression: iterateGetArguments()+GetExpression().Copy()instead ofGetChildrenMutable().string→Identifier/GetName()migration (17 files):EntryLookupInfo+GetEntry,child_list_t<Value>Identifier keys, etc.brotli-decompressorinCMakeLists.txt— skipped (see fixups).CreateInfofields → accessors (SchemaMutable()/SetFunctionName()/GetTableName()).CreateInfoschema/name viaSetQualifiedName(QualifiedName(...)).Fixups required afterward (not in the patches)
PredicateVisitor::VisitFilterExpression(TryGetStructExtractChildIndex+ dotted-path rebuild),plus a
RemoveUnusedColumns-rerun guard (max/min filtered-file counts). (9e274f5)delta_domain_metadata.cpp(touched by no patch): neededIdentifier/Bind-signature updates to compile.Cargo.lockalready resolvesbrotli-decompressor 5.0.0(andbrotli 8.0.2) — pin redundant.std::sortinReportFilterPushdown) + 4 fixturesre-baselined to current duckdb rendering. (
f363b9b)