Skip to content
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

[HUDI-7305] Fix cast exception for byte/short/float partitioned field #10518

Merged
merged 7 commits into from
Jan 19, 2024

Conversation

stream2000
Copy link
Contributor

Change Logs

Fix cast exception for byte/short/float partitioned field. Now we may support all type except nested columns.

Impact

Add support for reading byte/short/float partitioned field.

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

NONE

Documentation Update

NONE

Contributor's checklist

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

@@ -274,6 +274,8 @@ object Spark3ParsePartitionUtil extends SparkParsePartitionUtil {
}.getOrElse {
Cast(Cast(Literal(value), DateType, Some(zoneId.getId)), dt).eval()
}
case BinaryType => value.getBytes()
case BooleanType => value.toBoolean
case dt => throw new IllegalArgumentException(s"Unexpected type $dt")
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks good, can we write a UT for it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure.

@hudi-bot
Copy link

CI report:

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

@danny0405 danny0405 added spark Issues related to spark schema-and-data-types labels Jan 19, 2024
@danny0405 danny0405 merged commit 696911e into apache:master Jan 19, 2024
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
schema-and-data-types spark Issues related to spark
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

3 participants