HIVE-29749: TypeInfoUtils fails to parse struct type strings with special characters in field names#6619
Merged
deniskuzZ merged 1 commit intoJul 22, 2026
Conversation
architjainjain
force-pushed
the
HIVE-29749-parse-special-chars
branch
from
July 21, 2026 06:27
3a7c3f6 to
8af1387
Compare
architjainjain
force-pushed
the
HIVE-29749-parse-special-chars
branch
from
July 21, 2026 08:25
8af1387 to
b414fb0
Compare
architjainjain
force-pushed
the
HIVE-29749-parse-special-chars
branch
from
July 21, 2026 12:41
b414fb0 to
9ddfc62
Compare
deniskuzZ
reviewed
Jul 21, 2026
Member
|
please create a unit test, i think q test is an overkill |
architjainjain
commented
Jul 21, 2026
architjainjain
force-pushed
the
HIVE-29749-parse-special-chars
branch
from
July 21, 2026 14:18
9ddfc62 to
baad054
Compare
architjainjain
force-pushed
the
HIVE-29749-parse-special-chars
branch
from
July 22, 2026 03:52
baad054 to
04f366c
Compare
architjainjain
force-pushed
the
HIVE-29749-parse-special-chars
branch
from
July 22, 2026 05:16
04f366c to
28f6cde
Compare
architjainjain
force-pushed
the
HIVE-29749-parse-special-chars
branch
from
July 22, 2026 08:48
28f6cde to
4d49b9a
Compare
|
Contributor
Author
|
@deniskuzZ Test passed !!! |
difin
pushed a commit
to difin/hive
that referenced
this pull request
Jul 23, 2026
…cial characters in field names (apache#6619)
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.



HIVE-29749: Fix special characters in Iceberg partition column names with quoted identifiers
What changes were proposed in this pull request?
This PR fixes support for special characters (e.g.
!@#%^&*()) in Iceberg partition column nameswhen using backtick-quoted identifiers (
hive.support.quoted.identifiers=column).One code change was made:
TypeInfoUtils.java—parseType()struct branch: When parsing a struct type string, thestruct field name reader previously accepted only a single token (which must have
isType=true).This caused an
IllegalArgumentExceptionwhen the field name contained special characters such as!,@,#,%,^,&,*,(,)because the tokenizer splits those into individualisType=falsetokens. The fix changes the struct name reader to consume all consecutive tokensuntil it encounters a structural delimiter (
:,>, or,), concatenating them into the fullfield name. Characters that ARE structural delimiters (
:,>,,) remain unsupported in barefield names, as they are used to delimit the struct type grammar itself.
Why are the changes needed?
When an Iceberg table is created with a backtick-quoted partition column containing special
characters (e.g.
`gpa_!@#%^&*()`), the partition field name is stored in the Icebergmetadata as a raw unquoted string (
gpa_!@#%^&*()).During an
INSERTinto such a table, Hive'sColumnStatsAutoGatherContexttriggers automaticcolumn statistics gathering. This calls
TypeInfoUtils.getTypeInfoFromTypeString()which callstokenize()and thenparseType().The tokenizer splits the struct type string (e.g.
struct<gpa_!@#%^&*():double>) into tokens.Since
!,@,#,%,^,&,*,(,)are notisTypeChar(), each is emitted as itsown
isType=falsetoken. ThenparseType()calledexpect("name")which only accepted a singlevalid-type token for the field name — so encountering
!aftergpa_caused:This error surfaced as a
SemanticExceptionduring the column stats rewrite, failing the INSERT.Does this PR introduce any user-facing change?
Yes. Previously, executing an
INSERTinto an Iceberg table with special characters in partitioncolumn names would fail with a
SemanticExceptionwhenhive.stats.autogather=true(thedefault). After this fix, such operations succeed correctly.
Before:
After:
-- Same DDL and INSERT succeeds without error.How was this patch tested?
A new Q test
QuotedIdentifier_1.qwas added undericeberg/iceberg-handler/src/test/queries/positive/and registered in
testconfiguration.propertiesundericeberg.llap.query.files. It covers:!@#%^&*()) in both regular column names and thepartition column name
ColumnStatsAutoGatherContext→TypeInfoUtils.getTypeInfoFromTypeString()→parseType()path that was the root cause of the bug
special-character column
Test run command:
mvn test -pl itests/qtest-iceberg -Pitests \ -Dtest=TestIcebergLlapLocalCliDriver \ -Dqfile=QuotedIdentifier_1.qTo regenerate the expected output file:
mvn test -pl itests/qtest-iceberg -Pitests \ -Dtest=TestIcebergLlapLocalCliDriver \ -Dqfile=QuotedIdentifier_1.q \ -Dtest.output.overwrite=true