Skip to content

[0.13] Core: Fixes read metadata failed after dropped partition transform for V1 format - #4572

Merged
szehon-ho merged 1 commit into
apache:0.13.xfrom
ConeyLiu:drop-partitions-0.13
Apr 18, 2022
Merged

[0.13] Core: Fixes read metadata failed after dropped partition transform for V1 format#4572
szehon-ho merged 1 commit into
apache:0.13.xfrom
ConeyLiu:drop-partitions-0.13

Conversation

@ConeyLiu

Copy link
Copy Markdown
Contributor

This backs port #3411 to 0.13.x branch.

This patch fixes two problems:

  1. For V1 tables, we use a VoidTransform to replace the removed partition field. While the result type of VoidTransform same as the type of the field. For example, the result type of Bucket(2, string_type_field) is int, while is string for VoidTransform(string_type_field). So we should use the original partition field type(int instead of string) to build the common partitioning type.
  2. We should use the matched PartitionSpec to convert the PartitionFiedlSummary to human string, not the current table spec.

…r V1 format (apache#3411)
V1 Tables replace dropped partition transforms with a Void Transform which always returns null. The type of this Void transform always matches the column's original type. This has issues when the column's type differed from the transform used to previously partition the column. Here the issue is patched by retaining the correct type for the transform values when those values are being read after the transform has been dropped.
@ConeyLiu

Copy link
Copy Markdown
ContributorAuthor

cc @szehon-ho@rdblue

@ConeyLiuConeyLiu changed the title [0.13] Core: Fixes read metadata failed after dropped partition transform fo…[0.13] Core: Fixes read metadata failed after dropped partition for V1 formatApr 16, 2022
@ConeyLiuConeyLiu changed the title [0.13] Core: Fixes read metadata failed after dropped partition for V1 format[0.13] Core: Fixes read metadata failed after dropped partition transform for V1 formatApr 16, 2022

@szehon-hoszehon-ho left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @ConeyLiu

@szehon-ho
szehon-ho merged commit b521f40 into apache:0.13.xApr 18, 2022
szehon-ho added a commit to szehon-ho/iceberg that referenced this pull request Apr 18, 2022
@ConeyLiu

Copy link
Copy Markdown
ContributorAuthor

Thanks @szehon-ho.

@ConeyLiu
ConeyLiu deleted the drop-partitions-0.13 branch April 19, 2022 03:05
@nastranastra added this to the Iceberg 0.13.2 Release milestone May 16, 2022
szehon-ho added a commit to szehon-ho/iceberg that referenced this pull request May 23, 2022
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@ConeyLiu@szehon-ho@nastra