Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,9 @@ class SparkHoodieTableFileIndex(spark: SparkSession,
// prefix to try to reduce the scope of the required file-listing
val relativePartitionPathPrefix = composeRelativePartitionPath(staticPartitionColumnNameValuePairs)

if (staticPartitionColumnNameValuePairs.length == partitionColumnNames.length) {
if (!metaClient.getFs.exists(new Path(getBasePath, relativePartitionPathPrefix))) {
Seq()
} else if (staticPartitionColumnNameValuePairs.length == partitionColumnNames.length) {
// In case composed partition path is complete, we can return it directly avoiding extra listing operation
Seq(new PartitionPath(relativePartitionPathPrefix, staticPartitionColumnNameValuePairs.map(_._2.asInstanceOf[AnyRef]).toArray))
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,12 @@ class TestHoodieFileIndex extends HoodieSparkClientTestBase with ScalaAssertionS
EqualTo(attribute("region_code"), literal("1"))),
"dt = '2023/01/01' and region_code = '1'",
enablePartitionPathPrefixAnalysis,
Seq(("1", "2023/01/01")))
Seq(("1", "2023/01/01"))),
// no partition matched
(Seq(EqualTo(attribute("region_code"), literal("0"))),
"region_code = '0'",
enablePartitionPathPrefixAnalysis,
Seq())
Copy link
Contributor

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?

Copy link
Contributor Author

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

)

testCases.foreach(testCase => {
Expand Down