-
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-3008] Fixing HoodieFileIndex partition column parsing for nested fields #4308
Conversation
Can we add tests please |
added |
* @param structField | ||
* @return map of ( columns names -> StructField ) | ||
*/ | ||
private def convertStructToMap(structField : Either[StructField,StructType]) : Map[String,StructField] = { |
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.
@xiarixiaoyao : can you review this patch please.
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.
nit: can we name this method "generateNameFieldMap" or "fetchNameFieldMap"
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.
yes, will do it
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.
generateNameFieldMap
Done
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.
add more tests to get good coverage. looks good.
@hudi-bot run azure |
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.
LGTM except for one minor comment. Lets wait for a day to hear from @xiarixiaoyao as well.
} | ||
} | ||
} | ||
|
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.
pls notice the code style of scala:
structField : Either[StructField,StructType] => structField: Either[StructField, StructType]
Map[String,StructField] => Map[String, StructField]
case (key :String , sf:StructField) => (field.name + "." + key , sf ) => case (key: String, sf: StructField) => (field.name + "." + key, sf )
LGTM, |
Done |
assert(fileIndex.getAllQueryPartitionPaths.get(0).partitionPath.equals("c")) | ||
} | ||
|
||
|
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.
nit: remove the empty line here?
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.
Done
@hudi-bot run azure |
@harsh1231 : Can you rebase with latest master. |
e890932
to
168fb8f
Compare
Done |
@xiarixiaoyao can you please take a look and either approve the PR or suggest next steps? |
@hudi-bot run azure |
@harsh1231, Thank you very much for your contribution. I have a little suggestion: pls pay attention to scala's code style, once fixed, we can merge this pr. |
* @return map of ( columns names -> StructField ) | ||
*/ | ||
private def generateNameFieldMap(structField : Either[StructField, StructType]) : Map[String, StructField] = { | ||
structField match { |
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 delete the space before ‘:’
private def generateNameFieldMap(structField : Either[StructField, StructType]) : Map[String, StructField] =>
private def generateNameFieldMap(structField: Either[StructField, StructType]): Map[String, StructField]
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.
Done, thanks for pointing out code style of scala.
@hudi-bot run azur |
@hudi-bot run azure |
1 similar comment
@hudi-bot run azure |
Tips
What is the purpose of the pull request
a.b.c.
which is struct in nature , loading hoodie table through spark was givingCannot find column: 'a.b.c' in the schema
Run Command :
spark.read.format("hudi").load("<table_path>").show()
This PR fixes above error by traversing schema struct recursively.
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.