-
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-6048] Check if partition exists before list partition by path prefix #8402
Conversation
@yihua @YuweiXiao Can you help with a review~ |
hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/hudi/TestHoodieFileIndex.scala
Outdated
Show resolved
Hide resolved
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.
looks good overall. Thanks for contribution!
(Seq(EqualTo(attribute("region_code"), literal("0"))), | ||
"region_code = '0'", | ||
enablePartitionPathPrefixAnalysis, | ||
Seq()) |
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.
Can the test still pass if we do not apply the fix?
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.
@danny0405 when enableMetadataTable = false, enablePartitionPathPrefixAnalysis = true, can't pass
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. I have cherried pick into internal version and tested whether to work well.
Change Logs
Currently, in
tryListByPartitionPathPrefix
, when the prefix search condition is met, it will directly return or search without judging whether the directory exists.When metadata is not used, an exception will be thrown when querying non-existing partitions, for example:
ERROR Executor: Exception in task 0.0 in stage 8.0 (TID 10)
java.io.FileNotFoundException: File file:/hudi_cow_test_tbl/dt=xxx does not exist
Impact
When metadata is disabled and PartitionPathPrefixAnalysis is enabled, no exception will be thrown when querying non-existing partitions
Risk level (write none, low medium or high below)
low
Documentation Update
none
Contributor's checklist