Skip to content

Conversation

jonvex
Copy link
Contributor

@jonvex jonvex commented Sep 12, 2025

Change Logs

#13885 this needs a test

Impact

unit test for avro union extraction

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

none

Documentation Update

N/A

Contributor's checklist

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

@jonvex jonvex changed the title test that exception is thrown when malformed union is used test: that exception is thrown when malformed union is used Sep 12, 2025
@github-actions github-actions bot added the size:XS PR with lines of changes in <= 10 label Sep 12, 2025
@hudi-bot
Copy link

CI report:

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

Comment on lines +941 to +943
Schema unionSchema = Schema.createUnion(Arrays.asList(Schema.create(Schema.Type.STRING), Schema.create(Schema.Type.DOUBLE)));
assertThrows(HoodieAvroSchemaException.class,
() -> HoodieAvroUtils.hasSmallPrecisionDecimalField(unionSchema));
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a valid case that the UNION has two non-null types and NULL?

Copy link
Contributor

Choose a reason for hiding this comment

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

In that case, the fix is not strictly correct?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS PR with lines of changes in <= 10

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants