Repository navigation
Conversation
VariantGet.cast and BaseVariantReader.create matched the map key with equals(DataTypes.STRING()), which also compares nullability, so a MAP<STRING NOT NULL, ...> target was treated as an invalid cast. Match the key with equalsIgnoreNullable and drop the unreachable nested branch in BaseVariantReader.create. Generated-by: Claude Code
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.
Purpose
fix #10875
VariantGet.castandBaseVariantReader.creatematched the map key withequals(DataTypes.STRING()), which also compares nullability, so aMAP<STRING NOT NULL, ...>target became an invalid cast (NULL for try, exception otherwise).SparkTypeUtilsmakes map keys NOT NULL, sotry_variant_get(v, '$.m', 'map<string,int>')returns NULL. Found by code trace and unit reproduction, not an end-to-end Spark run.equalsIgnoreNullable, as Spark matchesMapType(_: StringType, _, _), the pattern ported in [variant] Introduce assemble shredded variant struct function #6652. The unreachable nested branch increateis dropped.Tests
GenericVariantTest#testVariantGetMapWithNotNullStringKey(try and strict, nested in an array, INT key stays invalid),BaseVariantReaderTest#testMapReaderWithNotNullStringKey(shredded object), and a NOT NULL key case inPaimonShreddingUtilsTest#testAssembleAllTypes; all fail without the fix.mvn -pl paimon-common -DfailIfNoTests=false clean install(JDK 11): BUILD SUCCESS, including checkstyle, spotless and rat.