Repository navigation
Use the full column name in the dynamic_partition_overwrite delete filter - #4204
Open
dragonknightk wants to merge 1 commit into
Open
dragonknightk wants to merge 1 commit into
dragonknightk wants to merge 1 commit into
Conversation
…lter Closes issue 4196 # Rationale for this change `dynamic_partition_overwrite` built its delete filter from `find_field(source_id).name`, which is only the leaf name. For a partition sourced from the nested column `s.x`, the filter referenced `x`, so: - with a top-level `x`, it deleted rows by the wrong column and kept the old rows of the replaced partition - without one, binding the filter raised `ValueError` The filter now uses `find_column_name`, the full column name, the same way `_determine_partitions` does since apache#2204 (。•̀ᴗ-)✧ ## Are these changes tested? Yes. `test_dynamic_partition_overwrite_by_nested_source_column` in `tests/table/test_init.py` runs the example from the issue against the memory and SQL catalogs: - with this change, only partition `s.x = 5` is replaced: `[(5, 1), (9, 5)]` - without it, the test fails with `[(1, 5), (9, 5)]` ## Are there any user-facing changes? Yes, a bug fix: `dynamic_partition_overwrite` replaces the right partitions on tables partitioned by a nested column. Tables partitioned only by top-level columns behave as before (・ω・)b ## AI Disclosure Human-led contribution. Grok Bot, working for dragonknightk, assisted with this change. All submitted content was reviewed by a human before submission.
3 tasks
This branch has not been deployed
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.
Closes #4196
Rationale for this change
dynamic_partition_overwritebuilt its delete filter fromfind_field(source_id).name, which is only the leaf name. For a partition sourced from the nested columns.x, the filter referencedx, so:x, it deleted rows by the wrong column and kept the old rows of the replaced partitionValueErrorThe filter now uses
find_column_name, the full column name, the same way_determine_partitionsdoes since #2204 (。•̀ᴗ-)✧Are these changes tested?
Yes.
test_dynamic_partition_overwrite_by_nested_source_columnintests/table/test_init.pyruns the example from the issue against the memory and SQL catalogs:s.x = 5is replaced:[(5, 1), (9, 5)][(1, 5), (9, 5)]Are there any user-facing changes?
Yes, a bug fix:
dynamic_partition_overwritereplaces the right partitions on tables partitioned by a nested column. Tables partitioned only by top-level columns behave as before (・ω・)bAI Disclosure
Human-led contribution. Grok Bot, working for dragonknightk, assisted with this change. All submitted content was reviewed by a human before submission.