-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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-4093] Fix NPE when insert records that partition column is null #5573
Conversation
high level question/thoughts. |
@watermelon12138 : can you respond to my question above. |
@nsivabalan I am so sorry,I didn't respond in time. This problem is about partition column value being null. The solution is that when the value of the partition column is null, the |
068c83d
to
d6b556c
Compare
… the insert operation throws NPE.
d6b556c
to
6c89bfb
Compare
userSpecifiedDataTypes.keySet.foreach { name => | ||
val dataType = userSpecifiedDataTypes.get(name).getOrElse("") | ||
if (!dataType.isInstanceOf[StringType]) { | ||
partitionStr = partitionStr.replace(s"$name=default", s"$name=__HIVE_DEFAULT_PARTITION__") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this is needed only for Spark3?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also consider adding a test for this scenario.
@@ -610,7 +610,7 @@ public static Option<String> getNullableValAsString(GenericRecord rec, String fi | |||
* @return field value either converted (for certain data types) or as it is. | |||
*/ | |||
public static Object convertValueForSpecificDataTypes(Schema fieldSchema, Object fieldValue, boolean consistentLogicalTimestampEnabled) { | |||
if (fieldSchema == null) { | |||
if (fieldSchema == null || fieldValue == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this be fixed by #7349?
@watermelon12138 I suggest you to try out latest master as #7349 has been merged. It should fix the NPE. |
@watermelon12138 : If this is not an issue in current master, can you kindly close it ? |
… into partition hudi table
Tips
What is the purpose of the pull request
(For example: This pull request adds quick-start document.)
Brief change log
(for example:)
Verify this pull request
(Please pick either of the following options)
This pull request is a trivial rework / code cleanup without any test coverage.
(or)
This pull request is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
(example:)
Committer checklist
Has a corresponding JIRA in PR title & commit
Commit message is descriptive of the change
CI is green
Necessary doc changes done or have another open PR
For large changes, please consider breaking it into sub-tasks under an umbrella JIRA.