[format] Resolve the ORC compression kind independent of the default locale - #9671
Open
jackylee-ch wants to merge 1 commit into
Open
[format] Resolve the ORC compression kind independent of the default locale#9671jackylee-ch wants to merge 1 commit into
jackylee-ch wants to merge 1 commit into
Conversation
…locale CompressionKind.valueOf was fed compression.toUpperCase() with no locale, and the copied OrcFile.WriterOptions resolves orc.compress the same way. Under a Turkish or Azeri default locale the 'i' of zlib uppercases to a dotted capital, so writing an ORC file threw "No enum constant CompressionKind.ZLIB" with that character. zlib is the only affected value; the default zstd and the read path, which takes the kind from the postscript, were never involved. Upper case file.compression with Locale.ROOT at the call site and normalize the orc.compress option once in the constructor, so the copied ORC code never sees the lower case spelling.
jackylee-ch
force-pushed
the
orc-compression-locale
branch
from
September 7, 2026 11:15
38ca94f to
e878ebf
Compare
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
Both
CompressionKind.valueOfhere and the copiedOrcFile.WriterOptionsupper cased the compression name with no locale. Under a Turkish or Azeri default locale the 'i' ofzlibuppercases to a dotted capital, so the first write threwNo enum constant org.apache.orc.CompressionKind.ZLİB.zlibis the only affected value of the six, andFormatTableTestBaseuses it.file.compressionis now upper cased withLocale.ROOT, andorc.compressnormalized in the constructor. Reading was never involved: the kind comes from the postscript.Tests
OrcWriterFactoryTest, one test per option, asserting the resolved kind.Written with Claude Code; reasoning and verification are mine.