Repository navigation
Carry the ClickHouse patches from v4.6.11 onto v5.0.8 - #11
Merged
thevar1able merged 2 commits intoOct 30, 2026
Merged
Conversation
The SIMD backends already gate the stage-1 UTF-8 accumulate step on SIMDJSON_UTF8VALIDATION (src/generic/stage1/json_structural_indexer.h), which cmake/developer-options.cmake exposes as the SIMDJSON_SKIPUTF8VALIDATION option. src/fallback.cpp never consults the macro: its scalar string scanner calls validate_utf8_character() unconditionally, so a build configured with the option ON still returns UTF8_ERROR whenever fallback is the active backend. Put the same #if around that call. The #else arm advances a single byte, which leaves the scan equivalent to the SIMD backends: every byte that matters structurally (a quote, a backslash, a control character) is below 0x80, so char_is_ascii_stop still stops on it at the next iteration whatever the non-ASCII bytes happen to be, and the UNESCAPED_CHARS check is untouched. implementation::validate_utf8() and the per-backend generic_validate_utf8() are deliberately left alone: reporting encoding validity is their whole contract. Co-Authored-By: Claude Opus 5 <[email protected]> (cherry picked from commit e31ec45)
Non-x86 toolchains may predefine __SSE2__ to switch on their x86-intrinsic emulation: ClickHouse builds ppc64le with -maltivec -D__SSE2__=1. clang's ppc_wrappers then spell __m128i as __vector unsigned char while _mm_loadu_si128 takes __m128i_u, so every load in key_selector.h fails with "no known conversion from 'const __m128i *' to 'const __m128i_u *'" and the ppc64le build breaks (ClickHouse PR #124651, Build (ppc64le)). Require an actual x86 target before enabling SIMDJSON_KEY_SELECTOR_HAS_SSE2, so such targets use the scalar key selector, which is correct and only somewhat slower.
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.
Rebases the ClickHouse patches onto upstream
v5.0.8, original authors preserved.ondemand/key_selector.h(new in v5) takes its SSE2 path whenever__SSE2__is defined, which breaks ClickHouse's ppc64le build (-D__SSE2__=1emulation).