Skip to content

[format] Resolve the ORC compression kind independent of the default locale - #9671

Open
jackylee-ch wants to merge 1 commit into
apache:masterfrom
jackylee-ch:orc-compression-locale
Open

[format] Resolve the ORC compression kind independent of the default locale#9671
jackylee-ch wants to merge 1 commit into
apache:masterfrom
jackylee-ch:orc-compression-locale

Conversation

@jackylee-ch

Copy link
Copy Markdown
Contributor

Purpose

Both CompressionKind.valueOf here and the copied OrcFile.WriterOptions upper cased the compression name with no locale. Under a Turkish or Azeri default locale the 'i' of zlib uppercases to a dotted capital, so the first write threw No enum constant org.apache.orc.CompressionKind.ZLİB. zlib is the only affected value of the six, and FormatTableTestBase uses it.

file.compression is now upper cased with Locale.ROOT, and orc.compress normalized 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.

…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
jackylee-ch force-pushed the orc-compression-locale branch from 38ca94f to e878ebf Compare September 7, 2026 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant