You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Extends the existing TextIndexLike + JsonSkipIndex coverage toward the full
ClickHouse text-index surface. Validated on dev-vm head 26.6.1.734: a 1-hour
full-fleet run (167k queries, all ~45 oracles) produced 0 false positives from
any of these units. Soundness rules below were established empirically there.
ClickHouse#3 Pure-optimization toggle arm: TextIndexLike gains a DIRECT_READ_OFF arm
(query_plan_direct_read_from_text_index=0, query_plan_text_index_add_hint=0).
A pure optimization toggle must never change results; UNKNOWN_SETTING is
already tolerated so it degrades on older builds.
ClickHouse#4 Merge + delete-masked-part topology: TextIndexLike optionally issues a
synchronous lightweight DELETE (lightweight_deletes_sync=2) and/or OPTIMIZE
TABLE ... FINAL after the inserts, recording topology in assertion messages.
The Java ground truth now counts over the live (non-deleted) rows. Targets
the #107309 class (index honoring a delete-masked part).
ClickHouse#6 General-fleet predicate injection: generateTextSearchPredicate emits
startsWith / endsWith / multiSearchAny over plain String columns from a fixed
vocabulary, gated by --text-search-predicate-emission (default on). These
three are the functions proven index==scan-equivalent across ALL tokenizers
(incl. array). hasToken/hasAllTokens/hasAnyTokens are deliberately NOT emitted
here: hasToken diverges index-vs-scan on the array tokenizer (whole-value
token) and hasAllTokens/hasAnyTokens diverge on ngrams (the multi-token
needle's space-spanning grams) -- by-design tokenizer-semantics differences,
not bugs. Sound for NoREC because renderSkipIndex never carries a preprocessor.
#7a renderSkipIndex breadth: full tokenizer matrix (splitByNonAlpha, ngrams(N),
array, asciiCJK, splitByString, sparseGrams) and text() eligibility extended
to FixedString / LowCardinality(String) / Nullable(String) / Array(String)
(bare) and Map(String,*) via mapKeys/mapValues expression indexes. New
ClickHouseErrors.getTextIndexErrors() tolerances wired into table creation.
ClickHouse#5 TextIndexPreprocessor oracle (NEW): builds a private table with
INDEX(s) preprocessor=lower(s), then asserts that a forced direct read
(force_data_skipping_indices + direct_read=1, add_hint=0) over a mixed-case
corpus equals a Java lower()-token-membership ground truth. (The documented
INDEX(lower(s)) equivalent form cannot be force-engaged for hasToken(s,...) on
26.6.1.734 -- it raises INDEX_NOT_USED -- so the ground-truth comparison
replaces a second-table comparison.)
#7b TextIndexContainer oracle (NEW): Array(String) + array tokenizer with exact
has/hasAny/hasAll List ground truth, and Map(String,String) key-vs-value
isolation via mapContainsKey/mapContainsValue, across DEFAULT /
ignore_data_skipping_indices / use_skip_indexes=0 arms.
ALTER lifecycle: ClickHouseAlterGenerator gains ADD_INDEX / MATERIALIZE_INDEX /
CLEAR_INDEX / DROP_INDEX kinds. New ClickHouseTextIndexLifecycle oracle
asserts CREATE-with-index == (index-free + ALTER ADD INDEX + MATERIALIZE
INDEX SETTINGS mutations_sync=2) == use_skip_indexes=0 scan over a predicate
battery (LIKE + hasToken always; hasAllTokens/hasAnyTokens only on the
splitByNonAlpha arm, where they are index==scan-equivalent), exercising the
distinct MATERIALIZE-over-historical-parts code path.
All three new oracles registered in ClickHouseOracleFactory and the run /
validity oracle-name lists. All oracles use private per-iteration tables, fixed
token vocabulary, and integer-key/count comparisons to stay clear of the repo's
known false-positive families.
Copy file name to clipboardExpand all lines: .claude/collect-oracle-validity.sh
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ THREADS="${THREADS:-6}"
20
20
OUTDIR="$ROOT/val"
21
21
22
22
# Full current oracle set (from run-sqlancer.sh ALL_ORACLES).
23
-
IFS=','read -r -a ORACLES <<<"TLPWhere,TLPDistinct,TLPGroupBy,TLPAggregate,TLPHaving,NoREC,PQS,CERT,CODDTest,SEMR,SEMRMulti,EET,SetOpTLP,CombinatorTLP,QccCache,SortedUnionLimitBy,SchemaRoundtrip,JoinAlgorithm,Cast,Parallelism,PartitionMirror,KeyCondition,TableFunctionIN,ViewEquivalence,AggregateStateRoundtrip,MaterializedViewConsistency,FinalMerge,ProjectionToggle,PatchPartConsistency,DictGetVsJoin,WindowEquivalence,DynamicSubcolumn,SubqueryMaterialize,MutationAnalyzer,TextIndexLike,TopK,JoinReorder,NaturalJoin,JsonSkipIndex,MaterializedCte,StatsToggle,ExtendedDatetime,JoinUseNulls,QueryCache"
23
+
IFS=','read -r -a ORACLES <<<"TLPWhere,TLPDistinct,TLPGroupBy,TLPAggregate,TLPHaving,NoREC,PQS,CERT,CODDTest,SEMR,SEMRMulti,EET,SetOpTLP,CombinatorTLP,QccCache,SortedUnionLimitBy,SchemaRoundtrip,JoinAlgorithm,Cast,Parallelism,PartitionMirror,KeyCondition,TableFunctionIN,ViewEquivalence,AggregateStateRoundtrip,MaterializedViewConsistency,FinalMerge,ProjectionToggle,PatchPartConsistency,DictGetVsJoin,WindowEquivalence,DynamicSubcolumn,SubqueryMaterialize,MutationAnalyzer,TextIndexLike,TopK,JoinReorder,NaturalJoin,JsonSkipIndex,MaterializedCte,StatsToggle,ExtendedDatetime,JoinUseNulls,QueryCache,TextIndexPreprocessor,TextIndexContainer,TextIndexLifecycle"
Copy file name to clipboardExpand all lines: src/sqlancer/clickhouse/ClickHouseOptions.java
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -59,6 +59,9 @@ public class ClickHouseOptions implements DBMSSpecificOptions<ClickHouseOracleFa
59
59
@Parameter(names = "--variant-where-emission", description = "Emit Variant-typed predicate fragments in WHERE context (26.1 Variant-in-all-functions surface, PR #90900 + use_variant_as_common_type default-on, PR #90677). WHERE-only by design: the client-v2 RowBinary reader cannot decode a projected Variant column (R4), so the fragments are self-contained Boolean expressions and never reach a fetch column. Default-on since the 2026-06-10 convergence run (0 reader deaths, 0 false positives; the toInt64 constant-fallback wrap is load-bearing).", arity = 1)
60
60
publicbooleanvariantWhereEmission = true;
61
61
62
+
@Parameter(names = "--text-search-predicate-emission", description = "Emit full-text-search predicates (hasToken/hasAllTokens/hasAnyTokens/startsWith/endsWith/multiSearchAny) over plain String columns in general WHERE context, from a fixed token vocabulary. Lets the whole oracle fleet (TLPWhere/NoREC/CODDTest/...) incidentally differential-test text-indexed columns against full scans. Sound for NoREC because the general schema never carries a preprocessor on a text index (index path == scan path for preprocessor-free hasToken); preprocessor coverage lives only in the dedicated TextIndexPreprocessor oracle.", arity = 1)
63
+
publicbooleantextSearchPredicateEmission = true;
64
+
62
65
@Parameter(names = "--join-reorder-allow-dropped-key-ref", description = "Let the JoinReorder oracle build ON clauses that reference a key column dropped by a preceding SEMI/ANTI join. Default false, PERMANENTLY: ClickHouse#107073 was closed by the optimizer team as by-design non-determinism -- columns read from the eliminated side of a SEMI/ANTI join are ANY-like (filled from whichever matching row arrives first), so any plan change or physical row-order change legally flips the result and a differential oracle comparing such queries is unsound. The restriction is therefore a soundness rule, not a temporary known-bug pin. Set true only to demonstrate the documented non-determinism.", arity = 1)
0 commit comments