[#10302] fix(spark-connector): handle Hive default partition token in SHOW PARTITIONS#11290
Merged
diqiu50 merged 1 commit intoMay 29, 2026
Merged
Conversation
…ken in SHOW PARTITIONS
Code Coverage Report
Files |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
This PR fixes
SHOW PARTITIONSfailure in Spark connector when a Hive partition value is null and represented as the default Hive partition token for non-string partition columns.Changes include:
__HIVE_DEFAULT_PARTITION__andHIVE_DEFAULT_PARTITIONas null inSparkPartitionUtils.getSparkPartitionValue(...).TestSparkPartitionUtilsto verify token-to-null conversion.SparkHiveCatalogIT.testManagePartitionTablewith a nullINTpartition scenario forSHOW PARTITIONS.Why are the changes needed?
SHOW PARTITIONScould throwUnsupportedOperationException/NumberFormatExceptionby trying to parse Hive default partition tokens (for null values) as numeric types.Fix: #10302
Does this PR introduce any user-facing change?
Yes.
SHOW PARTITIONSnow works for Hive tables containing null values in non-string partition columns.How was this patch tested?
./gradlew :spark-connector:spark-common:test --tests org.apache.gravitino.spark.connector.utils.TestSparkPartitionUtils./gradlew :spark-connector:spark-3.5:test --tests org.apache.gravitino.spark.connector.integration.test.hive.SparkHiveCatalogIT35.testManagePartitionTable -PskipDockerTests=false./gradlew :spark-connector:spark-3.4:test --tests org.apache.gravitino.spark.connector.integration.test.hive.SparkHiveCatalogIT34.testManagePartitionTable -PskipDockerTests=false./gradlew :spark-connector:spark-3.3:test --tests org.apache.gravitino.spark.connector.integration.test.hive.SparkHiveCatalogIT33.testManagePartitionTable -PskipDockerTests=false