Skip to content

[HUDI-9269] Handle tight bound field in columns stats metadata #13117

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

Merged
merged 1 commit into from
Apr 10, 2025

Conversation

codope
Copy link
Member

@codope codope commented Apr 9, 2025

Change Logs

If reading column stats from an older version of Hudi, isTightBound field is not present. We should handle that appropriately, otherwise it leads to below exception:

Caused by: org.apache.hudi.exception.HoodieException: Unable to instantiate payload class 
    at org.apache.hudi.common.util.HoodieRecordUtils.loadPayload(HoodieRecordUtils.java:114)
    at org.apache.hudi.common.util.SpillableMapUtils.convertToHoodieRecordPayload(SpillableMapUtils.java:155)
    at org.apache.hudi.metadata.HoodieBackedTableMetadata.composeRecord(HoodieBackedTableMetadata.java:560)
    at org.apache.hudi.metadata.HoodieBackedTableMetadata.lambda$fetchBaseFileRecordsByKeys$11(HoodieBackedTableMetadata.java:435)
    at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:215)
    at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
    at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1939)
    at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:570)
    at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:560)
    at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
    at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265)
    at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:727)
    at org.apache.hudi.metadata.HoodieBackedTableMetadata.fetchBaseFileRecordsByKeys(HoodieBackedTableMetadata.java:437)
    at org.apache.hudi.metadata.HoodieBackedTableMetadata.readFromBaseAndMergeWithLogRecords(HoodieBackedTableMetadata.java:402)
    at org.apache.hudi.metadata.HoodieBackedTableMetadata.lambda$getRecordsByKeyPrefixes$7539c171$1(HoodieBackedTableMetadata.java:237)
    at org.apache.hudi.common.function.FunctionWrapper.lambda$throwingMapWrapper$0(FunctionWrapper.java:38)
    ... 27 more
Caused by: java.lang.reflect.InvocationTargetException
    at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:74)
    at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:501)
    at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:485)
    at org.apache.hudi.common.util.HoodieRecordUtils.loadPayload(HoodieRecordUtils.java:112)
    ... 42 more
Caused by: org.apache.avro.AvroRuntimeException: Not a valid schema field: isTightBound
    at org.apache.avro.generic.GenericData$Record.get(GenericData.java:282)
    at org.apache.hudi.metadata.MetadataPartitionType.constructColumnStatsMetadataPayload(MetadataPartitionType.java:318)
    at org.apache.hudi.metadata.MetadataPartitionType.access$200(MetadataPartitionType.java:97)
    at org.apache.hudi.metadata.MetadataPartitionType$2.constructMetadataPayload(MetadataPartitionType.java:122)
    at org.apache.hudi.metadata.HoodieMetadataPayload.<init>(HoodieMetadataPayload.java:204)
    at org.apache.hudi.metadata.HoodieMetadataPayload.<init>(HoodieMetadataPayload.java:190)
    at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:62)
    ... 45 more 

Impact

1.0 can read 0.x column stats.

Risk level (write none, low medium or high below)

low

Documentation Update

Describe any necessary documentation update if there is any new feature, config, or user-facing change. If not, put "none".

  • The config description must be updated if new configs are added or the default value of the configs are changed
  • Any new feature or user-facing change requires updating the Hudi website. Please create a Jira ticket, attach the
    ticket number here and follow the instruction to make
    changes to the website.

Contributor's checklist

  • Read through contributor's guide
  • Change Logs and Impact were stated clearly
  • Adequate tests were added if applicable
  • CI passed

@github-actions github-actions bot added the size:S PR with lines of changes in (10, 100] label Apr 9, 2025
@nsivabalan nsivabalan force-pushed the handle-tight-bound branch from d228dda to 8795e02 Compare April 9, 2025 23:27
@hudi-bot
Copy link

hudi-bot commented Apr 9, 2025

CI report:

Bot commands @hudi-bot supports the following commands:
  • @hudi-bot run azure re-run the last Azure build

@nsivabalan
Copy link
Contributor

image

@nsivabalan nsivabalan merged commit ffa3a3b into apache:master Apr 10, 2025
59 of 60 checks passed
voonhous pushed a commit to voonhous/hudi that referenced this pull request Apr 10, 2025
voonhous pushed a commit to voonhous/hudi that referenced this pull request Apr 11, 2025
voonhous pushed a commit to voonhous/hudi that referenced this pull request Apr 15, 2025
voonhous pushed a commit to voonhous/hudi that referenced this pull request Apr 16, 2025
voonhous pushed a commit to voonhous/hudi that referenced this pull request Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-1.0.2 size:S PR with lines of changes in (10, 100]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants