[
https://issues.apache.org/jira/browse/IMPALA-12675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18127046#comment-18127046
]
ASF subversion and git services commented on IMPALA-12675:
----------------------------------------------------------
Commit 9bfa999bd9fb4e7d67f3a74aea50ca2f41e167ae in impala's branch
refs/heads/master from Daniel Vanko
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=9bfa999bd ]
IMPALA-15413: Truncate Parquet page index min/max on UTF-8 boundaries
TruncateDown()/TruncateUp() cut the per-page min/max string statistics
at an arbitrary byte offset, splitting multi-byte UTF-8 sequences. Since
IMPALA-12675 annotates STRING columns as UTF-8 by default, that writes a
value that is not valid UTF-8 into a column the file declares as UTF8,
which the Parquet spec does not allow.
Both functions now leave the value on a character boundary when the
truncated prefix is valid UTF-8, and keep the previous byte-wise
behaviour otherwise. The boundary comes from simdutf's
trim_partial_utf8(), wrapped as TrimPartialUtf8().
TruncateUp() then replaces the last character whose successor still
fits in the limit with that successor, skipping surrogates, and drops
the rest. When there is none (every character is U+10FFFF), it falls
back to the byte-wise increment, so the page index is still written.
This also fixes TruncateDown() returning the whole string for inputs
longer than INT32_MAX, where the old cast of the length to int32_t went
negative.
Testing:
- extended TruncateDownTest, TruncateUpTest and Utf8UtilTest
- added test_utf8_string_values for STRING, VARCHAR and CHAR, which
fails without the fix
- test_parquet_page_index.py, string-util-test and utf8-util-test pass
Change-Id: Ib50b12a62cfad863825b1994b95a339ef6e5b788
Assisted-by: Claude Opus 5 (Claude Code)
Reviewed-on: http://gerrit.cloudera.org:8080/25008
Tested-by: Impala Public Jenkins <[email protected]>
Reviewed-by: Noemi Pap-Takacs <[email protected]>
> Set PARQUET_ANNOTATE_STRINGS_UTF8 to true by default
> ----------------------------------------------------
>
> Key: IMPALA-12675
> URL: https://issues.apache.org/jira/browse/IMPALA-12675
> Project: IMPALA
> Issue Type: Bug
> Components: Backend
> Reporter: Zoltán Borók-Nagy
> Assignee: Dániel Gábor Vankó
> Priority: Blocker
> Fix For: Impala 5.0.0
>
>
> Now that we have the BINARY type for binary data, and also have UTF-8
> support, it makes sense to set PARQUET_ANNOTATE_STRINGS_UTF8 to true by
> default in a new major release
> *We should only resolve this issue if we are ready for a new major release.*
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]