diff --git a/Cargo.lock b/Cargo.lock index ee05bc1b9442..3f597a88d971 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -12311,9 +12311,9 @@ dependencies = [ [[package]] name = "quinn" -version = "0.11.5" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +checksum = "b22d8e7369034b9a7132bc2008cac12f2013c8132b45e0554e6e20e2617f2156" dependencies = [ "bytes", "pin-project-lite", diff --git a/src/meta/api/src/schema_api_impl.rs b/src/meta/api/src/schema_api_impl.rs index 2a99b78759d2..74ac7c7a5f15 100644 --- a/src/meta/api/src/schema_api_impl.rs +++ b/src/meta/api/src/schema_api_impl.rs @@ -3613,18 +3613,17 @@ fn build_upsert_table_deduplicated_label(deduplicated_label: String) -> TxnOp { #[fastrace::trace] async fn batch_filter_table_info( kv_api: &(impl kvapi::KVApi + ?Sized), - filter_db_info_with_table_name_list: &[(&TableInfoFilter, &Arc, u64, &String)], + args: &[(&TableInfoFilter, &Arc, u64, String)], filter_tb_infos: &mut Vec<(Arc, u64)>, ) -> Result<(), KVAppError> { - let table_id_idents = filter_db_info_with_table_name_list + let table_id_idents = args .iter() .map(|(_f, _db, table_id, _table_name)| TableId::new(*table_id)); let seq_metas = kv_api.get_pb_values_vec(table_id_idents).await?; - for (seq_meta, (filter, db_info, table_id, table_name)) in seq_metas - .into_iter() - .zip(filter_db_info_with_table_name_list.iter()) + for (seq_meta, (filter, db_info, table_id, table_name)) in + seq_metas.into_iter().zip(args.iter()) { let Some(seq_meta) = seq_meta else { error!( @@ -3671,42 +3670,12 @@ async fn get_gc_table_info( limit: usize, table_id_list: &TableFilterInfoList<'_>, ) -> Result, u64)>, KVAppError> { - let mut filter_tb_infos = vec![]; - - let mut filter_db_info_with_table_name_list: Vec<( - &TableInfoFilter, - &Arc, - u64, - &String, - )> = vec![]; - - for (filter, db_info, table_id, table_name) in table_id_list { - filter_db_info_with_table_name_list.push((filter, db_info, *table_id, table_name)); - if filter_db_info_with_table_name_list.len() < DEFAULT_MGET_SIZE { - continue; - } + let table_id_list = &table_id_list[..std::cmp::min(limit, table_id_list.len())]; - batch_filter_table_info( - kv_api, - &filter_db_info_with_table_name_list, - &mut filter_tb_infos, - ) - .await?; - - filter_db_info_with_table_name_list.clear(); - - if filter_tb_infos.len() >= limit { - return Ok(filter_tb_infos); - } - } + let mut filter_tb_infos = vec![]; - if !filter_db_info_with_table_name_list.is_empty() { - batch_filter_table_info( - kv_api, - &filter_db_info_with_table_name_list, - &mut filter_tb_infos, - ) - .await?; + for chunk in table_id_list.chunks(DEFAULT_MGET_SIZE) { + batch_filter_table_info(kv_api, chunk, &mut filter_tb_infos).await?; } Ok(filter_tb_infos) diff --git a/src/query/expression/src/utils/display.rs b/src/query/expression/src/utils/display.rs index 153323ecbd4a..c0023fc7b8a9 100755 --- a/src/query/expression/src/utils/display.rs +++ b/src/query/expression/src/utils/display.rs @@ -755,7 +755,7 @@ impl Expr { precedence: usize, min_precedence: usize, ) -> String { - if precedence < min_precedence { + if precedence < min_precedence || matches!(op, "AND" | "OR") { format!( "({} {op} {})", write_expr(lhs, precedence), diff --git a/src/query/functions/tests/it/scalars/testdata/boolean.txt b/src/query/functions/tests/it/scalars/testdata/boolean.txt index 8eb8817b3d5b..63f8e4af1869 100644 --- a/src/query/functions/tests/it/scalars/testdata/boolean.txt +++ b/src/query/functions/tests/it/scalars/testdata/boolean.txt @@ -65,7 +65,7 @@ error: --> SQL:1:1 | 1 | 'a' and 1 - | ^^^ cannot parse to type `BOOLEAN` while evaluating function `to_boolean('a')` in expr `to_boolean('a')`, during run expr: `to_boolean('a') AND to_boolean(1)` + | ^^^ cannot parse to type `BOOLEAN` while evaluating function `to_boolean('a')` in expr `to_boolean('a')`, during run expr: `(to_boolean('a') AND to_boolean(1))` diff --git a/src/query/service/src/pipelines/processors/transforms/hash_join/probe_join/cross_join.rs b/src/query/service/src/pipelines/processors/transforms/hash_join/probe_join/cross_join.rs index 834d7c96bb18..235ca26a6c96 100644 --- a/src/query/service/src/pipelines/processors/transforms/hash_join/probe_join/cross_join.rs +++ b/src/query/service/src/pipelines/processors/transforms/hash_join/probe_join/cross_join.rs @@ -35,8 +35,19 @@ impl HashJoinProbeState { if build_num_rows == 0 || input_num_rows == 0 { return Ok(vec![]); } - let probe_block = input.project(&self.probe_projections); + let mut probe_block = input.project(&self.probe_projections); let build_block = DataBlock::concat(build_blocks)?; + if build_num_rows == 1 { + for col in build_block.columns() { + let value_ref = col.value.as_ref(); + let scalar = unsafe { value_ref.index_unchecked(0) }; + probe_block.add_column(BlockEntry::new( + col.data_type.clone(), + Value::Scalar(scalar.to_owned()), + )); + } + return Ok(vec![probe_block]); + } let mut result_blocks = Vec::with_capacity(input_num_rows); for i in 0..input_num_rows { result_blocks.push(self.merge_with_constant_block( diff --git a/tests/sqllogictests/suites/mode/cluster/explain_v2.test b/tests/sqllogictests/suites/mode/cluster/explain_v2.test index 6e1d850fc04d..0aef8d2184b8 100644 --- a/tests/sqllogictests/suites/mode/cluster/explain_v2.test +++ b/tests/sqllogictests/suites/mode/cluster/explain_v2.test @@ -42,7 +42,7 @@ Exchange ├── exchange type: Merge └── Filter ├── output columns: [t1.a (#0), t1.b (#1), t2.b (#3), t2.a (#2)] - ├── filters: [t1.a (#0) > 3 OR t2.a (#2) > 5 AND t1.a (#0) > 1] + ├── filters: [(t1.a (#0) > 3 OR (t2.a (#2) > 5 AND t1.a (#0) > 1))] ├── estimated rows: 99.60 └── HashJoin ├── output columns: [t1.a (#0), t1.b (#1), t2.b (#3), t2.a (#2)] @@ -56,7 +56,7 @@ Exchange │ ├── exchange type: Broadcast │ └── Filter │ ├── output columns: [t2.a (#2), t2.b (#3)] - │ ├── filters: [t2.a (#2) > 3 OR t2.a (#2) > 1] + │ ├── filters: [(t2.a (#2) > 3 OR t2.a (#2) > 1)] │ ├── estimated rows: 99.92 │ └── TableScan │ ├── table: default.default.t2 @@ -66,11 +66,11 @@ Exchange │ ├── partitions total: 3 │ ├── partitions scanned: 3 │ ├── pruning stats: [segments: , blocks: ] - │ ├── push downs: [filters: [t2.a (#2) > 3 OR t2.a (#2) > 1], limit: NONE] + │ ├── push downs: [filters: [(t2.a (#2) > 3 OR t2.a (#2) > 1)], limit: NONE] │ └── estimated rows: 100.00 └── Filter(Probe) ├── output columns: [t1.a (#0), t1.b (#1)] - ├── filters: [t1.a (#0) > 3 OR t1.a (#0) > 1] + ├── filters: [(t1.a (#0) > 3 OR t1.a (#0) > 1)] ├── estimated rows: 99.92 └── TableScan ├── table: default.default.t1 @@ -80,7 +80,7 @@ Exchange ├── partitions total: 3 ├── partitions scanned: 3 ├── pruning stats: [segments: , blocks: ] - ├── push downs: [filters: [t1.a (#0) > 3 OR t1.a (#0) > 1], limit: NONE] + ├── push downs: [filters: [(t1.a (#0) > 3 OR t1.a (#0) > 1)], limit: NONE] └── estimated rows: 100.00 query T diff --git a/tests/sqllogictests/suites/mode/standalone/ee/explain_agg_index.test b/tests/sqllogictests/suites/mode/standalone/ee/explain_agg_index.test index e9baa6419c0d..41159c03b801 100644 --- a/tests/sqllogictests/suites/mode/standalone/ee/explain_agg_index.test +++ b/tests/sqllogictests/suites/mode/standalone/ee/explain_agg_index.test @@ -491,7 +491,7 @@ Sort ├── estimated rows: 0.00 └── Filter ├── output columns: [onebrc.station_name (#0), onebrc.measurement (#1)] - ├── filters: [is_true(onebrc.measurement (#1) > 0), is_true(onebrc.station_name (#0) = 'Beijing'), is_true(onebrc.measurement (#1) = 1 OR onebrc.measurement (#1) = 2)] + ├── filters: [is_true(onebrc.measurement (#1) > 0), is_true(onebrc.station_name (#0) = 'Beijing'), is_true((onebrc.measurement (#1) = 1 OR onebrc.measurement (#1) = 2))] ├── estimated rows: 0.00 └── TableScan ├── table: default.test_index_db.onebrc @@ -500,9 +500,9 @@ Sort ├── read size: 0 ├── partitions total: 0 ├── partitions scanned: 0 - ├── push downs: [filters: [and_filters(and_filters(onebrc.measurement (#1) > 0, onebrc.station_name (#0) = 'Beijing'), onebrc.measurement (#1) = 1 OR onebrc.measurement (#1) = 2)], limit: NONE] + ├── push downs: [filters: [and_filters(and_filters(onebrc.measurement (#1) > 0, onebrc.station_name (#0) = 'Beijing'), (onebrc.measurement (#1) = 1 OR onebrc.measurement (#1) = 2))], limit: NONE] ├── aggregating index: [SELECT station_name, measurement, COUNT(), COUNT(measurement), MAX(measurement), MIN(measurement), SUM(measurement) FROM test_index_db.onebrc GROUP BY station_name, measurement] - ├── rewritten query: [selection: [index_col_0 (#0), index_col_1 (#1), index_col_5 (#5), index_col_6 (#6), index_col_3 (#3), index_col_4 (#4)], filter: is_true(index_col_1 (#1) > CAST(0 AS Float64 NULL) AND index_col_0 (#0) = CAST('Beijing' AS String NULL) AND (index_col_1 (#1) = CAST(1 AS Float64 NULL) OR index_col_1 (#1) = CAST(2 AS Float64 NULL)))] + ├── rewritten query: [selection: [index_col_0 (#0), index_col_1 (#1), index_col_5 (#5), index_col_6 (#6), index_col_3 (#3), index_col_4 (#4)], filter: is_true(((index_col_1 (#1) > CAST(0 AS Float64 NULL) AND index_col_0 (#0) = CAST('Beijing' AS String NULL)) AND (index_col_1 (#1) = CAST(1 AS Float64 NULL) OR index_col_1 (#1) = CAST(2 AS Float64 NULL))))] └── estimated rows: 0.00 statement ok @@ -620,7 +620,7 @@ Sort ├── estimated rows: 0.00 └── Filter ├── output columns: [onebrc.station_name (#0), onebrc.measurement (#1)] - ├── filters: [is_true(onebrc.station_name (#0) = 'Paris' OR onebrc.station_name (#0) = 'Beijing')] + ├── filters: [is_true((onebrc.station_name (#0) = 'Paris' OR onebrc.station_name (#0) = 'Beijing'))] ├── estimated rows: 0.00 └── TableScan ├── table: default.test_index_db.onebrc @@ -629,7 +629,7 @@ Sort ├── read size: 0 ├── partitions total: 0 ├── partitions scanned: 0 - ├── push downs: [filters: [is_true(onebrc.station_name (#0) = 'Paris' OR onebrc.station_name (#0) = 'Beijing')], limit: NONE] + ├── push downs: [filters: [is_true((onebrc.station_name (#0) = 'Paris' OR onebrc.station_name (#0) = 'Beijing'))], limit: NONE] ├── aggregating index: [SELECT station_name, COUNT(), COUNT(measurement), MAX(measurement), MIN(measurement), SUM(measurement) FROM test_index_db.onebrc WHERE station_name IN('Paris', 'Beijing') GROUP BY station_name] ├── rewritten query: [selection: [index_col_0 (#0), index_col_4 (#4), index_col_5 (#5), index_col_2 (#2), index_col_3 (#3)]] └── estimated rows: 0.00 diff --git a/tests/sqllogictests/suites/mode/standalone/explain/eliminate_outer_join.test b/tests/sqllogictests/suites/mode/standalone/explain/eliminate_outer_join.test index 5b1e7663fba4..8394fb86f67d 100644 --- a/tests/sqllogictests/suites/mode/standalone/explain/eliminate_outer_join.test +++ b/tests/sqllogictests/suites/mode/standalone/explain/eliminate_outer_join.test @@ -538,7 +538,7 @@ explain select * from t left join t t1 on t.a = t1.a where t1.a <= 1 or t.a < 1 ---- Filter ├── output columns: [t.a (#0), t1.a (#1)] -├── filters: [is_true(t1.a (#1) <= 1 OR t.a (#0) < 1)] +├── filters: [is_true((t1.a (#1) <= 1 OR t.a (#0) < 1))] ├── estimated rows: 1.90 └── HashJoin ├── output columns: [t.a (#0), t1.a (#1)] @@ -573,7 +573,7 @@ explain select * from t left join t t1 on t.a = t1.a where t1.a <= 1 or (t.a > 1 ---- Filter ├── output columns: [t.a (#0), t1.a (#1)] -├── filters: [is_true(t1.a (#1) <= 1 OR t.a (#0) > 1 AND t1.a (#1) > 1)] +├── filters: [is_true((t1.a (#1) <= 1 OR (t.a (#0) > 1 AND t1.a (#1) > 1)))] ├── estimated rows: 6.13 └── HashJoin ├── output columns: [t.a (#0), t1.a (#1)] @@ -584,7 +584,7 @@ Filter ├── estimated rows: 7.47 ├── Filter(Build) │ ├── output columns: [t1.a (#1)] - │ ├── filters: [is_true(t1.a (#1) <= 1 OR t1.a (#1) > 1)] + │ ├── filters: [is_true((t1.a (#1) <= 1 OR t1.a (#1) > 1))] │ ├── estimated rows: 8.20 │ └── TableScan │ ├── table: default.eliminate_outer_join.t @@ -594,11 +594,11 @@ Filter │ ├── partitions total: 1 │ ├── partitions scanned: 1 │ ├── pruning stats: [segments: , blocks: ] - │ ├── push downs: [filters: [is_true(t.a (#1) <= 1 OR t.a (#1) > 1)], limit: NONE] + │ ├── push downs: [filters: [is_true((t.a (#1) <= 1 OR t.a (#1) > 1))], limit: NONE] │ └── estimated rows: 10.00 └── Filter(Probe) ├── output columns: [t.a (#0)] - ├── filters: [is_true(t.a (#0) <= 1 OR t.a (#0) > 1)] + ├── filters: [is_true((t.a (#0) <= 1 OR t.a (#0) > 1))] ├── estimated rows: 8.20 └── TableScan ├── table: default.eliminate_outer_join.t @@ -608,7 +608,7 @@ Filter ├── partitions total: 1 ├── partitions scanned: 1 ├── pruning stats: [segments: , blocks: ] - ├── push downs: [filters: [is_true(t.a (#0) <= 1 OR t.a (#0) > 1)], limit: NONE] + ├── push downs: [filters: [is_true((t.a (#0) <= 1 OR t.a (#0) > 1))], limit: NONE] └── estimated rows: 10.00 query T @@ -616,7 +616,7 @@ explain select * from t left join t t1 on t.a = t1.a where t1.a <= 1 or (t.a > 1 ---- Filter ├── output columns: [t.a (#0), t1.a (#1)] -├── filters: [is_true(t1.a (#1) <= 1 OR t.a (#0) > 1 AND t.a (#0) < 2)] +├── filters: [is_true((t1.a (#1) <= 1 OR (t.a (#0) > 1 AND t.a (#0) < 2)))] ├── estimated rows: 2.80 └── HashJoin ├── output columns: [t.a (#0), t1.a (#1)] diff --git a/tests/sqllogictests/suites/mode/standalone/explain/explain.test b/tests/sqllogictests/suites/mode/standalone/explain/explain.test index 940d94cf1aac..fdc502f01325 100644 --- a/tests/sqllogictests/suites/mode/standalone/explain/explain.test +++ b/tests/sqllogictests/suites/mode/standalone/explain/explain.test @@ -33,7 +33,7 @@ explain select * from t1, t2 where (t1.a = t2.a and t1.a > 3) or (t1.a = t2.a an ---- Filter ├── output columns: [t2.a (#2), t2.b (#3), t1.b (#1), t1.a (#0)] -├── filters: [t1.a (#0) > 3 OR t2.a (#2) > 5 AND t1.a (#0) > 1] +├── filters: [(t1.a (#0) > 3 OR (t2.a (#2) > 5 AND t1.a (#0) > 1))] ├── estimated rows: 0.00 └── HashJoin ├── output columns: [t2.a (#2), t2.b (#3), t1.b (#1), t1.a (#0)] @@ -44,7 +44,7 @@ Filter ├── estimated rows: 0.00 ├── Filter(Build) │ ├── output columns: [t1.a (#0), t1.b (#1)] - │ ├── filters: [t1.a (#0) > 3 OR t1.a (#0) > 1] + │ ├── filters: [(t1.a (#0) > 3 OR t1.a (#0) > 1)] │ ├── estimated rows: 0.00 │ └── TableScan │ ├── table: default.default.t1 @@ -54,11 +54,11 @@ Filter │ ├── partitions total: 1 │ ├── partitions scanned: 0 │ ├── pruning stats: [segments: ] - │ ├── push downs: [filters: [t1.a (#0) > 3 OR t1.a (#0) > 1], limit: NONE] + │ ├── push downs: [filters: [(t1.a (#0) > 3 OR t1.a (#0) > 1)], limit: NONE] │ └── estimated rows: 1.00 └── Filter(Probe) ├── output columns: [t2.a (#2), t2.b (#3)] - ├── filters: [t2.a (#2) > 3 OR t2.a (#2) > 1] + ├── filters: [(t2.a (#2) > 3 OR t2.a (#2) > 1)] ├── estimated rows: 3.40 └── TableScan ├── table: default.default.t2 @@ -68,7 +68,7 @@ Filter ├── partitions total: 1 ├── partitions scanned: 1 ├── pruning stats: [segments: , blocks: ] - ├── push downs: [filters: [t2.a (#2) > 3 OR t2.a (#2) > 1], limit: NONE] + ├── push downs: [filters: [(t2.a (#2) > 3 OR t2.a (#2) > 1)], limit: NONE] └── estimated rows: 5.00 query T @@ -491,7 +491,7 @@ explain select * from t1,t2 where (t1.a > 1 and t2.a > 2) or (t1.b < 3 and t2.b ---- Filter ├── output columns: [t2.a (#2), t2.b (#3), t1.a (#0), t1.b (#1)] -├── filters: [t1.a (#0) > 1 AND t2.a (#2) > 2 OR t1.b (#1) < 3 AND t2.b (#3) < 4] +├── filters: [((t1.a (#0) > 1 AND t2.a (#2) > 2) OR (t1.b (#1) < 3 AND t2.b (#3) < 4))] ├── estimated rows: 3.52 └── HashJoin ├── output columns: [t2.a (#2), t2.b (#3), t1.a (#0), t1.b (#1)] @@ -502,7 +502,7 @@ Filter ├── estimated rows: 4.40 ├── Filter(Build) │ ├── output columns: [t1.a (#0), t1.b (#1)] - │ ├── filters: [t1.a (#0) > 1 OR t1.b (#1) < 3] + │ ├── filters: [(t1.a (#0) > 1 OR t1.b (#1) < 3)] │ ├── estimated rows: 1.00 │ └── TableScan │ ├── table: default.default.t1 @@ -512,11 +512,11 @@ Filter │ ├── partitions total: 1 │ ├── partitions scanned: 1 │ ├── pruning stats: [segments: , blocks: ] - │ ├── push downs: [filters: [t1.a (#0) > 1 OR t1.b (#1) < 3], limit: NONE] + │ ├── push downs: [filters: [(t1.a (#0) > 1 OR t1.b (#1) < 3)], limit: NONE] │ └── estimated rows: 1.00 └── Filter(Probe) ├── output columns: [t2.a (#2), t2.b (#3)] - ├── filters: [t2.a (#2) > 2 OR t2.b (#3) < 4] + ├── filters: [(t2.a (#2) > 2 OR t2.b (#3) < 4)] ├── estimated rows: 4.40 └── TableScan ├── table: default.default.t2 @@ -526,7 +526,7 @@ Filter ├── partitions total: 1 ├── partitions scanned: 1 ├── pruning stats: [segments: , blocks: ] - ├── push downs: [filters: [t2.a (#2) > 2 OR t2.b (#3) < 4], limit: NONE] + ├── push downs: [filters: [(t2.a (#2) > 2 OR t2.b (#3) < 4)], limit: NONE] └── estimated rows: 5.00 query T @@ -534,7 +534,7 @@ explain select * from t1,t2 where (t1.a > 1 and t2.a > 2) or (t1.b < 3 and t2.b ---- Filter ├── output columns: [t2.a (#2), t2.b (#3), t1.a (#0), t1.b (#1)] -├── filters: [t1.a (#0) > 1 AND t2.a (#2) > 2 OR t1.b (#1) < 3 AND t2.b (#3) < 4 OR t1.a (#0) = 2] +├── filters: [(((t1.a (#0) > 1 AND t2.a (#2) > 2) OR (t1.b (#1) < 3 AND t2.b (#3) < 4)) OR t1.a (#0) = 2)] ├── estimated rows: 4.00 └── HashJoin ├── output columns: [t2.a (#2), t2.b (#3), t1.a (#0), t1.b (#1)] @@ -545,7 +545,7 @@ Filter ├── estimated rows: 5.00 ├── Filter(Build) │ ├── output columns: [t1.a (#0), t1.b (#1)] - │ ├── filters: [t1.a (#0) > 1 OR t1.b (#1) < 3 OR t1.a (#0) = 2] + │ ├── filters: [((t1.a (#0) > 1 OR t1.b (#1) < 3) OR t1.a (#0) = 2)] │ ├── estimated rows: 1.00 │ └── TableScan │ ├── table: default.default.t1 @@ -555,7 +555,7 @@ Filter │ ├── partitions total: 1 │ ├── partitions scanned: 1 │ ├── pruning stats: [segments: , blocks: ] - │ ├── push downs: [filters: [t1.a (#0) > 1 OR t1.b (#1) < 3 OR t1.a (#0) = 2], limit: NONE] + │ ├── push downs: [filters: [((t1.a (#0) > 1 OR t1.b (#1) < 3) OR t1.a (#0) = 2)], limit: NONE] │ └── estimated rows: 1.00 └── TableScan(Probe) ├── table: default.default.t2 @@ -582,7 +582,7 @@ HashJoin ├── join type: INNER ├── build keys: [] ├── probe keys: [] -├── filters: [t1.a (#0) > 1 AND t2.a (#2) > 2 OR t1.b (#1) < 3 AND t2.b (#3) < 4 OR t3.a (#4) = 2] +├── filters: [(((t1.a (#0) > 1 AND t2.a (#2) > 2) OR (t1.b (#1) < 3 AND t2.b (#3) < 4)) OR t3.a (#4) = 2)] ├── estimated rows: 50.00 ├── HashJoin(Build) │ ├── output columns: [t2.a (#2), t2.b (#3), t1.a (#0), t1.b (#1)] @@ -634,7 +634,7 @@ HashJoin ├── estimated rows: 28.16 ├── Filter(Build) │ ├── output columns: [t2.a (#2), t2.b (#3), t1.a (#0), t1.b (#1)] -│ ├── filters: [t1.a (#0) > 1 AND t2.a (#2) > 2 OR t1.b (#1) < 3 AND t2.b (#3) < 4] +│ ├── filters: [((t1.a (#0) > 1 AND t2.a (#2) > 2) OR (t1.b (#1) < 3 AND t2.b (#3) < 4))] │ ├── estimated rows: 3.52 │ └── HashJoin │ ├── output columns: [t2.a (#2), t2.b (#3), t1.a (#0), t1.b (#1)] @@ -645,7 +645,7 @@ HashJoin │ ├── estimated rows: 4.40 │ ├── Filter(Build) │ │ ├── output columns: [t1.a (#0), t1.b (#1)] -│ │ ├── filters: [t1.a (#0) > 1 OR t1.b (#1) < 3] +│ │ ├── filters: [(t1.a (#0) > 1 OR t1.b (#1) < 3)] │ │ ├── estimated rows: 1.00 │ │ └── TableScan │ │ ├── table: default.default.t1 @@ -655,11 +655,11 @@ HashJoin │ │ ├── partitions total: 1 │ │ ├── partitions scanned: 1 │ │ ├── pruning stats: [segments: , blocks: ] -│ │ ├── push downs: [filters: [t1.a (#0) > 1 OR t1.b (#1) < 3], limit: NONE] +│ │ ├── push downs: [filters: [(t1.a (#0) > 1 OR t1.b (#1) < 3)], limit: NONE] │ │ └── estimated rows: 1.00 │ └── Filter(Probe) │ ├── output columns: [t2.a (#2), t2.b (#3)] -│ ├── filters: [t2.a (#2) > 2 OR t2.b (#3) < 4] +│ ├── filters: [(t2.a (#2) > 2 OR t2.b (#3) < 4)] │ ├── estimated rows: 4.40 │ └── TableScan │ ├── table: default.default.t2 @@ -669,7 +669,7 @@ HashJoin │ ├── partitions total: 1 │ ├── partitions scanned: 1 │ ├── pruning stats: [segments: , blocks: ] -│ ├── push downs: [filters: [t2.a (#2) > 2 OR t2.b (#3) < 4], limit: NONE] +│ ├── push downs: [filters: [(t2.a (#2) > 2 OR t2.b (#3) < 4)], limit: NONE] │ └── estimated rows: 5.00 └── Filter(Probe) ├── output columns: [t3.a (#4), t3.b (#5)] @@ -700,7 +700,7 @@ Limit ├── estimated rows: 3.87 └── Filter ├── output columns: [t2.a (#2), t2.b (#3), t1.a (#0), t1.b (#1)] - ├── filters: [(t1.a (#0) > 1 OR t1.b (#1) < 2) AND t2.a (#2) > 2 OR t1.b (#1) < 3 AND t2.b (#3) < 4] + ├── filters: [(((t1.a (#0) > 1 OR t1.b (#1) < 2) AND t2.a (#2) > 2) OR (t1.b (#1) < 3 AND t2.b (#3) < 4))] ├── estimated rows: 3.87 └── HashJoin ├── output columns: [t2.a (#2), t2.b (#3), t1.a (#0), t1.b (#1)] @@ -711,7 +711,7 @@ Limit ├── estimated rows: 4.40 ├── Filter(Build) │ ├── output columns: [t1.a (#0), t1.b (#1)] - │ ├── filters: [t1.a (#0) > 1 OR t1.b (#1) < 2 OR t1.b (#1) < 3] + │ ├── filters: [((t1.a (#0) > 1 OR t1.b (#1) < 2) OR t1.b (#1) < 3)] │ ├── estimated rows: 1.00 │ └── TableScan │ ├── table: default.default.t1 @@ -721,11 +721,11 @@ Limit │ ├── partitions total: 1 │ ├── partitions scanned: 1 │ ├── pruning stats: [segments: , blocks: ] - │ ├── push downs: [filters: [t1.a (#0) > 1 OR t1.b (#1) < 2 OR t1.b (#1) < 3], limit: NONE] + │ ├── push downs: [filters: [((t1.a (#0) > 1 OR t1.b (#1) < 2) OR t1.b (#1) < 3)], limit: NONE] │ └── estimated rows: 1.00 └── Filter(Probe) ├── output columns: [t2.a (#2), t2.b (#3)] - ├── filters: [t2.a (#2) > 2 OR t2.b (#3) < 4] + ├── filters: [(t2.a (#2) > 2 OR t2.b (#3) < 4)] ├── estimated rows: 4.40 └── TableScan ├── table: default.default.t2 @@ -735,7 +735,7 @@ Limit ├── partitions total: 1 ├── partitions scanned: 1 ├── pruning stats: [segments: , blocks: ] - ├── push downs: [filters: [t2.a (#2) > 2 OR t2.b (#3) < 4], limit: NONE] + ├── push downs: [filters: [(t2.a (#2) > 2 OR t2.b (#3) < 4)], limit: NONE] └── estimated rows: 5.00 query @@ -750,7 +750,7 @@ HashJoin ├── estimated rows: 5.00 ├── Filter(Build) │ ├── output columns: [t1.a (#0), t1.b (#1)] -│ ├── filters: [t1.a (#0) > 1 OR t1.b (#1) < 2] +│ ├── filters: [(t1.a (#0) > 1 OR t1.b (#1) < 2)] │ ├── estimated rows: 1.00 │ └── TableScan │ ├── table: default.default.t1 @@ -760,7 +760,7 @@ HashJoin │ ├── partitions total: 1 │ ├── partitions scanned: 1 │ ├── pruning stats: [segments: , blocks: ] -│ ├── push downs: [filters: [t1.a (#0) > 1 OR t1.b (#1) < 2], limit: NONE] +│ ├── push downs: [filters: [(t1.a (#0) > 1 OR t1.b (#1) < 2)], limit: NONE] │ └── estimated rows: 1.00 └── TableScan(Probe) ├── table: default.default.t2 diff --git a/tests/sqllogictests/suites/mode/standalone/explain/filter.test b/tests/sqllogictests/suites/mode/standalone/explain/filter.test index 1d4ed82be84b..ea9d12d2d1f7 100644 --- a/tests/sqllogictests/suites/mode/standalone/explain/filter.test +++ b/tests/sqllogictests/suites/mode/standalone/explain/filter.test @@ -20,7 +20,7 @@ explain select * from t1 where (a = 1 and b > 2) or (a = 1 and b < 100) or (a = ---- Filter ├── output columns: [t1.a (#0), t1.b (#1)] -├── filters: [is_true(t1.a (#0) = 1), is_true(t1.b (#1) > 2 OR t1.b (#1) < 100)] +├── filters: [is_true(t1.a (#0) = 1), is_true((t1.b (#1) > 2 OR t1.b (#1) < 100))] ├── estimated rows: 0.00 └── TableScan ├── table: default.default.t1 @@ -29,7 +29,7 @@ Filter ├── read size: 0 ├── partitions total: 0 ├── partitions scanned: 0 - ├── push downs: [filters: [and_filters(t1.a (#0) = 1, t1.b (#1) > 2 OR t1.b (#1) < 100)], limit: NONE] + ├── push downs: [filters: [and_filters(t1.a (#0) = 1, (t1.b (#1) > 2 OR t1.b (#1) < 100))], limit: NONE] └── estimated rows: 0.00 query T @@ -37,7 +37,7 @@ explain select * from t1 where b > 2 or b > 2 or b < 100; ---- Filter ├── output columns: [t1.a (#0), t1.b (#1)] -├── filters: [is_true(t1.b (#1) > 2 OR t1.b (#1) < 100)] +├── filters: [is_true((t1.b (#1) > 2 OR t1.b (#1) < 100))] ├── estimated rows: 0.00 └── TableScan ├── table: default.default.t1 @@ -46,5 +46,5 @@ Filter ├── read size: 0 ├── partitions total: 0 ├── partitions scanned: 0 - ├── push downs: [filters: [is_true(t1.b (#1) > 2 OR t1.b (#1) < 100)], limit: NONE] + ├── push downs: [filters: [is_true((t1.b (#1) > 2 OR t1.b (#1) < 100))], limit: NONE] └── estimated rows: 0.00 diff --git a/tests/sqllogictests/suites/mode/standalone/explain/join.test b/tests/sqllogictests/suites/mode/standalone/explain/join.test index 24a5682560a2..6899fc5ce748 100644 --- a/tests/sqllogictests/suites/mode/standalone/explain/join.test +++ b/tests/sqllogictests/suites/mode/standalone/explain/join.test @@ -280,7 +280,7 @@ HashJoin ├── estimated rows: 1.17 ├── Filter(Build) │ ├── output columns: [a.x (#0)] -│ ├── filters: [is_true(a.x (#0) > 44 OR a.x (#0) < 43)] +│ ├── filters: [is_true((a.x (#0) > 44 OR a.x (#0) < 43))] │ ├── estimated rows: 1.33 │ └── TableScan │ ├── table: default.default.onecolumn @@ -290,11 +290,11 @@ HashJoin │ ├── partitions total: 1 │ ├── partitions scanned: 1 │ ├── pruning stats: [segments: , blocks: ] -│ ├── push downs: [filters: [is_true(onecolumn.x (#0) > 44 OR onecolumn.x (#0) < 43)], limit: NONE] +│ ├── push downs: [filters: [is_true((onecolumn.x (#0) > 44 OR onecolumn.x (#0) < 43))], limit: NONE] │ └── estimated rows: 4.00 └── Filter(Probe) ├── output columns: [b.x (#1), b.y (#2)] - ├── filters: [is_true(b.x (#1) > 44 OR b.x (#1) < 43)] + ├── filters: [is_true((b.x (#1) > 44 OR b.x (#1) < 43))] ├── estimated rows: 1.75 └── TableScan ├── table: default.default.twocolumn @@ -304,7 +304,7 @@ HashJoin ├── partitions total: 1 ├── partitions scanned: 1 ├── pruning stats: [segments: , blocks: ] - ├── push downs: [filters: [is_true(twocolumn.x (#1) > 44 OR twocolumn.x (#1) < 43)], limit: NONE] + ├── push downs: [filters: [is_true((twocolumn.x (#1) > 44 OR twocolumn.x (#1) < 43))], limit: NONE] └── estimated rows: 4.00 query T @@ -353,7 +353,7 @@ explain select * from onecolumn as a left join twocolumn as b on a.x = b.x where ---- Filter ├── output columns: [a.x (#0), b.x (#1), b.y (#2)] -├── filters: [is_true(b.x (#1) > 44 OR a.x (#0) < 43)] +├── filters: [is_true((b.x (#1) > 44 OR a.x (#0) < 43))] ├── estimated rows: 1.33 └── HashJoin ├── output columns: [a.x (#0), b.x (#1), b.y (#2)] diff --git a/tests/sqllogictests/suites/mode/standalone/explain/multi_table_insert.sql b/tests/sqllogictests/suites/mode/standalone/explain/multi_table_insert.sql index 9cbd372dc5ad..1b0d34c62948 100644 --- a/tests/sqllogictests/suites/mode/standalone/explain/multi_table_insert.sql +++ b/tests/sqllogictests/suites/mode/standalone/explain/multi_table_insert.sql @@ -15,7 +15,7 @@ VALUES (101, 1, 250.00, '2023-01-01'), query T EXPLAIN INSERT FIRST WHEN order_amount > 1000 THEN INTO processing_updates VALUES (order_id, 'PriorityHandling') -WHEN order_amount > 500 THEN INTO processing_updates VALUES (order_id, 'ExpressHandling') +WHEN order_amount > 500 THEN INTO processing_updates VALUES (order_id, 'ExpressHandling') WHEN order_amount > 100 THEN INTO processing_updates VALUES (order_id, 'StandardHandling') ELSE INTO processing_updates VALUES (order_id, 'ReviewNeeded') SELECT order_id, @@ -31,9 +31,9 @@ Commit ├── branch 3: orders_placed.order_id (#0), 'ReviewNeeded' └── Filter ├── branch 0: is_true(orders_placed.order_amount (#2) > CAST(1000 AS Float32 NULL)) - ├── branch 1: is_true(NOT orders_placed.order_amount (#2) > CAST(1000 AS Float32 NULL) AND orders_placed.order_amount (#2) > CAST(500 AS Float32 NULL)) - ├── branch 2: is_true(NOT orders_placed.order_amount (#2) > CAST(1000 AS Float32 NULL) AND NOT orders_placed.order_amount (#2) > CAST(500 AS Float32 NULL) AND orders_placed.order_amount (#2) > CAST(100 AS Float32 NULL)) - ├── branch 3: is_true(NOT orders_placed.order_amount (#2) > CAST(1000 AS Float32 NULL) AND NOT orders_placed.order_amount (#2) > CAST(500 AS Float32 NULL) AND NOT orders_placed.order_amount (#2) > CAST(100 AS Float32 NULL)) + ├── branch 1: is_true((NOT orders_placed.order_amount (#2) > CAST(1000 AS Float32 NULL) AND orders_placed.order_amount (#2) > CAST(500 AS Float32 NULL))) + ├── branch 2: is_true(((NOT orders_placed.order_amount (#2) > CAST(1000 AS Float32 NULL) AND NOT orders_placed.order_amount (#2) > CAST(500 AS Float32 NULL)) AND orders_placed.order_amount (#2) > CAST(100 AS Float32 NULL))) + ├── branch 3: is_true(((NOT orders_placed.order_amount (#2) > CAST(1000 AS Float32 NULL) AND NOT orders_placed.order_amount (#2) > CAST(500 AS Float32 NULL)) AND NOT orders_placed.order_amount (#2) > CAST(100 AS Float32 NULL))) └── Duplicate ├── Duplicate data to 4 branch └── TableScan diff --git a/tests/sqllogictests/suites/mode/standalone/explain/prewhere_optimization.test b/tests/sqllogictests/suites/mode/standalone/explain/prewhere_optimization.test index aee7491c90c5..619814786a02 100644 --- a/tests/sqllogictests/suites/mode/standalone/explain/prewhere_optimization.test +++ b/tests/sqllogictests/suites/mode/standalone/explain/prewhere_optimization.test @@ -43,7 +43,7 @@ explain select * from t_where_optimizer where a = 1 or b > 2 ---- Filter ├── output columns: [t_where_optimizer.a (#0), t_where_optimizer.b (#1)] -├── filters: [is_true(t_where_optimizer.a (#0) = 1 OR t_where_optimizer.b (#1) > 2)] +├── filters: [is_true((t_where_optimizer.a (#0) = 1 OR t_where_optimizer.b (#1) > 2))] ├── estimated rows: 0.00 └── TableScan ├── table: default.default.t_where_optimizer @@ -52,7 +52,7 @@ Filter ├── read size: 0 ├── partitions total: 0 ├── partitions scanned: 0 - ├── push downs: [filters: [is_true(t_where_optimizer.a (#0) = 1 OR t_where_optimizer.b (#1) > 2)], limit: NONE] + ├── push downs: [filters: [is_true((t_where_optimizer.a (#0) = 1 OR t_where_optimizer.b (#1) > 2))], limit: NONE] └── estimated rows: 0.00 query T diff --git a/tests/sqllogictests/suites/mode/standalone/explain/push_down_filter/push_down_filter_join/push_down_filter_join_inner.test b/tests/sqllogictests/suites/mode/standalone/explain/push_down_filter/push_down_filter_join/push_down_filter_join_inner.test index cd9d46a77e7d..24631526617b 100644 --- a/tests/sqllogictests/suites/mode/standalone/explain/push_down_filter/push_down_filter_join/push_down_filter_join_inner.test +++ b/tests/sqllogictests/suites/mode/standalone/explain/push_down_filter/push_down_filter_join/push_down_filter_join_inner.test @@ -63,7 +63,7 @@ explain select * from t1 inner join t2 on t1.a = t2.a where t2.a <= 2 or (t1.a > ---- Filter ├── output columns: [t1.a (#0), t1.b (#1), t2.b (#3), t2.a (#2)] -├── filters: [is_true(t2.a (#2) <= 2 OR t1.a (#0) > 1 AND t2.a (#2) > 1)] +├── filters: [is_true((t2.a (#2) <= 2 OR (t1.a (#0) > 1 AND t2.a (#2) > 1)))] ├── estimated rows: 3.11 └── HashJoin ├── output columns: [t1.a (#0), t1.b (#1), t2.b (#3), t2.a (#2)] @@ -74,7 +74,7 @@ Filter ├── estimated rows: 3.11 ├── Filter(Build) │ ├── output columns: [t2.a (#2), t2.b (#3)] - │ ├── filters: [is_true(t2.a (#2) <= 2 OR t2.a (#2) > 1)] + │ ├── filters: [is_true((t2.a (#2) <= 2 OR t2.a (#2) > 1))] │ ├── estimated rows: 3.00 │ └── TableScan │ ├── table: default.default.t2 @@ -84,11 +84,11 @@ Filter │ ├── partitions total: 1 │ ├── partitions scanned: 1 │ ├── pruning stats: [segments: , blocks: ] - │ ├── push downs: [filters: [is_true(t2.a (#2) <= 2 OR t2.a (#2) > 1)], limit: NONE] + │ ├── push downs: [filters: [is_true((t2.a (#2) <= 2 OR t2.a (#2) > 1))], limit: NONE] │ └── estimated rows: 3.00 └── Filter(Probe) ├── output columns: [t1.a (#0), t1.b (#1)] - ├── filters: [is_true(t1.a (#0) <= 2 OR t1.a (#0) > 1)] + ├── filters: [is_true((t1.a (#0) <= 2 OR t1.a (#0) > 1))] ├── estimated rows: 3.11 └── TableScan ├── table: default.default.t1 @@ -98,7 +98,7 @@ Filter ├── partitions total: 1 ├── partitions scanned: 1 ├── pruning stats: [segments: , blocks: ] - ├── push downs: [filters: [is_true(t1.a (#0) <= 2 OR t1.a (#0) > 1)], limit: NONE] + ├── push downs: [filters: [is_true((t1.a (#0) <= 2 OR t1.a (#0) > 1))], limit: NONE] └── estimated rows: 4.00 statement ok diff --git a/tests/sqllogictests/suites/mode/standalone/explain/selectivity/pr_16069.test b/tests/sqllogictests/suites/mode/standalone/explain/selectivity/pr_16069.test index 4b7991a63413..fe5f103a4a97 100644 --- a/tests/sqllogictests/suites/mode/standalone/explain/selectivity/pr_16069.test +++ b/tests/sqllogictests/suites/mode/standalone/explain/selectivity/pr_16069.test @@ -9,7 +9,7 @@ explain select * from t where 10 < number or 20 < number; ---- Filter ├── output columns: [t.number (#0)] -├── filters: [10 < t.number (#0) OR 20 < t.number (#0)] +├── filters: [(10 < t.number (#0) OR 20 < t.number (#0))] ├── estimated rows: 97.69 └── TableScan ├── table: default.default.t @@ -19,7 +19,7 @@ Filter ├── partitions total: 1 ├── partitions scanned: 1 ├── pruning stats: [segments: , blocks: ] - ├── push downs: [filters: [10 < t.number (#0) OR 20 < t.number (#0)], limit: NONE] + ├── push downs: [filters: [(10 < t.number (#0) OR 20 < t.number (#0))], limit: NONE] └── estimated rows: 100.00 statement ok diff --git a/tests/sqllogictests/suites/mode/standalone/explain/subquery.test b/tests/sqllogictests/suites/mode/standalone/explain/subquery.test index d2d102470f9f..91d05787655f 100644 --- a/tests/sqllogictests/suites/mode/standalone/explain/subquery.test +++ b/tests/sqllogictests/suites/mode/standalone/explain/subquery.test @@ -77,7 +77,7 @@ explain select t.number from numbers(1) as t where exists (select t1.number from ---- Filter ├── output columns: [t.number (#0)] -├── filters: [is_true(2 (#2) OR CAST(t.number (#0) > 1 AS Boolean NULL))] +├── filters: [is_true((2 (#2) OR CAST(t.number (#0) > 1 AS Boolean NULL)))] ├── estimated rows: 1.00 └── HashJoin ├── output columns: [t.number (#0), marker (#2)] diff --git a/tests/sqllogictests/suites/mode/standalone/explain_native/explain.test b/tests/sqllogictests/suites/mode/standalone/explain_native/explain.test index 898969bf34f9..e2cbebda7b86 100644 --- a/tests/sqllogictests/suites/mode/standalone/explain_native/explain.test +++ b/tests/sqllogictests/suites/mode/standalone/explain_native/explain.test @@ -29,7 +29,7 @@ explain select * from t1, t2 where (t1.a = t2.a and t1.a > 3) or (t1.a = t2.a an ---- Filter ├── output columns: [t2.a (#2), t2.b (#3), t1.b (#1), t1.a (#0)] -├── filters: [t1.a (#0) > 3 OR t2.a (#2) > 5 AND t1.a (#0) > 1] +├── filters: [(t1.a (#0) > 3 OR (t2.a (#2) > 5 AND t1.a (#0) > 1))] ├── estimated rows: 0.00 └── HashJoin ├── output columns: [t2.a (#2), t2.b (#3), t1.b (#1), t1.a (#0)] @@ -46,7 +46,7 @@ Filter │ ├── partitions total: 1 │ ├── partitions scanned: 0 │ ├── pruning stats: [segments: ] - │ ├── push downs: [filters: [t1.a (#0) > 3 OR t1.a (#0) > 1], limit: NONE] + │ ├── push downs: [filters: [(t1.a (#0) > 3 OR t1.a (#0) > 1)], limit: NONE] │ └── estimated rows: 0.00 └── TableScan(Probe) ├── table: default.default.t2 @@ -56,7 +56,7 @@ Filter ├── partitions total: 1 ├── partitions scanned: 1 ├── pruning stats: [segments: , blocks: ] - ├── push downs: [filters: [t2.a (#2) > 3 OR t2.a (#2) > 1], limit: NONE] + ├── push downs: [filters: [(t2.a (#2) > 3 OR t2.a (#2) > 1)], limit: NONE] └── estimated rows: 3.40 query T @@ -479,7 +479,7 @@ explain select * from t1,t2 where (t1.a > 1 and t2.a > 2) or (t1.b < 3 and t2.b ---- Filter ├── output columns: [t2.a (#2), t2.b (#3), t1.a (#0), t1.b (#1)] -├── filters: [t1.a (#0) > 1 AND t2.a (#2) > 2 OR t1.b (#1) < 3 AND t2.b (#3) < 4] +├── filters: [((t1.a (#0) > 1 AND t2.a (#2) > 2) OR (t1.b (#1) < 3 AND t2.b (#3) < 4))] ├── estimated rows: 3.52 └── HashJoin ├── output columns: [t2.a (#2), t2.b (#3), t1.a (#0), t1.b (#1)] @@ -496,7 +496,7 @@ Filter │ ├── partitions total: 1 │ ├── partitions scanned: 1 │ ├── pruning stats: [segments: , blocks: ] - │ ├── push downs: [filters: [t1.a (#0) > 1 OR t1.b (#1) < 3], limit: NONE] + │ ├── push downs: [filters: [(t1.a (#0) > 1 OR t1.b (#1) < 3)], limit: NONE] │ └── estimated rows: 1.00 └── TableScan(Probe) ├── table: default.default.t2 @@ -506,7 +506,7 @@ Filter ├── partitions total: 1 ├── partitions scanned: 1 ├── pruning stats: [segments: , blocks: ] - ├── push downs: [filters: [t2.a (#2) > 2 OR t2.b (#3) < 4], limit: NONE] + ├── push downs: [filters: [(t2.a (#2) > 2 OR t2.b (#3) < 4)], limit: NONE] └── estimated rows: 4.40 query T @@ -514,7 +514,7 @@ explain select * from t1,t2 where (t1.a > 1 and t2.a > 2) or (t1.b < 3 and t2.b ---- Filter ├── output columns: [t2.a (#2), t2.b (#3), t1.a (#0), t1.b (#1)] -├── filters: [t1.a (#0) > 1 AND t2.a (#2) > 2 OR t1.b (#1) < 3 AND t2.b (#3) < 4 OR t1.a (#0) = 2] +├── filters: [(((t1.a (#0) > 1 AND t2.a (#2) > 2) OR (t1.b (#1) < 3 AND t2.b (#3) < 4)) OR t1.a (#0) = 2)] ├── estimated rows: 4.00 └── HashJoin ├── output columns: [t2.a (#2), t2.b (#3), t1.a (#0), t1.b (#1)] @@ -531,7 +531,7 @@ Filter │ ├── partitions total: 1 │ ├── partitions scanned: 1 │ ├── pruning stats: [segments: , blocks: ] - │ ├── push downs: [filters: [t1.a (#0) > 1 OR t1.b (#1) < 3 OR t1.a (#0) = 2], limit: NONE] + │ ├── push downs: [filters: [((t1.a (#0) > 1 OR t1.b (#1) < 3) OR t1.a (#0) = 2)], limit: NONE] │ └── estimated rows: 1.00 └── TableScan(Probe) ├── table: default.default.t2 @@ -558,7 +558,7 @@ HashJoin ├── join type: INNER ├── build keys: [] ├── probe keys: [] -├── filters: [t1.a (#0) > 1 AND t2.a (#2) > 2 OR t1.b (#1) < 3 AND t2.b (#3) < 4 OR t3.a (#4) = 2] +├── filters: [(((t1.a (#0) > 1 AND t2.a (#2) > 2) OR (t1.b (#1) < 3 AND t2.b (#3) < 4)) OR t3.a (#4) = 2)] ├── estimated rows: 50.00 ├── HashJoin(Build) │ ├── output columns: [t2.a (#2), t2.b (#3), t1.a (#0), t1.b (#1)] @@ -610,7 +610,7 @@ HashJoin ├── estimated rows: 28.16 ├── Filter(Build) │ ├── output columns: [t2.a (#2), t2.b (#3), t1.a (#0), t1.b (#1)] -│ ├── filters: [t1.a (#0) > 1 AND t2.a (#2) > 2 OR t1.b (#1) < 3 AND t2.b (#3) < 4] +│ ├── filters: [((t1.a (#0) > 1 AND t2.a (#2) > 2) OR (t1.b (#1) < 3 AND t2.b (#3) < 4))] │ ├── estimated rows: 3.52 │ └── HashJoin │ ├── output columns: [t2.a (#2), t2.b (#3), t1.a (#0), t1.b (#1)] @@ -627,7 +627,7 @@ HashJoin │ │ ├── partitions total: 1 │ │ ├── partitions scanned: 1 │ │ ├── pruning stats: [segments: , blocks: ] -│ │ ├── push downs: [filters: [t1.a (#0) > 1 OR t1.b (#1) < 3], limit: NONE] +│ │ ├── push downs: [filters: [(t1.a (#0) > 1 OR t1.b (#1) < 3)], limit: NONE] │ │ └── estimated rows: 1.00 │ └── TableScan(Probe) │ ├── table: default.default.t2 @@ -637,7 +637,7 @@ HashJoin │ ├── partitions total: 1 │ ├── partitions scanned: 1 │ ├── pruning stats: [segments: , blocks: ] -│ ├── push downs: [filters: [t2.a (#2) > 2 OR t2.b (#3) < 4], limit: NONE] +│ ├── push downs: [filters: [(t2.a (#2) > 2 OR t2.b (#3) < 4)], limit: NONE] │ └── estimated rows: 4.40 └── TableScan(Probe) ├── table: default.default.t3 @@ -664,7 +664,7 @@ Limit ├── estimated rows: 3.87 └── Filter ├── output columns: [t2.a (#2), t2.b (#3), t1.a (#0), t1.b (#1)] - ├── filters: [(t1.a (#0) > 1 OR t1.b (#1) < 2) AND t2.a (#2) > 2 OR t1.b (#1) < 3 AND t2.b (#3) < 4] + ├── filters: [(((t1.a (#0) > 1 OR t1.b (#1) < 2) AND t2.a (#2) > 2) OR (t1.b (#1) < 3 AND t2.b (#3) < 4))] ├── estimated rows: 3.87 └── HashJoin ├── output columns: [t2.a (#2), t2.b (#3), t1.a (#0), t1.b (#1)] @@ -681,7 +681,7 @@ Limit │ ├── partitions total: 1 │ ├── partitions scanned: 1 │ ├── pruning stats: [segments: , blocks: ] - │ ├── push downs: [filters: [t1.a (#0) > 1 OR t1.b (#1) < 2 OR t1.b (#1) < 3], limit: NONE] + │ ├── push downs: [filters: [((t1.a (#0) > 1 OR t1.b (#1) < 2) OR t1.b (#1) < 3)], limit: NONE] │ └── estimated rows: 1.00 └── TableScan(Probe) ├── table: default.default.t2 @@ -691,7 +691,7 @@ Limit ├── partitions total: 1 ├── partitions scanned: 1 ├── pruning stats: [segments: , blocks: ] - ├── push downs: [filters: [t2.a (#2) > 2 OR t2.b (#3) < 4], limit: NONE] + ├── push downs: [filters: [(t2.a (#2) > 2 OR t2.b (#3) < 4)], limit: NONE] └── estimated rows: 4.40 query T @@ -712,7 +712,7 @@ HashJoin │ ├── partitions total: 1 │ ├── partitions scanned: 1 │ ├── pruning stats: [segments: , blocks: ] -│ ├── push downs: [filters: [t1.a (#0) > 1 OR t1.b (#1) < 2], limit: NONE] +│ ├── push downs: [filters: [(t1.a (#0) > 1 OR t1.b (#1) < 2)], limit: NONE] │ └── estimated rows: 1.00 └── TableScan(Probe) ├── table: default.default.t2 diff --git a/tests/sqllogictests/suites/mode/standalone/explain_native/filter.test b/tests/sqllogictests/suites/mode/standalone/explain_native/filter.test index 285a1bcb09a4..446fe5a84da7 100644 --- a/tests/sqllogictests/suites/mode/standalone/explain_native/filter.test +++ b/tests/sqllogictests/suites/mode/standalone/explain_native/filter.test @@ -20,7 +20,7 @@ TableScan ├── read size: 0 ├── partitions total: 0 ├── partitions scanned: 0 -├── push downs: [filters: [and_filters(t1.a (#0) = 1, t1.b (#1) > 2 OR t1.b (#1) < 100)], limit: NONE] +├── push downs: [filters: [and_filters(t1.a (#0) = 1, (t1.b (#1) > 2 OR t1.b (#1) < 100))], limit: NONE] └── estimated rows: 0.00 query T @@ -33,5 +33,5 @@ TableScan ├── read size: 0 ├── partitions total: 0 ├── partitions scanned: 0 -├── push downs: [filters: [is_true(t1.b (#1) > 2 OR t1.b (#1) < 100)], limit: NONE] +├── push downs: [filters: [is_true((t1.b (#1) > 2 OR t1.b (#1) < 100))], limit: NONE] └── estimated rows: 0.00 diff --git a/tests/sqllogictests/suites/mode/standalone/explain_native/join.test b/tests/sqllogictests/suites/mode/standalone/explain_native/join.test index 0de7f5e9563e..2aef8da12dd3 100644 --- a/tests/sqllogictests/suites/mode/standalone/explain_native/join.test +++ b/tests/sqllogictests/suites/mode/standalone/explain_native/join.test @@ -262,7 +262,7 @@ HashJoin │ ├── partitions total: 1 │ ├── partitions scanned: 1 │ ├── pruning stats: [segments: , blocks: ] -│ ├── push downs: [filters: [is_true(onecolumn.x (#0) > 44 OR onecolumn.x (#0) < 43)], limit: NONE] +│ ├── push downs: [filters: [is_true((onecolumn.x (#0) > 44 OR onecolumn.x (#0) < 43))], limit: NONE] │ └── estimated rows: 1.33 └── TableScan(Probe) ├── table: default.default.twocolumn @@ -272,7 +272,7 @@ HashJoin ├── partitions total: 1 ├── partitions scanned: 1 ├── pruning stats: [segments: , blocks: ] - ├── push downs: [filters: [is_true(twocolumn.x (#1) > 44 OR twocolumn.x (#1) < 43)], limit: NONE] + ├── push downs: [filters: [is_true((twocolumn.x (#1) > 44 OR twocolumn.x (#1) < 43))], limit: NONE] └── estimated rows: 1.75 query T @@ -313,7 +313,7 @@ explain select * from onecolumn as a left join twocolumn as b on a.x = b.x where ---- Filter ├── output columns: [a.x (#0), b.x (#1), b.y (#2)] -├── filters: [is_true(b.x (#1) > 44 OR a.x (#0) < 43)] +├── filters: [is_true((b.x (#1) > 44 OR a.x (#0) < 43))] ├── estimated rows: 1.33 └── HashJoin ├── output columns: [a.x (#0), b.x (#1), b.y (#2)] diff --git a/tests/sqllogictests/suites/mode/standalone/explain_native/prewhere_optimization.test b/tests/sqllogictests/suites/mode/standalone/explain_native/prewhere_optimization.test index 6d725202e4c5..c4b626237f79 100644 --- a/tests/sqllogictests/suites/mode/standalone/explain_native/prewhere_optimization.test +++ b/tests/sqllogictests/suites/mode/standalone/explain_native/prewhere_optimization.test @@ -60,7 +60,7 @@ TableScan ├── read size: 0 ├── partitions total: 0 ├── partitions scanned: 0 -├── push downs: [filters: [is_true(t_where_optimizer.a (#0) = 1 OR t_where_optimizer.b (#1) > 2)], limit: NONE] +├── push downs: [filters: [is_true((t_where_optimizer.a (#0) = 1 OR t_where_optimizer.b (#1) > 2))], limit: NONE] └── estimated rows: 0.00 query T diff --git a/tests/sqllogictests/suites/mode/standalone/explain_native/push_down_filter/push_down_filter_join/push_down_filter_join_inner.test b/tests/sqllogictests/suites/mode/standalone/explain_native/push_down_filter/push_down_filter_join/push_down_filter_join_inner.test index d05a4f41e27d..aaa4b6e0df54 100644 --- a/tests/sqllogictests/suites/mode/standalone/explain_native/push_down_filter/push_down_filter_join/push_down_filter_join_inner.test +++ b/tests/sqllogictests/suites/mode/standalone/explain_native/push_down_filter/push_down_filter_join/push_down_filter_join_inner.test @@ -55,7 +55,7 @@ explain select * from t1 inner join t2 on t1.a = t2.a where t2.a <= 2 or (t1.a > ---- Filter ├── output columns: [t1.a (#0), t1.b (#1), t2.b (#3), t2.a (#2)] -├── filters: [is_true(t2.a (#2) <= 2 OR t1.a (#0) > 1 AND t2.a (#2) > 1)] +├── filters: [is_true((t2.a (#2) <= 2 OR (t1.a (#0) > 1 AND t2.a (#2) > 1)))] ├── estimated rows: 3.11 └── HashJoin ├── output columns: [t1.a (#0), t1.b (#1), t2.b (#3), t2.a (#2)] @@ -72,7 +72,7 @@ Filter │ ├── partitions total: 1 │ ├── partitions scanned: 1 │ ├── pruning stats: [segments: , blocks: ] - │ ├── push downs: [filters: [is_true(t2.a (#2) <= 2 OR t2.a (#2) > 1)], limit: NONE] + │ ├── push downs: [filters: [is_true((t2.a (#2) <= 2 OR t2.a (#2) > 1))], limit: NONE] │ └── estimated rows: 3.00 └── TableScan(Probe) ├── table: default.default.t1 @@ -82,7 +82,7 @@ Filter ├── partitions total: 1 ├── partitions scanned: 1 ├── pruning stats: [segments: , blocks: ] - ├── push downs: [filters: [is_true(t1.a (#0) <= 2 OR t1.a (#0) > 1)], limit: NONE] + ├── push downs: [filters: [is_true((t1.a (#0) <= 2 OR t1.a (#0) > 1))], limit: NONE] └── estimated rows: 3.11 statement ok diff --git a/tests/sqllogictests/suites/mode/standalone/explain_native/subquery.test b/tests/sqllogictests/suites/mode/standalone/explain_native/subquery.test index ae17ac46c8f6..eee114fd8135 100644 --- a/tests/sqllogictests/suites/mode/standalone/explain_native/subquery.test +++ b/tests/sqllogictests/suites/mode/standalone/explain_native/subquery.test @@ -77,7 +77,7 @@ explain select t.number from numbers(1) as t where exists (select t1.number from ---- Filter ├── output columns: [t.number (#0)] -├── filters: [is_true(2 (#2) OR CAST(t.number (#0) > 1 AS Boolean NULL))] +├── filters: [is_true((2 (#2) OR CAST(t.number (#0) > 1 AS Boolean NULL)))] ├── estimated rows: 1.00 └── HashJoin ├── output columns: [t.number (#0), marker (#2)] diff --git a/tests/sqllogictests/suites/task/task_dag_test.test b/tests/sqllogictests/suites/task/task_dag_test.test index 0629fdf965cf..6bd36c19c505 100644 --- a/tests/sqllogictests/suites/task/task_dag_test.test +++ b/tests/sqllogictests/suites/task/task_dag_test.test @@ -87,4 +87,3 @@ query SSSS select name, warehouse, schedule, definition from system.task_history where name = 'mytaskroot' ---- mytaskroot mywh CRON 0 0 0 1 1 ? 2100 SELECT 1 - diff --git a/tests/suites/0_stateless/20+_others/20_0018_stackoverflow.result b/tests/suites/0_stateless/20+_others/20_0018_stackoverflow.result index 742445fce793..9bee7bdf1e30 100644 --- a/tests/suites/0_stateless/20+_others/20_0018_stackoverflow.result +++ b/tests/suites/0_stateless/20+_others/20_0018_stackoverflow.result @@ -1 +1 @@ -Error: APIError: ResponseError with 1006: divided by zero while evaluating function `divide(0, 0)` in expr `t.a (#0) / 0`, during run expr: `t.a (#0) > 0 OR t.a (#0) > 1 OR t.a (#0) > 2 OR t.a (#0) > 3 OR t.a (#0) > 4 OR t.a (#0) > 5 OR t.a (#0) > 6 OR t.a (#0) > 7 OR t.a (#0) > 8 OR t.a (#0) > 9 OR t.a (#0) > 10 OR t.a (#0) > 11 OR t.a (#0) > 12 OR t.a (#0) > 13 OR t.a (#0) > 14 OR t.a (#0) > 15 OR t.a (#0) > 16 OR t.a (#0) > 17 OR t.a (#0) > 18 OR t.a (#0) > 19 OR t.a (#0) > 20 OR t.a (#0) > 21 OR t.a (#0) > 22 OR t.a (#0) > 23 OR t.a (#0) > 24 OR t.a (#0) > 25 OR t.a (#0) > 26 OR t.a (#0) > 27 OR t.a (#0) > 28 OR t.a (#0) > 29 OR t.a (#0) > 30 OR t.a (#0) > 31 OR t.a (#0) > 32 OR t.a (#0) > 33 OR t.a (#0) > 34 OR t.a (#0) > 35 OR t.a (#0) > 36 OR t.a (#0) > 37 OR t.a (#0) > 38 OR t.a (#0) > 39 OR t.a (#0) > 40 OR t.a (#0) > 41 OR t.a (#0) > 42 OR t.a (#0) > 43 OR t.a (#0) > 44 OR t.a (#0) > 45 OR t.a (#0) > 46 OR t.a (#0) > 47 OR t.a (#0) > 48 OR t.a (#0) > 49 OR t.a (#0) > 50 OR t.a (#0) > 51 OR t.a (#0) > 52 OR t.a (#0) > 53 OR t.a (#0) > 54 OR t.a (#0) > 55 OR t.a (#0) > 56 OR t.a (#0) > 57 OR t.a (#0) > 58 OR t.a (#0) > 59 OR t.a (#0) > 60 OR t.a (#0) > 61 OR t.a (#0) > 62 OR t.a (#0) > 63 OR t.a (#0) > 64 OR t.a (#0) > 65 OR t.a (#0) > 66 OR t.a (#0) > 67 OR t.a (#0) > 68 OR t.a (#0) > 69 OR t.a (#0) > 70 OR t.a (#0) > 71 OR t.a (#0) > 72 OR t.a (#0) > 73 OR t.a (#0) > 74 OR t.a (#0) > 75 OR t.a (#0) > 76 OR t.a (#0) > 77 OR t.a (#0) > 78 OR t.a (#0) > 79 OR t.a (#0) > 80 OR t.a (#0) > 81 OR t.a (#0) > 82 OR t.a (#0) > 83 OR t.a (#0) > 84 OR t.a (#0) > 85 OR t.a (#0) > 86 OR t.a (#0) > 87 OR t.a (#0) > 88 OR t.a (#0) > 89 OR t.a (#0) > 90 OR t.a (#0) > 91 OR t.a (#0) > 92 OR t.a (#0) > 93 OR t.a (#0) > 94 OR t.a (#0) > 95 OR t.a (#0) > 96 OR t.a (#0) > 97 OR t.a (#0) > 98 OR t.a (#0) > 99 OR t.a (#0) > 100 OR t.a (#0) / 0 > 0` +Error: APIError: ResponseError with 1006: divided by zero while evaluating function `divide(0, 0)` in expr `t.a (#0) / 0`, during run expr: `(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((t.a (#0) > 0 OR t.a (#0) > 1) OR t.a (#0) > 2) OR t.a (#0) > 3) OR t.a (#0) > 4) OR t.a (#0) > 5) OR t.a (#0) > 6) OR t.a (#0) > 7) OR t.a (#0) > 8) OR t.a (#0) > 9) OR t.a (#0) > 10) OR t.a (#0) > 11) OR t.a (#0) > 12) OR t.a (#0) > 13) OR t.a (#0) > 14) OR t.a (#0) > 15) OR t.a (#0) > 16) OR t.a (#0) > 17) OR t.a (#0) > 18) OR t.a (#0) > 19) OR t.a (#0) > 20) OR t.a (#0) > 21) OR t.a (#0) > 22) OR t.a (#0) > 23) OR t.a (#0) > 24) OR t.a (#0) > 25) OR t.a (#0) > 26) OR t.a (#0) > 27) OR t.a (#0) > 28) OR t.a (#0) > 29) OR t.a (#0) > 30) OR t.a (#0) > 31) OR t.a (#0) > 32) OR t.a (#0) > 33) OR t.a (#0) > 34) OR t.a (#0) > 35) OR t.a (#0) > 36) OR t.a (#0) > 37) OR t.a (#0) > 38) OR t.a (#0) > 39) OR t.a (#0) > 40) OR t.a (#0) > 41) OR t.a (#0) > 42) OR t.a (#0) > 43) OR t.a (#0) > 44) OR t.a (#0) > 45) OR t.a (#0) > 46) OR t.a (#0) > 47) OR t.a (#0) > 48) OR t.a (#0) > 49) OR t.a (#0) > 50) OR t.a (#0) > 51) OR t.a (#0) > 52) OR t.a (#0) > 53) OR t.a (#0) > 54) OR t.a (#0) > 55) OR t.a (#0) > 56) OR t.a (#0) > 57) OR t.a (#0) > 58) OR t.a (#0) > 59) OR t.a (#0) > 60) OR t.a (#0) > 61) OR t.a (#0) > 62) OR t.a (#0) > 63) OR t.a (#0) > 64) OR t.a (#0) > 65) OR t.a (#0) > 66) OR t.a (#0) > 67) OR t.a (#0) > 68) OR t.a (#0) > 69) OR t.a (#0) > 70) OR t.a (#0) > 71) OR t.a (#0) > 72) OR t.a (#0) > 73) OR t.a (#0) > 74) OR t.a (#0) > 75) OR t.a (#0) > 76) OR t.a (#0) > 77) OR t.a (#0) > 78) OR t.a (#0) > 79) OR t.a (#0) > 80) OR t.a (#0) > 81) OR t.a (#0) > 82) OR t.a (#0) > 83) OR t.a (#0) > 84) OR t.a (#0) > 85) OR t.a (#0) > 86) OR t.a (#0) > 87) OR t.a (#0) > 88) OR t.a (#0) > 89) OR t.a (#0) > 90) OR t.a (#0) > 91) OR t.a (#0) > 92) OR t.a (#0) > 93) OR t.a (#0) > 94) OR t.a (#0) > 95) OR t.a (#0) > 96) OR t.a (#0) > 97) OR t.a (#0) > 98) OR t.a (#0) > 99) OR t.a (#0) > 100) OR t.a (#0) / 0 > 0)`