You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datafusion.apache.org by gi...@apache.org on 2026/09/08 09:21:25 UTC
(datafusion) 01/01: Cover the configMatrix runner path with an end-to-end sqllogictest fixture (#24878)
This is an automated email from the ASF dual-hosted git repository.
github-merge-queue[bot] pushed a commit to branch gh-readonly-queue/main/pr-24878-7401e1bc49aa3aca805b36759f2a391201a0e3b6
in repository https://gitbox.apache.org/repos/asf/datafusion.git
commit b39cb4a549bfa7b5619cbd16d060a2737b12c6cd
Author: Bharadwaj Pendyala <bh...@gmail.com>
AuthorDate: Tue Sep 8 09:21:11 2026 +0000
Cover the configMatrix runner path with an end-to-end sqllogictest fixture (#24878)
Adds `test_files/config_matrix.slt` for the `configMatrix` runner path
from #24493, requested by @kosiew in #24763.
It sweeps `batch_size` and `time_zone`; if overrides do not land, a
combination reads 8192 and NULL. `'2026-01-01T00:00:00Z'::timestamptz`
renders as `2026-01-01T05:30:00+05:30` or `2025-12-31T16:00:00-08:00`
under the matching setting, so all four combinations expect `true` while
asserting different results. `CREATE TABLE cm_probe` is not dropped, so
a reused `TestContext` fails with `DataFusion error: Execution error:
Table 'cm_probe' already exists`.
Test file only.
`run_each_configuration_runs_every_combination_past_failures` covers
per-combination dispatch. At base `3b6330084`, `config_matrix.slt`
passes and `--lib` is 35 passed, 0 failed. With `apply_config_overrides`
short-circuited to `Ok(())`, all 4 combinations fail, 2 assertions each,
including `[configMatrix: datafusion.execution.batch_size=1,
datafusion.execution.time_zone=+05:30]`. `time_zone` replaced
`enable_ident_normalization=true,false` because the latter's default is
swept, so its neutered-overrides control passed.
---
.../sqllogictest/test_files/config_matrix.slt | 86 ++++++++++++++++++++++
1 file changed, 86 insertions(+)
diff --git a/datafusion/sqllogictest/test_files/config_matrix.slt b/datafusion/sqllogictest/test_files/config_matrix.slt
new file mode 100644
index 0000000000..1333bc7d61
--- /dev/null
+++ b/datafusion/sqllogictest/test_files/config_matrix.slt
@@ -0,0 +1,86 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+
+# http://www.apache.org/licenses/LICENSE-2.0
+
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+
+# End-to-end cover for the `# configMatrix:` runner path added in #24493, over
+# the predicate shape #24763 fixed.
+#
+# config_matrix.rs unit-tests directive parsing and expansion, and
+# apply_config_overrides is tested against a context directly. Neither reaches
+# the wiring that builds a fresh context per combination and applies that
+# combination's overrides before the engine snapshots config.
+#
+# batch_size is swept to two values the default is not, so a run that applied no
+# overrides at all reads 8192 and fails the first query. It cannot tell one
+# combination from another, and it has no bearing on the predicate below; it is
+# here to catch a sweep that silently no-ops.
+#
+# map_string_types_to_utf8view decides whether `s` plans as Utf8View or Utf8.
+# That is the distinction #24763 turned on: under Utf8View both sides of the
+# conjunction reach the optimizer as `CAST(Utf8("a") AS Utf8View)`, which is why
+# the literal-on-left orientation was not recognised; under Utf8 the literal is
+# already a `Literal`. Sweeping it runs the repaired predicate over both column
+# types in one file. The arrow_typeof check below only proves the setting
+# reached DDL planning; the count query is what covers the predicate itself.
+#
+# What this cannot see: a runner that applied one combination four times still
+# passes, because each replay is independent and a file has no cross-run state.
+# run_each_configuration_runs_every_combination_past_failures in config_matrix.rs
+# pins that half. Neither does it fail against the pre-#24763 optimizer on
+# current main: reverting simplify_predicates.rs alone no longer reproduces the
+# collapse. See the PR thread for the commands and output.
+#
+# Matrix rules: no EXPLAIN, no in-file SET of a swept knob.
+
+# configMatrix: datafusion.execution.batch_size=1,2
+# configMatrix: datafusion.sql_parser.map_string_types_to_utf8view=true,false
+
+statement ok
+set datafusion.catalog.information_schema = true;
+
+# Never dropped: a combination handed the previous one's context fails here
+# rather than sharing its state silently.
+statement ok
+CREATE TABLE cm_predicate(s VARCHAR);
+
+statement ok
+INSERT INTO cm_predicate VALUES ('a'), ('b'), (NULL);
+
+query B
+SELECT (SELECT value FROM information_schema.df_settings
+ WHERE name = 'datafusion.execution.batch_size') IN ('1', '2');
+----
+true
+
+# The sweep has to reach SQL planning, not just the config map: the column's
+# type is what decides which branch the query below exercises.
+query B
+SELECT (arrow_typeof(s) = 'Utf8View')
+ = ((SELECT value FROM information_schema.df_settings
+ WHERE name = 'datafusion.sql_parser.map_string_types_to_utf8view') = 'true')
+FROM cm_predicate
+LIMIT 1;
+----
+true
+
+query I
+SELECT count(*) FROM cm_predicate WHERE s = 'a' AND 'a' = s;
+----
+1
+
+statement ok
+set datafusion.catalog.information_schema = false;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datafusion.apache.org
For additional commands, e-mail: commits-help@datafusion.apache.org