From f2199feddd757512b5d06d5a443f66ca3cf7ae1c Mon Sep 17 00:00:00 2001 From: stonepage <40830455+st1page@users.noreply.github.com> Date: Thu, 23 Feb 2023 16:27:42 +0800 Subject: [PATCH] feat(explain): add conflict behavior in explain materialize operator (#8138) as title Approved-By: BugenZhao --- .../planner_test/tests/testdata/agg.yaml | 54 +++---- .../tests/testdata/append_only.yaml | 8 +- .../tests/testdata/basic_query.yaml | 14 +- .../tests/testdata/column_pruning.yaml | 2 +- .../testdata/common_table_expressions.yaml | 6 +- .../tests/testdata/delta_join.yaml | 6 +- .../tests/testdata/distribution_derive.yaml | 72 +++++----- .../tests/testdata/dynamic_filter.yaml | 12 +- .../planner_test/tests/testdata/explain.yaml | 4 +- .../planner_test/tests/testdata/expr.yaml | 18 +-- .../tests/testdata/index_selection.yaml | 2 +- .../planner_test/tests/testdata/join.yaml | 18 +-- .../tests/testdata/mv_column_name.yaml | 6 +- .../planner_test/tests/testdata/mv_on_mv.yaml | 2 +- .../planner_test/tests/testdata/nexmark.yaml | 88 ++++++------ .../tests/testdata/nexmark_source.yaml | 88 ++++++------ .../planner_test/tests/testdata/order_by.yaml | 10 +- .../tests/testdata/over_window_function.yaml | 10 +- .../tests/testdata/pk_derive.yaml | 8 +- .../tests/testdata/predicate_pushdown.yaml | 6 +- .../tests/testdata/project_set.yaml | 12 +- .../planner_test/tests/testdata/share.yaml | 10 +- .../tests/testdata/shared_views.yaml | 2 +- .../tests/testdata/stream_dist_agg.yaml | 136 +++++++++--------- .../tests/testdata/struct_query.yaml | 2 +- .../tests/testdata/temporal_filter.yaml | 8 +- .../tests/testdata/time_window.yaml | 16 +-- .../planner_test/tests/testdata/tpch.yaml | 86 +++++------ .../planner_test/tests/testdata/union.yaml | 12 +- .../tests/testdata/watermark.yaml | 2 +- .../optimizer/plan_node/stream_materialize.rs | 7 + 31 files changed, 367 insertions(+), 360 deletions(-) diff --git a/src/frontend/planner_test/tests/testdata/agg.yaml b/src/frontend/planner_test/tests/testdata/agg.yaml index 51fe6ac199532..8daf71b256f41 100644 --- a/src/frontend/planner_test/tests/testdata/agg.yaml +++ b/src/frontend/planner_test/tests/testdata/agg.yaml @@ -30,7 +30,7 @@ └─BatchExchange { order: [], dist: Single } └─BatchScan { table: t, columns: [t.v1, t.v2, t.v3], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [v1, agg], pk_columns: [v1] } + StreamMaterialize { columns: [v1, agg], pk_columns: [v1], pk_conflict: "no check" } └─StreamProject { exprs: [t.v1, (min(t.v2) + (max(t.v3) * count(t.v1))) as $expr1] } └─StreamHashAgg { group_key: [t.v1], aggs: [count, min(t.v2), max(t.v3), count(t.v1)] } └─StreamExchange { dist: HashShard(t.v1) } @@ -50,7 +50,7 @@ └─BatchExchange { order: [], dist: Single } └─BatchScan { table: t, columns: [t.v1, t.v2, t.v3], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [agg], pk_columns: [] } + StreamMaterialize { columns: [agg], pk_columns: [], pk_conflict: "no check" } └─StreamProject { exprs: [(min(min(t.v1)) + (max(max(t.v2)) * sum0(count(t.v3)))) as $expr2] } └─StreamGlobalSimpleAgg { aggs: [count, min(min(t.v1)), max(max(t.v2)), sum0(count(t.v3))] } └─StreamExchange { dist: Single } @@ -82,7 +82,7 @@ └─BatchProject { exprs: [t.v3, t.v1, (t.v1 + t.v2) as $expr1] } └─BatchScan { table: t, columns: [t.v1, t.v2, t.v3], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [v3, agg], pk_columns: [v3] } + StreamMaterialize { columns: [v3, agg], pk_columns: [v3], pk_conflict: "no check" } └─StreamProject { exprs: [t.v3, (min(t.v1) * (sum($expr1)::Decimal / count($expr1))) as $expr2] } └─StreamHashAgg { group_key: [t.v3], aggs: [count, min(t.v1), sum($expr1), count($expr1)] } └─StreamExchange { dist: HashShard(t.v3) } @@ -150,7 +150,7 @@ └─BatchProject { exprs: [(t.v1 + t.v2) as $expr1] } └─BatchScan { table: t, columns: [t.v1, t.v2], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [cnt, sum], pk_columns: [] } + StreamMaterialize { columns: [cnt, sum], pk_columns: [], pk_conflict: "no check" } └─StreamProject { exprs: [sum0(count($expr1)), sum(sum($expr1))] } └─StreamGlobalSimpleAgg { aggs: [count, sum0(count($expr1)), sum(sum($expr1))] } └─StreamExchange { dist: Single } @@ -168,7 +168,7 @@ └─BatchProject { exprs: [t.v1, (t.v2 + t.v3) as $expr1] } └─BatchScan { table: t, columns: [t.v1, t.v2, t.v3], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [v1, agg], pk_columns: [v1] } + StreamMaterialize { columns: [v1, agg], pk_columns: [v1], pk_conflict: "no check" } └─StreamProject { exprs: [t.v1, ((sum($expr1) / count($expr1)) + max(t.v1)) as $expr2] } └─StreamHashAgg { group_key: [t.v1], aggs: [count, sum($expr1), count($expr1), max(t.v1)] } └─StreamExchange { dist: HashShard(t.v1) } @@ -420,7 +420,7 @@ └─BatchSimpleAgg { aggs: [min(t.v1), max(t.v3), count(t.v2)] } └─BatchScan { table: t, columns: [t.v1, t.v2, t.v3], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [agg], pk_columns: [] } + StreamMaterialize { columns: [agg], pk_columns: [], pk_conflict: "no check" } └─StreamProject { exprs: [(min(min(t.v1)) + (max(max(t.v3)) * sum0(count(t.v2)))) as $expr2] } └─StreamGlobalSimpleAgg { aggs: [count, min(min(t.v1)), max(max(t.v3)), sum0(count(t.v2))] } └─StreamExchange { dist: Single } @@ -442,7 +442,7 @@ └─LogicalAgg { group_key: [t.v1], aggs: [] } └─LogicalScan { table: t, columns: [t.v1] } stream_plan: | - StreamMaterialize { columns: [v1, t.v1(hidden)], pk_columns: [t.v1] } + StreamMaterialize { columns: [v1, t.v1(hidden)], pk_columns: [t.v1], pk_conflict: "no check" } └─StreamProject { exprs: [t.v1, t.v1] } └─StreamHashAgg { group_key: [t.v1], aggs: [count] } └─StreamExchange { dist: HashShard(t.v1) } @@ -462,7 +462,7 @@ └─LogicalAgg { group_key: [t.v3, t.v2], aggs: [min(t.v1), max(t.v1)] } └─LogicalScan { table: t, columns: [t.v1, t.v2, t.v3] } stream_plan: | - StreamMaterialize { columns: [v2, min_v1, v3, max_v1, t.v2(hidden)], pk_columns: [v3, t.v2] } + StreamMaterialize { columns: [v2, min_v1, v3, max_v1, t.v2(hidden)], pk_columns: [v3, t.v2], pk_conflict: "no check" } └─StreamProject { exprs: [t.v2, min(t.v1), t.v3, max(t.v1), t.v2] } └─StreamHashAgg { group_key: [t.v3, t.v2], aggs: [count, min(t.v1), max(t.v1)] } └─StreamExchange { dist: HashShard(t.v2, t.v3) } @@ -480,7 +480,7 @@ LogicalAgg { aggs: [sum(t.v1)] } └─LogicalScan { table: t, columns: [t.v1] } stream_plan: | - StreamMaterialize { columns: [s1], pk_columns: [] } + StreamMaterialize { columns: [s1], pk_columns: [], pk_conflict: "no check" } └─StreamProject { exprs: [sum(sum(t.v1))] } └─StreamGlobalSimpleAgg { aggs: [count, sum(sum(t.v1))] } └─StreamExchange { dist: Single } @@ -499,7 +499,7 @@ LogicalAgg { aggs: [sum(t.v1)] } └─LogicalScan { table: t, columns: [t.v1] } stream_plan: | - StreamMaterialize { columns: [s1], pk_columns: [] } + StreamMaterialize { columns: [s1], pk_columns: [], pk_conflict: "no check" } └─StreamProject { exprs: [sum(sum(t.v1))] } └─StreamGlobalSimpleAgg { aggs: [count, sum(sum(t.v1))] } └─StreamExchange { dist: Single } @@ -518,7 +518,7 @@ LogicalAgg { aggs: [sum(t.v1)] } └─LogicalScan { table: t, columns: [t.v1] } stream_plan: | - StreamMaterialize { columns: [s1], pk_columns: [] } + StreamMaterialize { columns: [s1], pk_columns: [], pk_conflict: "no check" } └─StreamProject { exprs: [sum(sum(t.v1))] } └─StreamGlobalSimpleAgg { aggs: [count, sum(sum(t.v1))] } └─StreamExchange { dist: Single } @@ -537,7 +537,7 @@ LogicalAgg { aggs: [sum(t.v1)] } └─LogicalScan { table: t, columns: [t.v1] } stream_plan: | - StreamMaterialize { columns: [s1], pk_columns: [] } + StreamMaterialize { columns: [s1], pk_columns: [], pk_conflict: "no check" } └─StreamProject { exprs: [sum(sum(t.v1))] } └─StreamGlobalSimpleAgg { aggs: [count, sum(sum(t.v1))] } └─StreamExchange { dist: Single } @@ -556,7 +556,7 @@ LogicalAgg { aggs: [sum(t.v1)] } └─LogicalScan { table: t, columns: [t.v1] } stream_plan: | - StreamMaterialize { columns: [s1], pk_columns: [] } + StreamMaterialize { columns: [s1], pk_columns: [], pk_conflict: "no check" } └─StreamProject { exprs: [sum(sum(t.v1))] } └─StreamGlobalSimpleAgg { aggs: [count, sum(sum(t.v1))] } └─StreamExchange { dist: Single } @@ -575,7 +575,7 @@ LogicalAgg { aggs: [sum(t.v1) filter((t.v1 > 0:Int32))] } └─LogicalScan { table: t, columns: [t.v1] } stream_plan: | - StreamMaterialize { columns: [sa], pk_columns: [] } + StreamMaterialize { columns: [sa], pk_columns: [], pk_conflict: "no check" } └─StreamProject { exprs: [sum(sum(t.v1) filter((t.v1 > 0:Int32)))] } └─StreamGlobalSimpleAgg { aggs: [count, sum(sum(t.v1) filter((t.v1 > 0:Int32)))] } └─StreamExchange { dist: Single } @@ -610,7 +610,7 @@ └─LogicalProject { exprs: [t.a, t.b, (t.a * t.b) as $expr1] } └─LogicalScan { table: t, columns: [t.a, t.b] } stream_plan: | - StreamMaterialize { columns: [sab], pk_columns: [] } + StreamMaterialize { columns: [sab], pk_columns: [], pk_conflict: "no check" } └─StreamProject { exprs: [max(max($expr1) filter((t.a < t.b) AND ((t.a + t.b) < 100:Int32) AND ((t.a * t.b) <> ((t.a + t.b) - 1:Int32))))] } └─StreamGlobalSimpleAgg { aggs: [count, max(max($expr1) filter((t.a < t.b) AND ((t.a + t.b) < 100:Int32) AND ((t.a * t.b) <> ((t.a + t.b) - 1:Int32))))] } └─StreamExchange { dist: Single } @@ -632,7 +632,7 @@ └─LogicalAgg { group_key: [t.b], aggs: [sum(t.a) filter((t.a > t.b)), count(t.a) filter((t.a > t.b))] } └─LogicalScan { table: t, columns: [t.a, t.b] } stream_plan: | - StreamMaterialize { columns: [avga, t.b(hidden)], pk_columns: [t.b] } + StreamMaterialize { columns: [avga, t.b(hidden)], pk_columns: [t.b], pk_conflict: "no check" } └─StreamProject { exprs: [(sum(t.a) filter((t.a > t.b))::Decimal / count(t.a) filter((t.a > t.b))) as $expr1, t.b] } └─StreamHashAgg { group_key: [t.b], aggs: [count, sum(t.a) filter((t.a > t.b)), count(t.a) filter((t.a > t.b))] } └─StreamExchange { dist: HashShard(t.b) } @@ -650,7 +650,7 @@ LogicalAgg { aggs: [count filter((t.a > t.b))] } └─LogicalScan { table: t, columns: [t.a, t.b] } stream_plan: | - StreamMaterialize { columns: [cnt_agb], pk_columns: [] } + StreamMaterialize { columns: [cnt_agb], pk_columns: [], pk_conflict: "no check" } └─StreamProject { exprs: [sum0(count filter((t.a > t.b)))] } └─StreamGlobalSimpleAgg { aggs: [count, sum0(count filter((t.a > t.b)))] } └─StreamExchange { dist: Single } @@ -690,7 +690,7 @@ └─BatchSimpleAgg { aggs: [sum(t.v2) filter((t.v2 < 5:Int32))] } └─BatchScan { table: t, columns: [t.v2], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [b], pk_columns: [] } + StreamMaterialize { columns: [b], pk_columns: [], pk_conflict: "no check" } └─StreamProject { exprs: [sum(sum(t.v2) filter((t.v2 < 5:Int32)))] } └─StreamGlobalSimpleAgg { aggs: [count, sum(sum(t.v2) filter((t.v2 < 5:Int32)))] } └─StreamExchange { dist: Single } @@ -711,7 +711,7 @@ └─BatchExchange { order: [], dist: HashShard(t.v1, t.v2, t.v3) } └─BatchScan { table: t, columns: [t.v1, t.v2, t.v3], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [min, sum, t.v1(hidden), t.v3(hidden), t.v2(hidden)], pk_columns: [t.v1, t.v3, t.v2] } + StreamMaterialize { columns: [min, sum, t.v1(hidden), t.v3(hidden), t.v2(hidden)], pk_columns: [t.v1, t.v3, t.v2], pk_conflict: "no check" } └─StreamProject { exprs: [min(min(t.v3)), sum(sum(t.v1)), t.v1, t.v3, t.v2] } └─StreamHashAgg { group_key: [t.v1, t.v3, t.v2], aggs: [count, min(min(t.v3)), sum(sum(t.v1))] } └─StreamExchange { dist: HashShard(t.v1, t.v3, t.v2) } @@ -730,7 +730,7 @@ └─BatchSimpleAgg { aggs: [min(t.v1), sum(t.v2)] } └─BatchScan { table: t, columns: [t.v1, t.v2], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [min, sum], pk_columns: [] } + StreamMaterialize { columns: [min, sum], pk_columns: [], pk_conflict: "no check" } └─StreamProject { exprs: [min(min(t.v1)), sum(sum(t.v2))] } └─StreamGlobalSimpleAgg { aggs: [count, min(min(t.v1)), sum(sum(t.v2))] } └─StreamExchange { dist: Single } @@ -748,7 +748,7 @@ └─BatchExchange { order: [], dist: Single } └─BatchScan { table: t, columns: [t.v1, t.v2], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [min, sum], pk_columns: [] } + StreamMaterialize { columns: [min, sum], pk_columns: [], pk_conflict: "no check" } └─StreamProject { exprs: [min(t.v1), sum(t.v2)] } └─StreamGlobalSimpleAgg { aggs: [count, min(t.v1), sum(t.v2)] } └─StreamExchange { dist: Single } @@ -778,7 +778,7 @@ └─BatchExchange { order: [], dist: HashShard(t.a, t.b) } └─BatchScan { table: t, columns: [t.a, t.b, t.c], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [a, distinct_b_num, sum_c], pk_columns: [a] } + StreamMaterialize { columns: [a, distinct_b_num, sum_c], pk_columns: [a], pk_conflict: "no check" } └─StreamProject { exprs: [t.a, count(t.b), sum(sum(t.c))] } └─StreamHashAgg { group_key: [t.a], aggs: [count, count(t.b), sum(sum(t.c))] } └─StreamExchange { dist: HashShard(t.a) } @@ -804,7 +804,7 @@ └─BatchExpand { column_subsets: [[t.a, t.c], [t.a, t.b]] } └─BatchScan { table: t, columns: [t.a, t.b, t.c], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [a, distinct_b_num, distinct_c_sum, sum_c], pk_columns: [a] } + StreamMaterialize { columns: [a, distinct_b_num, distinct_c_sum, sum_c], pk_columns: [a], pk_conflict: "no check" } └─StreamProject { exprs: [t.a, count(t.b) filter((flag = 1:Int64)), count(t.c) filter((flag = 0:Int64)), sum(sum(t.c)) filter((flag = 0:Int64))] } └─StreamHashAgg { group_key: [t.a], aggs: [count, count(t.b) filter((flag = 1:Int64)), count(t.c) filter((flag = 0:Int64)), sum(sum(t.c)) filter((flag = 0:Int64))] } └─StreamExchange { dist: HashShard(t.a) } @@ -829,7 +829,7 @@ └─BatchExchange { order: [], dist: HashShard(t.a, t.b) } └─BatchScan { table: t, columns: [t.a, t.b, t.c], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [a, count, sum], pk_columns: [a] } + StreamMaterialize { columns: [a, count, sum], pk_columns: [a], pk_conflict: "no check" } └─StreamProject { exprs: [t.a, count(t.b) filter((count filter((t.b < 100:Int32)) > 0:Int64)), sum(sum(t.c))] } └─StreamHashAgg { group_key: [t.a], aggs: [count, count(t.b) filter((count filter((t.b < 100:Int32)) > 0:Int64)), sum(sum(t.c))] } └─StreamExchange { dist: HashShard(t.a) } @@ -859,7 +859,7 @@ └─LogicalProject { exprs: [t.b, (Length(t.a) * t.b) as $expr1] } └─LogicalScan { table: t, columns: [t.a, t.b] } stream_plan: | - StreamMaterialize { columns: [s1], pk_columns: [] } + StreamMaterialize { columns: [s1], pk_columns: [], pk_conflict: "no check" } └─StreamProject { exprs: [sum(sum($expr1) filter((t.b < 100:Int32) AND ((t.b * 2:Int32) > 10:Int32)))] } └─StreamGlobalSimpleAgg { aggs: [count, sum(sum($expr1) filter((t.b < 100:Int32) AND ((t.b * 2:Int32) > 10:Int32)))] } └─StreamExchange { dist: Single } @@ -888,7 +888,7 @@ └─BatchSortAgg { group_key: [i.x], aggs: [count] } └─BatchScan { table: i, columns: [i.x], distribution: UpstreamHashShard(i.x) } stream_plan: | - StreamMaterialize { columns: [cnt, i.x(hidden)], pk_columns: [i.x] } + StreamMaterialize { columns: [cnt, i.x(hidden)], pk_columns: [i.x], pk_conflict: "no check" } └─StreamProject { exprs: [count, i.x] } └─StreamHashAgg { group_key: [i.x], aggs: [count, count] } └─StreamTableScan { table: i, columns: [i.x, i.t._row_id], pk: [i.t._row_id], dist: UpstreamHashShard(i.x) } @@ -1096,7 +1096,7 @@ └─BatchProject { exprs: [t.v1, (t.v1 * t.v1) as $expr1] } └─BatchScan { table: t, columns: [t.v1], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [stddev_samp, stddev_pop], pk_columns: [] } + StreamMaterialize { columns: [stddev_samp, stddev_pop], pk_columns: [], pk_conflict: "no check" } └─StreamProject { exprs: [Case((sum0(count(t.v1)) <= 1:Int64), null:Float64, Pow(((sum(sum($expr1))::Decimal - ((sum(sum(t.v1))::Decimal * sum(sum(t.v1))::Decimal) / sum0(count(t.v1)))) / (sum0(count(t.v1)) - 1:Int64))::Float64, 0.5:Float64)) as $expr2, Pow(((sum(sum($expr1))::Decimal - ((sum(sum(t.v1))::Decimal * sum(sum(t.v1))::Decimal) / sum0(count(t.v1)))) / sum0(count(t.v1)))::Float64, 0.5:Float64) as $expr3] } └─StreamGlobalSimpleAgg { aggs: [count, sum(sum($expr1)), sum(sum(t.v1)), sum0(count(t.v1)), sum(sum($expr1)), sum(sum(t.v1)), sum0(count(t.v1))] } └─StreamExchange { dist: Single } diff --git a/src/frontend/planner_test/tests/testdata/append_only.yaml b/src/frontend/planner_test/tests/testdata/append_only.yaml index fd187115815b5..fac78b65abd81 100644 --- a/src/frontend/planner_test/tests/testdata/append_only.yaml +++ b/src/frontend/planner_test/tests/testdata/append_only.yaml @@ -3,7 +3,7 @@ create table t1 (v1 int, v2 int) with (appendonly = true); select v1, max(v2) as mx2 from t1 group by v1; stream_plan: | - StreamMaterialize { columns: [v1, mx2], pk_columns: [v1] } + StreamMaterialize { columns: [v1, mx2], pk_columns: [v1], pk_conflict: "no check" } └─StreamProject { exprs: [t1.v1, max(t1.v2)] } └─StreamAppendOnlyHashAgg { group_key: [t1.v1], aggs: [count, max(t1.v2)] } └─StreamExchange { dist: HashShard(t1.v1) } @@ -13,7 +13,7 @@ create table t2 (v1 int, v3 int) with (appendonly = true); select t1.v1 as id, v2, v3 from t1 join t2 on t1.v1=t2.v1; stream_plan: | - StreamMaterialize { columns: [id, v2, v3, t1._row_id(hidden), t2._row_id(hidden), t2.v1(hidden)], pk_columns: [t1._row_id, t2._row_id, id, t2.v1] } + StreamMaterialize { columns: [id, v2, v3, t1._row_id(hidden), t2._row_id(hidden), t2.v1(hidden)], pk_columns: [t1._row_id, t2._row_id, id, t2.v1], pk_conflict: "no check" } └─StreamAppendOnlyHashJoin { type: Inner, predicate: t1.v1 = t2.v1, output: [t1.v1, t1.v2, t2.v3, t1._row_id, t2._row_id, t2.v1] } ├─StreamExchange { dist: HashShard(t1.v1) } | └─StreamTableScan { table: t1, columns: [t1.v1, t1.v2, t1._row_id], pk: [t1._row_id], dist: UpstreamHashShard(t1._row_id) } @@ -23,7 +23,7 @@ create table t1 (v1 int, v2 int) with (appendonly = true); select v1 from t1 order by v1 limit 3 offset 3; stream_plan: | - StreamMaterialize { columns: [v1, t1._row_id(hidden)], pk_columns: [t1._row_id], order_descs: [v1, t1._row_id] } + StreamMaterialize { columns: [v1, t1._row_id(hidden)], pk_columns: [t1._row_id], order_descs: [v1, t1._row_id], pk_conflict: "no check" } └─StreamAppendOnlyTopN { order: "[t1.v1 ASC]", limit: 3, offset: 3 } └─StreamExchange { dist: Single } └─StreamTableScan { table: t1, columns: [t1.v1, t1._row_id], pk: [t1._row_id], dist: UpstreamHashShard(t1._row_id) } @@ -31,7 +31,7 @@ create table t1 (v1 int, v2 int) with (appendonly = true); select max(v1) as max_v1 from t1; stream_plan: | - StreamMaterialize { columns: [max_v1], pk_columns: [] } + StreamMaterialize { columns: [max_v1], pk_columns: [], pk_conflict: "no check" } └─StreamProject { exprs: [max(max(t1.v1))] } └─StreamAppendOnlyGlobalSimpleAgg { aggs: [count, max(max(t1.v1))] } └─StreamExchange { dist: Single } diff --git a/src/frontend/planner_test/tests/testdata/basic_query.yaml b/src/frontend/planner_test/tests/testdata/basic_query.yaml index ae2969499939f..218e92f009f2c 100644 --- a/src/frontend/planner_test/tests/testdata/basic_query.yaml +++ b/src/frontend/planner_test/tests/testdata/basic_query.yaml @@ -11,7 +11,7 @@ BatchExchange { order: [], dist: Single } └─BatchScan { table: t, columns: [t.v1, t.v2], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [v1, v2, t._row_id(hidden)], pk_columns: [t._row_id] } + StreamMaterialize { columns: [v1, v2, t._row_id(hidden)], pk_columns: [t._row_id], pk_conflict: "no check" } └─StreamTableScan { table: t, columns: [t.v1, t.v2, t._row_id], pk: [t._row_id], dist: UpstreamHashShard(t._row_id) } - sql: | create table t (v1 bigint, v2 double precision); @@ -25,7 +25,7 @@ └─BatchFilter { predicate: true:Boolean AND true:Boolean } └─BatchScan { table: t, columns: [], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [t._row_id(hidden)], pk_columns: [t._row_id] } + StreamMaterialize { columns: [t._row_id(hidden)], pk_columns: [t._row_id], pk_conflict: "no check" } └─StreamFilter { predicate: true:Boolean AND true:Boolean } └─StreamTableScan { table: t, columns: [t._row_id], pk: [t._row_id], dist: UpstreamHashShard(t._row_id) } - sql: | @@ -36,7 +36,7 @@ └─BatchFilter { predicate: (t.v1 < 1:Int32) } └─BatchScan { table: t, columns: [t.v1], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [v1, t._row_id(hidden)], pk_columns: [t._row_id] } + StreamMaterialize { columns: [v1, t._row_id(hidden)], pk_columns: [t._row_id], pk_conflict: "no check" } └─StreamFilter { predicate: (t.v1 < 1:Int32) } └─StreamTableScan { table: t, columns: [t.v1, t._row_id], pk: [t._row_id], dist: UpstreamHashShard(t._row_id) } - name: test boolean expression common factor extraction @@ -94,7 +94,7 @@ BatchExchange { order: [], dist: Single } └─BatchScan { table: t, columns: [t.v1], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [v1, t._row_id(hidden)], pk_columns: [t._row_id] } + StreamMaterialize { columns: [v1, t._row_id(hidden)], pk_columns: [t._row_id], pk_conflict: "no check" } └─StreamTableScan { table: t, columns: [t.v1, t._row_id], pk: [t._row_id], dist: UpstreamHashShard(t._row_id) } - sql: select 1 batch_plan: | @@ -184,20 +184,20 @@ create materialized view mv(A,b) as select * from t; select a, b from mv; stream_plan: | - StreamMaterialize { columns: [a, b, mv.t._row_id(hidden)], pk_columns: [mv.t._row_id] } + StreamMaterialize { columns: [a, b, mv.t._row_id(hidden)], pk_columns: [mv.t._row_id], pk_conflict: "no check" } └─StreamTableScan { table: mv, columns: [mv.a, mv.b, mv.t._row_id], pk: [mv.t._row_id], dist: UpstreamHashShard(mv.t._row_id) } - sql: | create table t (v1 int, v2 int); create materialized view mv(a,b) as select v1+1,v2+1 from t; select * from mv; stream_plan: | - StreamMaterialize { columns: [a, b, mv.t._row_id(hidden)], pk_columns: [mv.t._row_id] } + StreamMaterialize { columns: [a, b, mv.t._row_id(hidden)], pk_columns: [mv.t._row_id], pk_conflict: "no check" } └─StreamTableScan { table: mv, columns: [mv.a, mv.b, mv.t._row_id], pk: [mv.t._row_id], dist: UpstreamHashShard(mv.t._row_id) } - sql: | create table t (id int primary key, col int); create index idx on t(col); select id from idx; stream_plan: | - StreamMaterialize { columns: [id], pk_columns: [id] } + StreamMaterialize { columns: [id], pk_columns: [id], pk_conflict: "no check" } └─StreamExchange { dist: HashShard(idx.id) } └─StreamTableScan { table: idx, columns: [idx.id], pk: [idx.id], dist: SomeShard } diff --git a/src/frontend/planner_test/tests/testdata/column_pruning.yaml b/src/frontend/planner_test/tests/testdata/column_pruning.yaml index 24f0cc0ab3485..9b5181ef89560 100644 --- a/src/frontend/planner_test/tests/testdata/column_pruning.yaml +++ b/src/frontend/planner_test/tests/testdata/column_pruning.yaml @@ -150,6 +150,6 @@ └─BatchExchange { order: [], dist: Single } └─BatchScan { table: t1, columns: [t1.a, t1.created_at], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [a, window_end, t1._row_id(hidden)], pk_columns: [t1._row_id, window_end] } + StreamMaterialize { columns: [a, window_end, t1._row_id(hidden)], pk_columns: [t1._row_id, window_end], pk_conflict: "no check" } └─StreamHopWindow { time_col: t1.created_at, slide: 00:15:00, size: 00:30:00, output: [t1.a, window_end, t1._row_id] } └─StreamTableScan { table: t1, columns: [t1.a, t1.created_at, t1._row_id], pk: [t1._row_id], dist: UpstreamHashShard(t1._row_id) } diff --git a/src/frontend/planner_test/tests/testdata/common_table_expressions.yaml b/src/frontend/planner_test/tests/testdata/common_table_expressions.yaml index 09f890b0a09a1..e5241ef534cdd 100644 --- a/src/frontend/planner_test/tests/testdata/common_table_expressions.yaml +++ b/src/frontend/planner_test/tests/testdata/common_table_expressions.yaml @@ -8,7 +8,7 @@ └─LogicalProject { exprs: [t1.v1, t1.v2] } └─LogicalScan { table: t1, columns: [t1.v1, t1.v2, t1._row_id] } stream_plan: | - StreamMaterialize { columns: [v1, t1._row_id(hidden)], pk_columns: [t1._row_id] } + StreamMaterialize { columns: [v1, t1._row_id(hidden)], pk_columns: [t1._row_id], pk_conflict: "no check" } └─StreamTableScan { table: t1, columns: [t1.v1, t1._row_id], pk: [t1._row_id], dist: UpstreamHashShard(t1._row_id) } - sql: | create table t1 (v1 int, v2 int); @@ -22,7 +22,7 @@ └─LogicalProject { exprs: [t1.v1] } └─LogicalScan { table: t1, columns: [t1.v1, t1.v2, t1._row_id] } stream_plan: | - StreamMaterialize { columns: [v3, v4, v1, t2._row_id(hidden), t1._row_id(hidden)], pk_columns: [t2._row_id, t1._row_id, v3, v1] } + StreamMaterialize { columns: [v3, v4, v1, t2._row_id(hidden), t1._row_id(hidden)], pk_columns: [t2._row_id, t1._row_id, v3, v1], pk_conflict: "no check" } └─StreamHashJoin { type: Inner, predicate: t2.v3 = t1.v1, output: [t2.v3, t2.v4, t1.v1, t2._row_id, t1._row_id] } ├─StreamExchange { dist: HashShard(t2.v3) } | └─StreamTableScan { table: t2, columns: [t2.v3, t2.v4, t2._row_id], pk: [t2._row_id], dist: UpstreamHashShard(t2._row_id) } @@ -40,7 +40,7 @@ └─LogicalProject { exprs: [t1.v1, t1.v2] } └─LogicalScan { table: t1, columns: [t1.v1, t1.v2, t1._row_id] } stream_plan: | - StreamMaterialize { columns: [v1, t1._row_id(hidden)], pk_columns: [t1._row_id] } + StreamMaterialize { columns: [v1, t1._row_id(hidden)], pk_columns: [t1._row_id], pk_conflict: "no check" } └─StreamTableScan { table: t1, columns: [t1.v1, t1._row_id], pk: [t1._row_id], dist: UpstreamHashShard(t1._row_id) } - sql: | create table t1 (x int); diff --git a/src/frontend/planner_test/tests/testdata/delta_join.yaml b/src/frontend/planner_test/tests/testdata/delta_join.yaml index 331210d86a96c..4b00200aa87b0 100644 --- a/src/frontend/planner_test/tests/testdata/delta_join.yaml +++ b/src/frontend/planner_test/tests/testdata/delta_join.yaml @@ -8,7 +8,7 @@ /* should generate delta join plan, and stream index scan */ select * from a join b on a.a1 = b.b1 ; stream_plan: | - StreamMaterialize { columns: [a1, a2, b1, b2, i_a1.a._row_id(hidden), i_b1.b._row_id(hidden)], pk_columns: [i_a1.a._row_id, i_b1.b._row_id, a1, b1] } + StreamMaterialize { columns: [a1, a2, b1, b2, i_a1.a._row_id(hidden), i_b1.b._row_id(hidden)], pk_columns: [i_a1.a._row_id, i_b1.b._row_id, a1, b1], pk_conflict: "no check" } └─StreamExchange { dist: HashShard(i_a1.a1, i_b1.b1, i_a1.a._row_id, i_b1.b._row_id) } └─StreamDeltaJoin { type: Inner, predicate: i_a1.a1 = i_b1.b1, output: [i_a1.a1, i_a1.a2, i_b1.b1, i_b1.b2, i_a1.a._row_id, i_b1.b._row_id] } ├─StreamIndexScan { index: i_a1, columns: [i_a1.a1, i_a1.a2, i_a1.a._row_id], pk: [i_a1.a._row_id], dist: UpstreamHashShard(i_a1.a1) } @@ -21,7 +21,7 @@ /* should generate delta join plan, and stream index scan */ select * from a join b on a.a1 = b.b1 ; stream_plan: | - StreamMaterialize { columns: [a1, a2, b1, b2, i_b1.b._row_id(hidden)], pk_columns: [a1, i_b1.b._row_id, b1] } + StreamMaterialize { columns: [a1, a2, b1, b2, i_b1.b._row_id(hidden)], pk_columns: [a1, i_b1.b._row_id, b1], pk_conflict: "no check" } └─StreamExchange { dist: HashShard(a.a1, i_b1.b1, i_b1.b._row_id) } └─StreamDeltaJoin { type: Inner, predicate: a.a1 = i_b1.b1, output: all } ├─StreamTableScan { table: a, columns: [a.a1, a.a2], pk: [a.a1], dist: UpstreamHashShard(a.a1) } @@ -33,7 +33,7 @@ /* should generate delta join plan, and stream index scan */ select * from a join b on a.a1 = b.b1 ; stream_plan: | - StreamMaterialize { columns: [a1, a2, b1, b2], pk_columns: [a1, b1] } + StreamMaterialize { columns: [a1, a2, b1, b2], pk_columns: [a1, b1], pk_conflict: "no check" } └─StreamExchange { dist: HashShard(a.a1, b.b1) } └─StreamDeltaJoin { type: Inner, predicate: a.a1 = b.b1, output: all } ├─StreamTableScan { table: a, columns: [a.a1, a.a2], pk: [a.a1], dist: UpstreamHashShard(a.a1) } diff --git a/src/frontend/planner_test/tests/testdata/distribution_derive.yaml b/src/frontend/planner_test/tests/testdata/distribution_derive.yaml index c8c3485113524..63867bf068b0d 100644 --- a/src/frontend/planner_test/tests/testdata/distribution_derive.yaml +++ b/src/frontend/planner_test/tests/testdata/distribution_derive.yaml @@ -17,14 +17,14 @@ └─BatchExchange { order: [], dist: UpstreamHashShard(a.k1) } └─BatchScan { table: a, columns: [a.k1, a.v], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [v, bv, ak1.a._row_id(hidden), ak1.k1(hidden), bk1.b._row_id(hidden), bk1.k1(hidden)], pk_columns: [ak1.a._row_id, bk1.b._row_id, ak1.k1, bk1.k1] } + StreamMaterialize { columns: [v, bv, ak1.a._row_id(hidden), ak1.k1(hidden), bk1.b._row_id(hidden), bk1.k1(hidden)], pk_columns: [ak1.a._row_id, bk1.b._row_id, ak1.k1, bk1.k1], pk_conflict: "no check" } └─StreamExchange { dist: HashShard(ak1.a._row_id, ak1.k1, bk1.b._row_id, bk1.k1) } └─StreamDeltaJoin { type: Inner, predicate: ak1.k1 = bk1.k1, output: [ak1.v, bk1.v, ak1.a._row_id, ak1.k1, bk1.b._row_id, bk1.k1] } ├─StreamIndexScan { index: ak1, columns: [ak1.k1, ak1.v, ak1.a._row_id], pk: [ak1.a._row_id], dist: UpstreamHashShard(ak1.k1) } └─StreamIndexScan { index: bk1, columns: [bk1.k1, bk1.v, bk1.b._row_id], pk: [bk1.b._row_id], dist: UpstreamHashShard(bk1.k1) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [v, bv, ak1.a._row_id(hidden), ak1.k1(hidden), bk1.b._row_id(hidden), bk1.k1(hidden)], pk_columns: [ak1.a._row_id, bk1.b._row_id, ak1.k1, bk1.k1] } + StreamMaterialize { columns: [v, bv, ak1.a._row_id(hidden), ak1.k1(hidden), bk1.b._row_id(hidden), bk1.k1(hidden)], pk_columns: [ak1.a._row_id, bk1.b._row_id, ak1.k1, bk1.k1], pk_conflict: "no check" } materialized table: 4294967294 StreamExchange Hash([2, 3, 4, 5]) from 1 @@ -64,14 +64,14 @@ └─BatchExchange { order: [], dist: UpstreamHashShard(ak1.k1) } └─BatchScan { table: ak1, columns: [ak1.k1, ak1.v], distribution: UpstreamHashShard(ak1.k1) } stream_plan: | - StreamMaterialize { columns: [v, bv, ak1.a._row_id(hidden), ak1.k1(hidden), bk1.b._row_id(hidden), bk1.k1(hidden)], pk_columns: [ak1.a._row_id, bk1.b._row_id, ak1.k1, bk1.k1] } + StreamMaterialize { columns: [v, bv, ak1.a._row_id(hidden), ak1.k1(hidden), bk1.b._row_id(hidden), bk1.k1(hidden)], pk_columns: [ak1.a._row_id, bk1.b._row_id, ak1.k1, bk1.k1], pk_conflict: "no check" } └─StreamExchange { dist: HashShard(ak1.a._row_id, ak1.k1, bk1.b._row_id, bk1.k1) } └─StreamDeltaJoin { type: Inner, predicate: ak1.k1 = bk1.k1, output: [ak1.v, bk1.v, ak1.a._row_id, ak1.k1, bk1.b._row_id, bk1.k1] } ├─StreamTableScan { table: ak1, columns: [ak1.k1, ak1.v, ak1.a._row_id], pk: [ak1.a._row_id], dist: UpstreamHashShard(ak1.k1) } └─StreamIndexScan { index: bk1, columns: [bk1.k1, bk1.v, bk1.b._row_id], pk: [bk1.b._row_id], dist: UpstreamHashShard(bk1.k1) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [v, bv, ak1.a._row_id(hidden), ak1.k1(hidden), bk1.b._row_id(hidden), bk1.k1(hidden)], pk_columns: [ak1.a._row_id, bk1.b._row_id, ak1.k1, bk1.k1] } + StreamMaterialize { columns: [v, bv, ak1.a._row_id(hidden), ak1.k1(hidden), bk1.b._row_id(hidden), bk1.k1(hidden)], pk_columns: [ak1.a._row_id, bk1.b._row_id, ak1.k1, bk1.k1], pk_conflict: "no check" } materialized table: 4294967294 StreamExchange Hash([2, 3, 4, 5]) from 1 @@ -111,14 +111,14 @@ └─BatchExchange { order: [], dist: UpstreamHashShard(a.k1) } └─BatchScan { table: a, columns: [a.k1, a.v], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [v, bv, ak1.a._row_id(hidden), ak1.k1(hidden), bk1.b._row_id(hidden), bk1.k1(hidden)], pk_columns: [ak1.a._row_id, bk1.b._row_id, ak1.k1, bk1.k1] } + StreamMaterialize { columns: [v, bv, ak1.a._row_id(hidden), ak1.k1(hidden), bk1.b._row_id(hidden), bk1.k1(hidden)], pk_columns: [ak1.a._row_id, bk1.b._row_id, ak1.k1, bk1.k1], pk_conflict: "no check" } └─StreamExchange { dist: HashShard(ak1.a._row_id, ak1.k1, bk1.b._row_id, bk1.k1) } └─StreamDeltaJoin { type: Inner, predicate: ak1.k1 = bk1.k1, output: [ak1.v, bk1.v, ak1.a._row_id, ak1.k1, bk1.b._row_id, bk1.k1] } ├─StreamIndexScan { index: ak1, columns: [ak1.k1, ak1.v, ak1.a._row_id], pk: [ak1.a._row_id], dist: UpstreamHashShard(ak1.k1) } └─StreamTableScan { table: bk1, columns: [bk1.k1, bk1.v, bk1.b._row_id], pk: [bk1.b._row_id], dist: UpstreamHashShard(bk1.k1) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [v, bv, ak1.a._row_id(hidden), ak1.k1(hidden), bk1.b._row_id(hidden), bk1.k1(hidden)], pk_columns: [ak1.a._row_id, bk1.b._row_id, ak1.k1, bk1.k1] } + StreamMaterialize { columns: [v, bv, ak1.a._row_id(hidden), ak1.k1(hidden), bk1.b._row_id(hidden), bk1.k1(hidden)], pk_columns: [ak1.a._row_id, bk1.b._row_id, ak1.k1, bk1.k1], pk_conflict: "no check" } materialized table: 4294967294 StreamExchange Hash([2, 3, 4, 5]) from 1 @@ -158,14 +158,14 @@ └─BatchExchange { order: [], dist: UpstreamHashShard(ak1.k1) } └─BatchScan { table: ak1, columns: [ak1.k1, ak1.v], distribution: UpstreamHashShard(ak1.k1) } stream_plan: | - StreamMaterialize { columns: [v, bv, ak1.a._row_id(hidden), ak1.k1(hidden), bk1.b._row_id(hidden), bk1.k1(hidden)], pk_columns: [ak1.a._row_id, bk1.b._row_id, ak1.k1, bk1.k1] } + StreamMaterialize { columns: [v, bv, ak1.a._row_id(hidden), ak1.k1(hidden), bk1.b._row_id(hidden), bk1.k1(hidden)], pk_columns: [ak1.a._row_id, bk1.b._row_id, ak1.k1, bk1.k1], pk_conflict: "no check" } └─StreamExchange { dist: HashShard(ak1.a._row_id, ak1.k1, bk1.b._row_id, bk1.k1) } └─StreamDeltaJoin { type: Inner, predicate: ak1.k1 = bk1.k1, output: [ak1.v, bk1.v, ak1.a._row_id, ak1.k1, bk1.b._row_id, bk1.k1] } ├─StreamTableScan { table: ak1, columns: [ak1.k1, ak1.v, ak1.a._row_id], pk: [ak1.a._row_id], dist: UpstreamHashShard(ak1.k1) } └─StreamTableScan { table: bk1, columns: [bk1.k1, bk1.v, bk1.b._row_id], pk: [bk1.b._row_id], dist: UpstreamHashShard(bk1.k1) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [v, bv, ak1.a._row_id(hidden), ak1.k1(hidden), bk1.b._row_id(hidden), bk1.k1(hidden)], pk_columns: [ak1.a._row_id, bk1.b._row_id, ak1.k1, bk1.k1] } + StreamMaterialize { columns: [v, bv, ak1.a._row_id(hidden), ak1.k1(hidden), bk1.b._row_id(hidden), bk1.k1(hidden)], pk_columns: [ak1.a._row_id, bk1.b._row_id, ak1.k1, bk1.k1], pk_conflict: "no check" } materialized table: 4294967294 StreamExchange Hash([2, 3, 4, 5]) from 1 @@ -209,14 +209,14 @@ └─BatchExchange { order: [], dist: HashShard(a.k1) } └─BatchScan { table: a, columns: [a.k1, a.v], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [max_v, a.k1(hidden)], pk_columns: [a.k1] } + StreamMaterialize { columns: [max_v, a.k1(hidden)], pk_columns: [a.k1], pk_conflict: "no check" } └─StreamProject { exprs: [max(a.v), a.k1] } └─StreamHashAgg { group_key: [a.k1], aggs: [count, max(a.v)] } └─StreamExchange { dist: HashShard(a.k1) } └─StreamTableScan { table: a, columns: [a.k1, a.v, a._row_id], pk: [a._row_id], dist: UpstreamHashShard(a._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [max_v, a.k1(hidden)], pk_columns: [a.k1] } + StreamMaterialize { columns: [max_v, a.k1(hidden)], pk_columns: [a.k1], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [max(a.v), a.k1] } StreamHashAgg { group_key: [a.k1], aggs: [count, max(a.v)] } @@ -244,13 +244,13 @@ └─BatchSortAgg { group_key: [ak1.k1], aggs: [max(ak1.v)] } └─BatchScan { table: ak1, columns: [ak1.k1, ak1.v], distribution: UpstreamHashShard(ak1.k1) } stream_plan: | - StreamMaterialize { columns: [max_v, ak1.k1(hidden)], pk_columns: [ak1.k1] } + StreamMaterialize { columns: [max_v, ak1.k1(hidden)], pk_columns: [ak1.k1], pk_conflict: "no check" } └─StreamProject { exprs: [max(ak1.v), ak1.k1] } └─StreamHashAgg { group_key: [ak1.k1], aggs: [count, max(ak1.v)] } └─StreamTableScan { table: ak1, columns: [ak1.k1, ak1.v, ak1.a._row_id], pk: [ak1.a._row_id], dist: UpstreamHashShard(ak1.k1) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [max_v, ak1.k1(hidden)], pk_columns: [ak1.k1] } + StreamMaterialize { columns: [max_v, ak1.k1(hidden)], pk_columns: [ak1.k1], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [max(ak1.v), ak1.k1] } StreamHashAgg { group_key: [ak1.k1], aggs: [count, max(ak1.v)] } @@ -276,14 +276,14 @@ └─BatchExchange { order: [ak1k2.k1 ASC], dist: HashShard(ak1k2.k1) } └─BatchScan { table: ak1k2, columns: [ak1k2.k1, ak1k2.v], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [max_v, ak1k2.k1(hidden)], pk_columns: [ak1k2.k1] } + StreamMaterialize { columns: [max_v, ak1k2.k1(hidden)], pk_columns: [ak1k2.k1], pk_conflict: "no check" } └─StreamProject { exprs: [max(ak1k2.v), ak1k2.k1] } └─StreamHashAgg { group_key: [ak1k2.k1], aggs: [count, max(ak1k2.v)] } └─StreamExchange { dist: HashShard(ak1k2.k1) } └─StreamTableScan { table: ak1k2, columns: [ak1k2.k1, ak1k2.v, ak1k2.k2, ak1k2.a._row_id], pk: [ak1k2.a._row_id], dist: UpstreamHashShard(ak1k2.k1, ak1k2.k2) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [max_v, ak1k2.k1(hidden)], pk_columns: [ak1k2.k1] } + StreamMaterialize { columns: [max_v, ak1k2.k1(hidden)], pk_columns: [ak1k2.k1], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [max(ak1k2.v), ak1k2.k1] } StreamHashAgg { group_key: [ak1k2.k1], aggs: [count, max(ak1k2.v)] } @@ -312,14 +312,14 @@ └─BatchExchange { order: [], dist: HashShard(ak1k2.k2) } └─BatchScan { table: ak1k2, columns: [ak1k2.k2, ak1k2.v], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [max_v, ak1k2.k2(hidden)], pk_columns: [ak1k2.k2] } + StreamMaterialize { columns: [max_v, ak1k2.k2(hidden)], pk_columns: [ak1k2.k2], pk_conflict: "no check" } └─StreamProject { exprs: [max(ak1k2.v), ak1k2.k2] } └─StreamHashAgg { group_key: [ak1k2.k2], aggs: [count, max(ak1k2.v)] } └─StreamExchange { dist: HashShard(ak1k2.k2) } └─StreamTableScan { table: ak1k2, columns: [ak1k2.k2, ak1k2.v, ak1k2.k1, ak1k2.a._row_id], pk: [ak1k2.a._row_id], dist: UpstreamHashShard(ak1k2.k1, ak1k2.k2) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [max_v, ak1k2.k2(hidden)], pk_columns: [ak1k2.k2] } + StreamMaterialize { columns: [max_v, ak1k2.k2(hidden)], pk_columns: [ak1k2.k2], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [max(ak1k2.v), ak1k2.k2] } StreamHashAgg { group_key: [ak1k2.k2], aggs: [count, max(ak1k2.v)] } @@ -347,13 +347,13 @@ └─BatchSortAgg { group_key: [ak1k2.k1, ak1k2.k2], aggs: [sum(ak1k2.v)] } └─BatchScan { table: ak1k2, columns: [ak1k2.k1, ak1k2.k2, ak1k2.v], distribution: UpstreamHashShard(ak1k2.k1, ak1k2.k2) } stream_plan: | - StreamMaterialize { columns: [sum_v, ak1k2.k1(hidden), ak1k2.k2(hidden)], pk_columns: [ak1k2.k1, ak1k2.k2] } + StreamMaterialize { columns: [sum_v, ak1k2.k1(hidden), ak1k2.k2(hidden)], pk_columns: [ak1k2.k1, ak1k2.k2], pk_conflict: "no check" } └─StreamProject { exprs: [sum(ak1k2.v), ak1k2.k1, ak1k2.k2] } └─StreamHashAgg { group_key: [ak1k2.k1, ak1k2.k2], aggs: [count, sum(ak1k2.v)] } └─StreamTableScan { table: ak1k2, columns: [ak1k2.k1, ak1k2.k2, ak1k2.v, ak1k2.a._row_id], pk: [ak1k2.a._row_id], dist: UpstreamHashShard(ak1k2.k1, ak1k2.k2) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [sum_v, ak1k2.k1(hidden), ak1k2.k2(hidden)], pk_columns: [ak1k2.k1, ak1k2.k2] } + StreamMaterialize { columns: [sum_v, ak1k2.k1(hidden), ak1k2.k2(hidden)], pk_columns: [ak1k2.k1, ak1k2.k2], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [sum(ak1k2.v), ak1k2.k1, ak1k2.k2] } StreamHashAgg { group_key: [ak1k2.k1, ak1k2.k2], aggs: [count, sum(ak1k2.v)] } @@ -377,13 +377,13 @@ └─BatchHashAgg { group_key: [ak1.k1, ak1.k2], aggs: [sum(ak1.v)] } └─BatchScan { table: ak1, columns: [ak1.k1, ak1.k2, ak1.v], distribution: UpstreamHashShard(ak1.k1) } stream_plan: | - StreamMaterialize { columns: [sum_v, ak1.k1(hidden), ak1.k2(hidden)], pk_columns: [ak1.k1, ak1.k2] } + StreamMaterialize { columns: [sum_v, ak1.k1(hidden), ak1.k2(hidden)], pk_columns: [ak1.k1, ak1.k2], pk_conflict: "no check" } └─StreamProject { exprs: [sum(ak1.v), ak1.k1, ak1.k2] } └─StreamHashAgg { group_key: [ak1.k1, ak1.k2], aggs: [count, sum(ak1.v)] } └─StreamTableScan { table: ak1, columns: [ak1.k1, ak1.k2, ak1.v, ak1.a._row_id], pk: [ak1.a._row_id], dist: UpstreamHashShard(ak1.k1) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [sum_v, ak1.k1(hidden), ak1.k2(hidden)], pk_columns: [ak1.k1, ak1.k2] } + StreamMaterialize { columns: [sum_v, ak1.k1(hidden), ak1.k2(hidden)], pk_columns: [ak1.k1, ak1.k2], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [sum(ak1.v), ak1.k1, ak1.k2] } StreamHashAgg { group_key: [ak1.k1, ak1.k2], aggs: [count, sum(ak1.v)] } @@ -415,7 +415,7 @@ └─BatchExchange { order: [], dist: HashShard(a.k1) } └─BatchScan { table: a, columns: [a.k1], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [max_num, a.k1(hidden)], pk_columns: [a.k1] } + StreamMaterialize { columns: [max_num, a.k1(hidden)], pk_columns: [a.k1], pk_conflict: "no check" } └─StreamProject { exprs: [max(count), a.k1] } └─StreamHashAgg { group_key: [a.k1], aggs: [count, max(count)] } └─StreamProject { exprs: [a.k1, count] } @@ -424,7 +424,7 @@ └─StreamTableScan { table: a, columns: [a.k1, a._row_id], pk: [a._row_id], dist: UpstreamHashShard(a._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [max_num, a.k1(hidden)], pk_columns: [a.k1] } + StreamMaterialize { columns: [max_num, a.k1(hidden)], pk_columns: [a.k1], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [max(count), a.k1] } StreamHashAgg { group_key: [a.k1], aggs: [count, max(count)] } @@ -478,7 +478,7 @@ └─BatchExchange { order: [], dist: HashShard(a.k1, a.k2) } └─BatchScan { table: a, columns: [a.k1, a.k2], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [max_num, a.k1(hidden)], pk_columns: [a.k1] } + StreamMaterialize { columns: [max_num, a.k1(hidden)], pk_columns: [a.k1], pk_conflict: "no check" } └─StreamProject { exprs: [max(count), a.k1] } └─StreamHashAgg { group_key: [a.k1], aggs: [count, max(count)] } └─StreamExchange { dist: HashShard(a.k1) } @@ -488,7 +488,7 @@ └─StreamTableScan { table: a, columns: [a.k1, a.k2, a._row_id], pk: [a._row_id], dist: UpstreamHashShard(a._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [max_num, a.k1(hidden)], pk_columns: [a.k1] } + StreamMaterialize { columns: [max_num, a.k1(hidden)], pk_columns: [a.k1], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [max(count), a.k1] } StreamHashAgg { group_key: [a.k1], aggs: [count, max(count)] } @@ -545,7 +545,7 @@ └─BatchExchange { order: [], dist: HashShard(a.k1, a.k2) } └─BatchScan { table: a, columns: [a.k1, a.k2], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [max_num, a.k2(hidden)], pk_columns: [a.k2] } + StreamMaterialize { columns: [max_num, a.k2(hidden)], pk_columns: [a.k2], pk_conflict: "no check" } └─StreamProject { exprs: [max(count), a.k2] } └─StreamHashAgg { group_key: [a.k2], aggs: [count, max(count)] } └─StreamExchange { dist: HashShard(a.k2) } @@ -555,7 +555,7 @@ └─StreamTableScan { table: a, columns: [a.k1, a.k2, a._row_id], pk: [a._row_id], dist: UpstreamHashShard(a._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [max_num, a.k2(hidden)], pk_columns: [a.k2] } + StreamMaterialize { columns: [max_num, a.k2(hidden)], pk_columns: [a.k2], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [max(count), a.k2] } StreamHashAgg { group_key: [a.k2], aggs: [count, max(count)] } @@ -598,7 +598,7 @@ └─BatchExchange { order: [], dist: HashShard(a.k1, a.k2) } └─BatchScan { table: a, columns: [a.k1, a.k2], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [max_num, a.k1(hidden), a.k2(hidden)], pk_columns: [a.k1, a.k2] } + StreamMaterialize { columns: [max_num, a.k1(hidden), a.k2(hidden)], pk_columns: [a.k1, a.k2], pk_conflict: "no check" } └─StreamProject { exprs: [max(count), a.k1, a.k2] } └─StreamHashAgg { group_key: [a.k1, a.k2], aggs: [count, max(count)] } └─StreamProject { exprs: [a.k1, a.k2, count] } @@ -607,7 +607,7 @@ └─StreamTableScan { table: a, columns: [a.k1, a.k2, a._row_id], pk: [a._row_id], dist: UpstreamHashShard(a._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [max_num, a.k1(hidden), a.k2(hidden)], pk_columns: [a.k1, a.k2] } + StreamMaterialize { columns: [max_num, a.k1(hidden), a.k2(hidden)], pk_columns: [a.k1, a.k2], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [max(count), a.k1, a.k2] } StreamHashAgg { group_key: [a.k1, a.k2], aggs: [count, max(count)] } @@ -647,7 +647,7 @@ └─BatchExchange { order: [], dist: HashShard(a.k1) } └─BatchScan { table: a, columns: [a.k1], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [v, bv, ak1.a._row_id(hidden), ak1.k1(hidden), a.k1(hidden)], pk_columns: [ak1.a._row_id, a.k1, ak1.k1] } + StreamMaterialize { columns: [v, bv, ak1.a._row_id(hidden), ak1.k1(hidden), a.k1(hidden)], pk_columns: [ak1.a._row_id, a.k1, ak1.k1], pk_conflict: "no check" } └─StreamHashJoin { type: Inner, predicate: ak1.k1 = a.k1, output: [ak1.v, count, ak1.a._row_id, ak1.k1, a.k1] } ├─StreamExchange { dist: HashShard(ak1.k1) } | └─StreamTableScan { table: ak1, columns: [ak1.k1, ak1.v, ak1.a._row_id], pk: [ak1.a._row_id], dist: UpstreamHashShard(ak1.k1) } @@ -657,7 +657,7 @@ └─StreamTableScan { table: a, columns: [a.k1, a._row_id], pk: [a._row_id], dist: UpstreamHashShard(a._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [v, bv, ak1.a._row_id(hidden), ak1.k1(hidden), a.k1(hidden)], pk_columns: [ak1.a._row_id, a.k1, ak1.k1] } + StreamMaterialize { columns: [v, bv, ak1.a._row_id(hidden), ak1.k1(hidden), a.k1(hidden)], pk_columns: [ak1.a._row_id, a.k1, ak1.k1], pk_conflict: "no check" } materialized table: 4294967294 StreamHashJoin { type: Inner, predicate: ak1.k1 = a.k1, output: [ak1.v, count, ak1.a._row_id, ak1.k1, a.k1] } left table: 0, right table 2, left degree table: 1, right degree table: 3, @@ -703,7 +703,7 @@ └─BatchExchange { order: [], dist: HashShard(a.k1) } └─BatchScan { table: a, columns: [a.k1], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [v, bv, a.k1(hidden), ak1.a._row_id(hidden), ak1.k1(hidden)], pk_columns: [a.k1, ak1.a._row_id, ak1.k1] } + StreamMaterialize { columns: [v, bv, a.k1(hidden), ak1.a._row_id(hidden), ak1.k1(hidden)], pk_columns: [a.k1, ak1.a._row_id, ak1.k1], pk_conflict: "no check" } └─StreamHashJoin { type: Inner, predicate: a.k1 = ak1.k1, output: [ak1.v, count, a.k1, ak1.a._row_id, ak1.k1] } ├─StreamProject { exprs: [count, a.k1] } | └─StreamHashAgg { group_key: [a.k1], aggs: [count, count] } @@ -713,7 +713,7 @@ └─StreamTableScan { table: ak1, columns: [ak1.k1, ak1.v, ak1.a._row_id], pk: [ak1.a._row_id], dist: UpstreamHashShard(ak1.k1) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [v, bv, a.k1(hidden), ak1.a._row_id(hidden), ak1.k1(hidden)], pk_columns: [a.k1, ak1.a._row_id, ak1.k1] } + StreamMaterialize { columns: [v, bv, a.k1(hidden), ak1.a._row_id(hidden), ak1.k1(hidden)], pk_columns: [a.k1, ak1.a._row_id, ak1.k1], pk_conflict: "no check" } materialized table: 4294967294 StreamHashJoin { type: Inner, predicate: a.k1 = ak1.k1, output: [ak1.v, count, a.k1, ak1.a._row_id, ak1.k1] } left table: 0, right table 2, left degree table: 1, right degree table: 3, @@ -767,7 +767,7 @@ └─BatchExchange { order: [], dist: HashShard(b.k1) } └─BatchScan { table: b, columns: [b.k1], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [num, bv, a.k1(hidden), b.k1(hidden)], pk_columns: [a.k1, b.k1] } + StreamMaterialize { columns: [num, bv, a.k1(hidden), b.k1(hidden)], pk_columns: [a.k1, b.k1], pk_conflict: "no check" } └─StreamHashJoin { type: Inner, predicate: a.k1 = b.k1, output: [count, count, a.k1, b.k1] } ├─StreamProject { exprs: [count, a.k1] } | └─StreamHashAgg { group_key: [a.k1], aggs: [count, count] } @@ -779,7 +779,7 @@ └─StreamTableScan { table: b, columns: [b.k1, b._row_id], pk: [b._row_id], dist: UpstreamHashShard(b._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [num, bv, a.k1(hidden), b.k1(hidden)], pk_columns: [a.k1, b.k1] } + StreamMaterialize { columns: [num, bv, a.k1(hidden), b.k1(hidden)], pk_columns: [a.k1, b.k1], pk_conflict: "no check" } materialized table: 4294967294 StreamHashJoin { type: Inner, predicate: a.k1 = b.k1, output: [count, count, a.k1, b.k1] } left table: 0, right table 2, left degree table: 1, right degree table: 3, @@ -824,12 +824,12 @@ └─BatchExchange { order: [], dist: Single } └─BatchScan { table: t1, columns: [t1.row_id, t1.uid, t1.v, t1.created_at], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [row_id, uid, v, created_at, window_start, window_end, t1._row_id(hidden)], pk_columns: [t1._row_id, window_start, window_end] } + StreamMaterialize { columns: [row_id, uid, v, created_at, window_start, window_end, t1._row_id(hidden)], pk_columns: [t1._row_id, window_start, window_end], pk_conflict: "no check" } └─StreamHopWindow { time_col: t1.created_at, slide: 00:15:00, size: 00:30:00, output: [t1.row_id, t1.uid, t1.v, t1.created_at, window_start, window_end, t1._row_id] } └─StreamTableScan { table: t1, columns: [t1.row_id, t1.uid, t1.v, t1.created_at, t1._row_id], pk: [t1._row_id], dist: UpstreamHashShard(t1._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [row_id, uid, v, created_at, window_start, window_end, t1._row_id(hidden)], pk_columns: [t1._row_id, window_start, window_end] } + StreamMaterialize { columns: [row_id, uid, v, created_at, window_start, window_end, t1._row_id(hidden)], pk_columns: [t1._row_id, window_start, window_end], pk_conflict: "no check" } materialized table: 4294967294 StreamHopWindow { time_col: t1.created_at, slide: 00:15:00, size: 00:30:00, output: [t1.row_id, t1.uid, t1.v, t1.created_at, window_start, window_end, t1._row_id] } Chain { table: t1, columns: [t1.row_id, t1.uid, t1.v, t1.created_at, t1._row_id], pk: [t1._row_id], dist: UpstreamHashShard(t1._row_id) } diff --git a/src/frontend/planner_test/tests/testdata/dynamic_filter.yaml b/src/frontend/planner_test/tests/testdata/dynamic_filter.yaml index a7843a952cfc5..1f9f5efe75d81 100644 --- a/src/frontend/planner_test/tests/testdata/dynamic_filter.yaml +++ b/src/frontend/planner_test/tests/testdata/dynamic_filter.yaml @@ -14,7 +14,7 @@ └─LogicalAgg { aggs: [max(t2.v2)] } └─LogicalScan { table: t2, columns: [t2.v2] } stream_plan: | - StreamMaterialize { columns: [v1, t1._row_id(hidden)], pk_columns: [t1._row_id] } + StreamMaterialize { columns: [v1, t1._row_id(hidden)], pk_columns: [t1._row_id], pk_conflict: "no check" } └─StreamDynamicFilter { predicate: (t1.v1 > max(max(t2.v2))), output: [t1.v1, t1._row_id] } ├─StreamTableScan { table: t1, columns: [t1.v1, t1._row_id], pk: [t1._row_id], dist: UpstreamHashShard(t1._row_id) } └─StreamExchange { dist: Broadcast } @@ -56,7 +56,7 @@ └─LogicalAgg { aggs: [max(t2.v2)] } └─LogicalScan { table: t2, columns: [t2.v2] } stream_plan: | - StreamMaterialize { columns: [v1, t1._row_id(hidden)], pk_columns: [t1._row_id] } + StreamMaterialize { columns: [v1, t1._row_id(hidden)], pk_columns: [t1._row_id], pk_conflict: "no check" } └─StreamProject { exprs: [t1.v1, t1._row_id] } └─StreamDynamicFilter { predicate: ($expr1 > max(max(t2.v2))), output: [t1.v1, $expr1, t1._row_id] } ├─StreamProject { exprs: [t1.v1, (t1.v1 + t1.v1) as $expr1, t1._row_id] } @@ -109,7 +109,7 @@ └─LogicalAgg { aggs: [max(t2.v2)] } └─LogicalScan { table: t2, columns: [t2.v2] } stream_plan: | - StreamMaterialize { columns: [v1, max, t1._row_id(hidden)], pk_columns: [t1._row_id, v1, max] } + StreamMaterialize { columns: [v1, max, t1._row_id(hidden)], pk_columns: [t1._row_id, v1, max], pk_conflict: "no check" } └─StreamHashJoin { type: Inner, predicate: t1.v1 = max(max(t2.v2)), output: [t1.v1, max(max(t2.v2)), t1._row_id] } ├─StreamExchange { dist: HashShard(t1.v1) } | └─StreamTableScan { table: t1, columns: [t1.v1, t1._row_id], pk: [t1._row_id], dist: UpstreamHashShard(t1._row_id) } @@ -132,7 +132,7 @@ └─LogicalAgg { aggs: [max(t2.v2)] } └─LogicalScan { table: t2, columns: [t2.v2] } stream_plan: | - StreamMaterialize { columns: [v1, t1._row_id(hidden)], pk_columns: [t1._row_id] } + StreamMaterialize { columns: [v1, t1._row_id(hidden)], pk_columns: [t1._row_id], pk_conflict: "no check" } └─StreamProject { exprs: [t1.v1, t1._row_id] } └─StreamDynamicFilter { predicate: ($expr1 > max(max(t2.v2))), output: [t1.v1, $expr1, t1._row_id] } ├─StreamProject { exprs: [t1.v1, t1.v1::Int64 as $expr1, t1._row_id] } @@ -150,7 +150,7 @@ create table t2 (v2 int); with max_v2 as (select max(v2) max from t2) select v1 from t1 where exists (select * from max_v2 where v1 > max); stream_plan: | - StreamMaterialize { columns: [v1, t1._row_id(hidden)], pk_columns: [t1._row_id] } + StreamMaterialize { columns: [v1, t1._row_id(hidden)], pk_columns: [t1._row_id], pk_conflict: "no check" } └─StreamDynamicFilter { predicate: (t1.v1 > max(max(t2.v2))), output: [t1.v1, t1._row_id] } ├─StreamTableScan { table: t1, columns: [t1.v1, t1._row_id], pk: [t1._row_id], dist: UpstreamHashShard(t1._row_id) } └─StreamExchange { dist: Broadcast } @@ -172,7 +172,7 @@ └─LogicalAgg { aggs: [max(t2.v2)] } └─LogicalScan { table: t2, columns: [t2.v2] } stream_plan: | - StreamMaterialize { columns: [v1, t1._row_id(hidden)], pk_columns: [t1._row_id] } + StreamMaterialize { columns: [v1, t1._row_id(hidden)], pk_columns: [t1._row_id], pk_conflict: "no check" } └─StreamDynamicFilter { predicate: (t1.v1 > $expr2), output: [t1.v1, t1._row_id] } ├─StreamTableScan { table: t1, columns: [t1.v1, t1._row_id], pk: [t1._row_id], dist: UpstreamHashShard(t1._row_id) } └─StreamExchange { dist: Broadcast } diff --git a/src/frontend/planner_test/tests/testdata/explain.yaml b/src/frontend/planner_test/tests/testdata/explain.yaml index 2c8a6138f7877..54561c668b574 100644 --- a/src/frontend/planner_test/tests/testdata/explain.yaml +++ b/src/frontend/planner_test/tests/testdata/explain.yaml @@ -176,7 +176,7 @@ - sql: | explain create table t (v1 int, v2 varchar); explain_output: | - StreamMaterialize { columns: [v1, v2, _row_id(hidden)], pk_columns: [_row_id] } + StreamMaterialize { columns: [v1, v2, _row_id(hidden)], pk_columns: [_row_id], pk_conflict: "overwrite" } └─StreamExchange { dist: HashShard(_row_id) } └─StreamRowIdGen { row_id_index: 2 } └─StreamDml { columns: [v1, v2, _row_id] } @@ -184,7 +184,7 @@ - sql: | explain create table t (v1 int, v2 varchar) with ( connector = 'kafka', kafka.topic = 'kafka_3_partition_topic', kafka.brokers = '127.0.0.1:1234', kafka.scan.startup.mode='earliest' ) row format json; explain_output: | - StreamMaterialize { columns: [v1, v2, _row_id(hidden)], pk_columns: [_row_id] } + StreamMaterialize { columns: [v1, v2, _row_id(hidden)], pk_columns: [_row_id], pk_conflict: "overwrite" } └─StreamExchange { dist: HashShard(_row_id) } └─StreamRowIdGen { row_id_index: 2 } └─StreamDml { columns: [v1, v2, _row_id] } diff --git a/src/frontend/planner_test/tests/testdata/expr.yaml b/src/frontend/planner_test/tests/testdata/expr.yaml index 855c1b89c8d47..35fa5b38c1726 100644 --- a/src/frontend/planner_test/tests/testdata/expr.yaml +++ b/src/frontend/planner_test/tests/testdata/expr.yaml @@ -177,7 +177,7 @@ └─BatchProject { exprs: [Case((t.v1 = 1:Int32), 1:Decimal, (t.v1 = 2:Int32), 2:Decimal, 0.0:Decimal) as $expr1] } └─BatchScan { table: t, columns: [t.v1], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [expr, t._row_id(hidden)], pk_columns: [t._row_id] } + StreamMaterialize { columns: [expr, t._row_id(hidden)], pk_columns: [t._row_id], pk_conflict: "no check" } └─StreamProject { exprs: [Case((t.v1 = 1:Int32), 1:Decimal, (t.v1 = 2:Int32), 2:Decimal, 0.0:Decimal) as $expr1, t._row_id] } └─StreamTableScan { table: t, columns: [t.v1, t._row_id], pk: [t._row_id], dist: UpstreamHashShard(t._row_id) } - name: case searched form without else @@ -216,7 +216,7 @@ └─BatchProject { exprs: [Case((t.v1 = 1:Int32), null:Int32, t.v1) as $expr1] } └─BatchScan { table: t, columns: [t.v1], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [expr, t._row_id(hidden)], pk_columns: [t._row_id] } + StreamMaterialize { columns: [expr, t._row_id(hidden)], pk_columns: [t._row_id], pk_conflict: "no check" } └─StreamProject { exprs: [Case((t.v1 = 1:Int32), null:Int32, t.v1) as $expr1, t._row_id] } └─StreamTableScan { table: t, columns: [t.v1, t._row_id], pk: [t._row_id], dist: UpstreamHashShard(t._row_id) } - sql: | @@ -237,7 +237,7 @@ └─BatchProject { exprs: [Coalesce(t.v1, 1:Int32) as $expr1] } └─BatchScan { table: t, columns: [t.v1], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [expr, t._row_id(hidden)], pk_columns: [t._row_id] } + StreamMaterialize { columns: [expr, t._row_id(hidden)], pk_columns: [t._row_id], pk_conflict: "no check" } └─StreamProject { exprs: [Coalesce(t.v1, 1:Int32) as $expr1, t._row_id] } └─StreamTableScan { table: t, columns: [t.v1, t._row_id], pk: [t._row_id], dist: UpstreamHashShard(t._row_id) } - sql: | @@ -263,7 +263,7 @@ └─BatchProject { exprs: [ConcatWs(t.v1, '1':Varchar) as $expr1] } └─BatchScan { table: t, columns: [t.v1], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [expr, t._row_id(hidden)], pk_columns: [t._row_id] } + StreamMaterialize { columns: [expr, t._row_id(hidden)], pk_columns: [t._row_id], pk_conflict: "no check" } └─StreamProject { exprs: [ConcatWs(t.v1, '1':Varchar) as $expr1, t._row_id] } └─StreamTableScan { table: t, columns: [t.v1, t._row_id], pk: [t._row_id], dist: UpstreamHashShard(t._row_id) } - sql: | @@ -289,7 +289,7 @@ └─BatchProject { exprs: [ConcatWs('':Varchar, t.v1, t.v2::Varchar, t.v3::Varchar, '1':Varchar) as $expr1] } └─BatchScan { table: t, columns: [t.v1, t.v2, t.v3], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [expr, t._row_id(hidden)], pk_columns: [t._row_id] } + StreamMaterialize { columns: [expr, t._row_id(hidden)], pk_columns: [t._row_id], pk_conflict: "no check" } └─StreamProject { exprs: [ConcatWs('':Varchar, t.v1, t.v2::Varchar, t.v3::Varchar, '1':Varchar) as $expr1, t._row_id] } └─StreamTableScan { table: t, columns: [t.v1, t.v2, t.v3, t._row_id], pk: [t._row_id], dist: UpstreamHashShard(t._row_id) } - sql: | @@ -442,7 +442,7 @@ └─LogicalFilter { predicate: (t.v1 >= Now) } └─LogicalScan { table: t, columns: [t.v1, t._row_id] } stream_plan: | - StreamMaterialize { columns: [v1, t._row_id(hidden)], pk_columns: [t._row_id] } + StreamMaterialize { columns: [v1, t._row_id(hidden)], pk_columns: [t._row_id], pk_conflict: "no check" } └─StreamDynamicFilter { predicate: (t.v1 >= now), output: [t.v1, t._row_id] } ├─StreamTableScan { table: t, columns: [t.v1, t._row_id], pk: [t._row_id], dist: UpstreamHashShard(t._row_id) } └─StreamExchange { dist: Broadcast } @@ -456,7 +456,7 @@ └─LogicalFilter { predicate: (t.v1 >= (Now - '00:00:02':Interval)) } └─LogicalScan { table: t, columns: [t.v1, t._row_id] } stream_plan: | - StreamMaterialize { columns: [v1, t._row_id(hidden)], pk_columns: [t._row_id] } + StreamMaterialize { columns: [v1, t._row_id(hidden)], pk_columns: [t._row_id], pk_conflict: "no check" } └─StreamDynamicFilter { predicate: (t.v1 >= $expr1), output: [t.v1, t._row_id] } ├─StreamTableScan { table: t, columns: [t.v1, t._row_id], pk: [t._row_id], dist: UpstreamHashShard(t._row_id) } └─StreamExchange { dist: Broadcast } @@ -467,7 +467,7 @@ create table t (v1 timestamp with time zone, v2 timestamp with time zone); select * from t where v1 >= now() and v2 >= now(); stream_plan: | - StreamMaterialize { columns: [v1, v2, t._row_id(hidden)], pk_columns: [t._row_id] } + StreamMaterialize { columns: [v1, v2, t._row_id(hidden)], pk_columns: [t._row_id], pk_conflict: "no check" } └─StreamDynamicFilter { predicate: (t.v2 >= now), output: [t.v1, t.v2, t._row_id] } ├─StreamDynamicFilter { predicate: (t.v1 >= now), output: [t.v1, t.v2, t._row_id] } | ├─StreamTableScan { table: t, columns: [t.v1, t.v2, t._row_id], pk: [t._row_id], dist: UpstreamHashShard(t._row_id) } @@ -485,7 +485,7 @@ create table t (v1 timestamp with time zone, v2 int); select max(v1) as max_time from t group by v2 having max(v1) >= now(); stream_plan: | - StreamMaterialize { columns: [max_time, t.v2(hidden)], pk_columns: [t.v2] } + StreamMaterialize { columns: [max_time, t.v2(hidden)], pk_columns: [t.v2], pk_conflict: "no check" } └─StreamProject { exprs: [max(t.v1), t.v2] } └─StreamDynamicFilter { predicate: (max(t.v1) >= now), output: [max(t.v1), max(t.v1), t.v2] } ├─StreamProject { exprs: [max(t.v1), max(t.v1), t.v2] } diff --git a/src/frontend/planner_test/tests/testdata/index_selection.yaml b/src/frontend/planner_test/tests/testdata/index_selection.yaml index fe01e572efff1..a227d2992cd58 100644 --- a/src/frontend/planner_test/tests/testdata/index_selection.yaml +++ b/src/frontend/planner_test/tests/testdata/index_selection.yaml @@ -613,7 +613,7 @@ create table t1 (a int primary key); select * from t1 order by a limit 1; stream_plan: | - StreamMaterialize { columns: [a], pk_columns: [a] } + StreamMaterialize { columns: [a], pk_columns: [a], pk_conflict: "no check" } └─StreamProject { exprs: [t1.a] } └─StreamTopN { order: "[t1.a ASC]", limit: 1, offset: 0 } └─StreamExchange { dist: Single } diff --git a/src/frontend/planner_test/tests/testdata/join.yaml b/src/frontend/planner_test/tests/testdata/join.yaml index daa293cb1fd10..b96a8e504c8ce 100644 --- a/src/frontend/planner_test/tests/testdata/join.yaml +++ b/src/frontend/planner_test/tests/testdata/join.yaml @@ -13,7 +13,7 @@ | └─LogicalScan { table: t2, columns: [t2.v3, t2.v4, t2._row_id] } └─LogicalScan { table: t3, columns: [t3.v5, t3.v6, t3._row_id] } stream_plan: | - StreamMaterialize { columns: [v1, v2, v3, v4, v5, v6, t1._row_id(hidden), t2._row_id(hidden), t3._row_id(hidden)], pk_columns: [t1._row_id, t2._row_id, v1, v3, t3._row_id, v5] } + StreamMaterialize { columns: [v1, v2, v3, v4, v5, v6, t1._row_id(hidden), t2._row_id(hidden), t3._row_id(hidden)], pk_columns: [t1._row_id, t2._row_id, v1, v3, t3._row_id, v5], pk_conflict: "no check" } └─StreamHashJoin { type: Inner, predicate: t1.v1 = t3.v5, output: [t1.v1, t1.v2, t2.v3, t2.v4, t3.v5, t3.v6, t1._row_id, t2._row_id, t3._row_id] } ├─StreamHashJoin { type: Inner, predicate: t1.v1 = t2.v3, output: [t1.v1, t1.v2, t2.v3, t2.v4, t1._row_id, t2._row_id] } | ├─StreamExchange { dist: HashShard(t1.v1) } @@ -32,7 +32,7 @@ ├─LogicalScan { table: t, columns: [t.v1, t.v2, t._row_id] } └─LogicalScan { table: t, columns: [t.v1, t.v2, t._row_id] } stream_plan: | - StreamMaterialize { columns: [t1v1, t2v1, t._row_id(hidden), t._row_id#1(hidden)], pk_columns: [t._row_id, t._row_id#1, t1v1, t2v1] } + StreamMaterialize { columns: [t1v1, t2v1, t._row_id(hidden), t._row_id#1(hidden)], pk_columns: [t._row_id, t._row_id#1, t1v1, t2v1], pk_conflict: "no check" } └─StreamHashJoin { type: Inner, predicate: t.v1 = t.v1, output: [t.v1, t.v1, t._row_id, t._row_id] } ├─StreamExchange { dist: HashShard(t.v1) } | └─StreamTableScan { table: t, columns: [t.v1, t._row_id], pk: [t._row_id], dist: UpstreamHashShard(t._row_id) } @@ -64,7 +64,7 @@ └─BatchExchange { order: [], dist: Single } └─BatchScan { table: t3, columns: [t3.v1, t3.v2], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [t1_v1, t1_v2, t2_v1, t2_v2, t3_v1, t3_v2, t1._row_id(hidden), t2._row_id(hidden), t3._row_id(hidden)], pk_columns: [t1._row_id, t2._row_id, t1_v1, t2_v1, t3._row_id, t2_v2, t3_v2] } + StreamMaterialize { columns: [t1_v1, t1_v2, t2_v1, t2_v2, t3_v1, t3_v2, t1._row_id(hidden), t2._row_id(hidden), t3._row_id(hidden)], pk_columns: [t1._row_id, t2._row_id, t1_v1, t2_v1, t3._row_id, t2_v2, t3_v2], pk_conflict: "no check" } └─StreamHashJoin { type: Inner, predicate: t2.v2 = t3.v2, output: [t1.v1, t1.v2, t2.v1, t2.v2, t3.v1, t3.v2, t1._row_id, t2._row_id, t3._row_id] } ├─StreamExchange { dist: HashShard(t2.v2) } | └─StreamHashJoin { type: Inner, predicate: t1.v1 = t2.v1, output: [t1.v1, t1.v2, t2.v1, t2.v2, t1._row_id, t2._row_id] } @@ -92,7 +92,7 @@ └─BatchExchange { order: [], dist: Single } └─BatchScan { table: t2, columns: [t2.v1, t2.v2], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [t1_v2, t2_v2, t1._row_id(hidden), t1.v1(hidden), t2._row_id(hidden), t2.v1(hidden)], pk_columns: [t1._row_id, t2._row_id, t1.v1, t2.v1] } + StreamMaterialize { columns: [t1_v2, t2_v2, t1._row_id(hidden), t1.v1(hidden), t2._row_id(hidden), t2.v1(hidden)], pk_columns: [t1._row_id, t2._row_id, t1.v1, t2.v1], pk_conflict: "no check" } └─StreamHashJoin { type: Inner, predicate: t1.v1 = t2.v1, output: [t1.v2, t2.v2, t1._row_id, t1.v1, t2._row_id, t2.v1] } ├─StreamExchange { dist: HashShard(t1.v1) } | └─StreamTableScan { table: t1, columns: [t1.v1, t1.v2, t1._row_id], pk: [t1._row_id], dist: UpstreamHashShard(t1._row_id) } @@ -153,7 +153,7 @@ └─BatchLookupJoin { type: Inner, predicate: i.x = i.x, output: all } └─BatchScan { table: i, columns: [i.x], distribution: UpstreamHashShard(i.x) } stream_plan: | - StreamMaterialize { columns: [ix, iix, i.t._row_id(hidden), i.t._row_id#1(hidden)], pk_columns: [i.t._row_id, i.t._row_id#1, ix, iix] } + StreamMaterialize { columns: [ix, iix, i.t._row_id(hidden), i.t._row_id#1(hidden)], pk_columns: [i.t._row_id, i.t._row_id#1, ix, iix], pk_conflict: "no check" } └─StreamHashJoin { type: Inner, predicate: i.x = i.x, output: [i.x, i.x, i.t._row_id, i.t._row_id] } ├─StreamExchange { dist: HashShard(i.x) } | └─StreamTableScan { table: i, columns: [i.x, i.t._row_id], pk: [i.t._row_id], dist: UpstreamHashShard(i.x) } @@ -169,7 +169,7 @@ └─BatchLookupJoin { type: Inner, predicate: i.x = i.x, output: all } └─BatchScan { table: i, columns: [i.x], distribution: UpstreamHashShard(i.x) } stream_plan: | - StreamMaterialize { columns: [ix, tx, i.t._row_id(hidden), t._row_id(hidden)], pk_columns: [i.t._row_id, t._row_id, ix, tx] } + StreamMaterialize { columns: [ix, tx, i.t._row_id(hidden), t._row_id(hidden)], pk_columns: [i.t._row_id, t._row_id, ix, tx], pk_conflict: "no check" } └─StreamHashJoin { type: Inner, predicate: i.x = t.x, output: [i.x, t.x, i.t._row_id, t._row_id] } ├─StreamExchange { dist: HashShard(i.x) } | └─StreamTableScan { table: i, columns: [i.x, i.t._row_id], pk: [i.t._row_id], dist: UpstreamHashShard(i.x) } @@ -195,7 +195,7 @@ └─BatchLookupJoin { type: Inner, predicate: i.x = i.x, output: [i.x] } └─BatchScan { table: i, columns: [i.x], distribution: UpstreamHashShard(i.x) } stream_plan: | - StreamMaterialize { columns: [x, i.t._row_id(hidden), i.t._row_id#1(hidden), i.x(hidden), i.x#1(hidden), i.t._row_id#2(hidden), i.t._row_id#3(hidden), i.x#2(hidden), i.x#3(hidden)], pk_columns: [i.t._row_id, i.t._row_id#1, i.x, i.x#1, i.t._row_id#2, i.t._row_id#3, i.x#2, i.x#3] } + StreamMaterialize { columns: [x, i.t._row_id(hidden), i.t._row_id#1(hidden), i.x(hidden), i.x#1(hidden), i.t._row_id#2(hidden), i.t._row_id#3(hidden), i.x#2(hidden), i.x#3(hidden)], pk_columns: [i.t._row_id, i.t._row_id#1, i.x, i.x#1, i.t._row_id#2, i.t._row_id#3, i.x#2, i.x#3], pk_conflict: "no check" } └─StreamExchange { dist: HashShard(i.t._row_id, i.t._row_id, i.x, i.x, i.t._row_id, i.t._row_id, i.x, i.x) } └─StreamProject { exprs: [Coalesce(i.x, i.x) as $expr1, i.t._row_id, i.t._row_id, i.x, i.x, i.t._row_id, i.t._row_id, i.x, i.x] } └─StreamHashJoin { type: FullOuter, predicate: i.x = i.x, output: [i.x, i.x, i.t._row_id, i.t._row_id, i.x, i.t._row_id, i.t._row_id, i.x] } @@ -499,7 +499,7 @@ └─BatchExchange { order: [], dist: HashShard(b.x) } └─BatchScan { table: b, columns: [b.x], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [y, z, $expr156(hidden), a._row_id(hidden), b._row_id(hidden), a.x(hidden), b.x(hidden)], pk_columns: [a._row_id, b._row_id, a.x, b.x], order_descs: [$expr156, a._row_id, b._row_id, a.x, b.x] } + StreamMaterialize { columns: [y, z, $expr156(hidden), a._row_id(hidden), b._row_id(hidden), a.x(hidden), b.x(hidden)], pk_columns: [a._row_id, b._row_id, a.x, b.x], order_descs: [$expr156, a._row_id, b._row_id, a.x, b.x], pk_conflict: "no check" } └─StreamExchange { dist: HashShard(a._row_id, b._row_id, a.x, b.x) } └─StreamProject { exprs: [(2:Int32 * Coalesce(a.x, b.x)) as $expr1, (Coalesce(a.x, b.x) + Coalesce(a.x, b.x)) as $expr2, (Coalesce(a.x, b.x) + Coalesce(a.x, b.x)) as $expr3, a._row_id, b._row_id, a.x, b.x] } └─StreamFilter { predicate: ((2:Int32 * Coalesce(a.x, b.x)) < 10:Int32) } @@ -600,7 +600,7 @@ └─BatchExchange { order: [], dist: HashShard(t2.v2) } └─BatchScan { table: t2, columns: [t2.v2], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [v1, v2, t1._row_id(hidden), $expr29(hidden), t2._row_id(hidden)], pk_columns: [t1._row_id, t2._row_id, $expr29, v2] } + StreamMaterialize { columns: [v1, v2, t1._row_id(hidden), $expr29(hidden), t2._row_id(hidden)], pk_columns: [t1._row_id, t2._row_id, $expr29, v2], pk_conflict: "no check" } └─StreamHashJoin { type: Inner, predicate: $expr1 IS NOT DISTINCT FROM t2.v2, output: [t1.v1, t2.v2, t1._row_id, $expr1, t2._row_id] } ├─StreamExchange { dist: HashShard($expr1) } | └─StreamProject { exprs: [t1.v1, t1.v1::Int64 as $expr1, t1._row_id] } diff --git a/src/frontend/planner_test/tests/testdata/mv_column_name.yaml b/src/frontend/planner_test/tests/testdata/mv_column_name.yaml index d11c80d3d0240..9c8dce79ff211 100644 --- a/src/frontend/planner_test/tests/testdata/mv_column_name.yaml +++ b/src/frontend/planner_test/tests/testdata/mv_column_name.yaml @@ -14,7 +14,7 @@ create table t (a int); select a is null as is_null from t; stream_plan: | - StreamMaterialize { columns: [is_null, t._row_id(hidden)], pk_columns: [t._row_id] } + StreamMaterialize { columns: [is_null, t._row_id(hidden)], pk_columns: [t._row_id], pk_conflict: "no check" } └─StreamProject { exprs: [IsNull(t.a) as $expr1, t._row_id] } └─StreamTableScan { table: t, columns: [t.a, t._row_id], pk: [t._row_id], dist: UpstreamHashShard(t._row_id) } - name: is_true with alias @@ -22,7 +22,7 @@ create table t (a bool); select a, a is true as is_true from t; stream_plan: | - StreamMaterialize { columns: [a, is_true, t._row_id(hidden)], pk_columns: [t._row_id] } + StreamMaterialize { columns: [a, is_true, t._row_id(hidden)], pk_columns: [t._row_id], pk_conflict: "no check" } └─StreamProject { exprs: [t.a, IsTrue(t.a) as $expr1, t._row_id] } └─StreamTableScan { table: t, columns: [t.a, t._row_id], pk: [t._row_id], dist: UpstreamHashShard(t._row_id) } - name: column name specified more than once @@ -53,7 +53,7 @@ create table t (a int); select count(*), max(a) from t; stream_plan: | - StreamMaterialize { columns: [count, max], pk_columns: [] } + StreamMaterialize { columns: [count, max], pk_columns: [], pk_conflict: "no check" } └─StreamProject { exprs: [sum0(count), max(max(t.a))] } └─StreamGlobalSimpleAgg { aggs: [count, sum0(count), max(max(t.a))] } └─StreamExchange { dist: Single } diff --git a/src/frontend/planner_test/tests/testdata/mv_on_mv.yaml b/src/frontend/planner_test/tests/testdata/mv_on_mv.yaml index 8c1a17290a1dd..bc4d8954a83f5 100644 --- a/src/frontend/planner_test/tests/testdata/mv_on_mv.yaml +++ b/src/frontend/planner_test/tests/testdata/mv_on_mv.yaml @@ -11,7 +11,7 @@ sql: | select m1.v1 as m1v1, m1.v2 as m1v2, m2.v1 as m2v1, m2.v2 as m2v2 from m1 join m2 on m1.v1 = m2.v1; stream_plan: | - StreamMaterialize { columns: [m1v1, m1v2, m2v1, m2v2, m1.t1._row_id(hidden), m2.t1._row_id(hidden)], pk_columns: [m1.t1._row_id, m2.t1._row_id, m1v1, m2v1] } + StreamMaterialize { columns: [m1v1, m1v2, m2v1, m2v2, m1.t1._row_id(hidden), m2.t1._row_id(hidden)], pk_columns: [m1.t1._row_id, m2.t1._row_id, m1v1, m2v1], pk_conflict: "no check" } └─StreamHashJoin { type: Inner, predicate: m1.v1 = m2.v1, output: [m1.v1, m1.v2, m2.v1, m2.v2, m1.t1._row_id, m2.t1._row_id] } ├─StreamExchange { dist: HashShard(m1.v1) } | └─StreamTableScan { table: m1, columns: [m1.v1, m1.v2, m1.t1._row_id], pk: [m1.t1._row_id], dist: UpstreamHashShard(m1.t1._row_id) } diff --git a/src/frontend/planner_test/tests/testdata/nexmark.yaml b/src/frontend/planner_test/tests/testdata/nexmark.yaml index 1c98f168e4275..da0b88b308c59 100644 --- a/src/frontend/planner_test/tests/testdata/nexmark.yaml +++ b/src/frontend/planner_test/tests/testdata/nexmark.yaml @@ -43,11 +43,11 @@ BatchExchange { order: [], dist: Single } └─BatchScan { table: bid, columns: [bid.auction, bid.bidder, bid.price, bid.date_time], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [auction, bidder, price, date_time, bid._row_id(hidden)], pk_columns: [bid._row_id] } + StreamMaterialize { columns: [auction, bidder, price, date_time, bid._row_id(hidden)], pk_columns: [bid._row_id], pk_conflict: "no check" } └─StreamTableScan { table: bid, columns: [bid.auction, bid.bidder, bid.price, bid.date_time, bid._row_id], pk: [bid._row_id], dist: UpstreamHashShard(bid._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [auction, bidder, price, date_time, bid._row_id(hidden)], pk_columns: [bid._row_id] } + StreamMaterialize { columns: [auction, bidder, price, date_time, bid._row_id(hidden)], pk_columns: [bid._row_id], pk_conflict: "no check" } materialized table: 4294967294 Chain { table: bid, columns: [bid.auction, bid.bidder, bid.price, bid.date_time, bid._row_id], pk: [bid._row_id], dist: UpstreamHashShard(bid._row_id) } Upstream @@ -69,12 +69,12 @@ └─BatchProject { exprs: [bid.auction, bid.bidder, (0.908:Decimal * bid.price) as $expr1, bid.date_time] } └─BatchScan { table: bid, columns: [bid.auction, bid.bidder, bid.price, bid.date_time], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [auction, bidder, price, date_time, bid._row_id(hidden)], pk_columns: [bid._row_id] } + StreamMaterialize { columns: [auction, bidder, price, date_time, bid._row_id(hidden)], pk_columns: [bid._row_id], pk_conflict: "no check" } └─StreamProject { exprs: [bid.auction, bid.bidder, (0.908:Decimal * bid.price) as $expr1, bid.date_time, bid._row_id] } └─StreamTableScan { table: bid, columns: [bid.auction, bid.bidder, bid.price, bid.date_time, bid._row_id], pk: [bid._row_id], dist: UpstreamHashShard(bid._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [auction, bidder, price, date_time, bid._row_id(hidden)], pk_columns: [bid._row_id] } + StreamMaterialize { columns: [auction, bidder, price, date_time, bid._row_id(hidden)], pk_columns: [bid._row_id], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [bid.auction, bid.bidder, (0.908:Decimal * bid.price) as $expr52, bid.date_time, bid._row_id] } Chain { table: bid, columns: [bid.auction, bid.bidder, bid.price, bid.date_time, bid._row_id], pk: [bid._row_id], dist: UpstreamHashShard(bid._row_id) } @@ -91,12 +91,12 @@ └─BatchFilter { predicate: (((((bid.auction = 1007:Int32) OR (bid.auction = 1020:Int32)) OR (bid.auction = 2001:Int32)) OR (bid.auction = 2019:Int32)) OR (bid.auction = 2087:Int32)) } └─BatchScan { table: bid, columns: [bid.auction, bid.price], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [auction, price, bid._row_id(hidden)], pk_columns: [bid._row_id] } + StreamMaterialize { columns: [auction, price, bid._row_id(hidden)], pk_columns: [bid._row_id], pk_conflict: "no check" } └─StreamFilter { predicate: (((((bid.auction = 1007:Int32) OR (bid.auction = 1020:Int32)) OR (bid.auction = 2001:Int32)) OR (bid.auction = 2019:Int32)) OR (bid.auction = 2087:Int32)) } └─StreamTableScan { table: bid, columns: [bid.auction, bid.price, bid._row_id], pk: [bid._row_id], dist: UpstreamHashShard(bid._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [auction, price, bid._row_id(hidden)], pk_columns: [bid._row_id] } + StreamMaterialize { columns: [auction, price, bid._row_id(hidden)], pk_columns: [bid._row_id], pk_conflict: "no check" } materialized table: 4294967294 StreamFilter { predicate: (((((bid.auction = 1007:Int32) OR (bid.auction = 1020:Int32)) OR (bid.auction = 2001:Int32)) OR (bid.auction = 2019:Int32)) OR (bid.auction = 2087:Int32)) } Chain { table: bid, columns: [bid.auction, bid.price, bid._row_id], pk: [bid._row_id], dist: UpstreamHashShard(bid._row_id) } @@ -122,7 +122,7 @@ └─BatchFilter { predicate: (auction.category = 10:Int32) } └─BatchScan { table: auction, columns: [auction.id, auction.seller, auction.category], distribution: UpstreamHashShard(auction.id) } stream_plan: | - StreamMaterialize { columns: [name, city, state, id, auction.seller(hidden), person.id(hidden)], pk_columns: [id, person.id, auction.seller] } + StreamMaterialize { columns: [name, city, state, id, auction.seller(hidden), person.id(hidden)], pk_columns: [id, person.id, auction.seller], pk_conflict: "no check" } └─StreamHashJoin { type: Inner, predicate: auction.seller = person.id, output: [person.name, person.city, person.state, auction.id, auction.seller, person.id] } ├─StreamExchange { dist: HashShard(auction.seller) } | └─StreamProject { exprs: [auction.id, auction.seller] } @@ -133,7 +133,7 @@ └─StreamTableScan { table: person, columns: [person.id, person.name, person.city, person.state], pk: [person.id], dist: UpstreamHashShard(person.id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [name, city, state, id, auction.seller(hidden), person.id(hidden)], pk_columns: [id, person.id, auction.seller] } + StreamMaterialize { columns: [name, city, state, id, auction.seller(hidden), person.id(hidden)], pk_columns: [id, person.id, auction.seller], pk_conflict: "no check" } materialized table: 4294967294 StreamHashJoin { type: Inner, predicate: auction.seller = person.id, output: [person.name, person.city, person.state, auction.id, auction.seller, person.id] } left table: 0, right table 2, left degree table: 1, right degree table: 3, @@ -186,7 +186,7 @@ └─BatchExchange { order: [], dist: HashShard(bid.auction) } └─BatchScan { table: bid, columns: [bid.auction, bid.price, bid.date_time], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [category, avg], pk_columns: [category] } + StreamMaterialize { columns: [category, avg], pk_columns: [category], pk_conflict: "no check" } └─StreamProject { exprs: [auction.category, (sum(max(bid.price)) / count(max(bid.price))) as $expr1] } └─StreamHashAgg { group_key: [auction.category], aggs: [count, sum(max(bid.price)), count(max(bid.price))] } └─StreamExchange { dist: HashShard(auction.category) } @@ -201,7 +201,7 @@ └─StreamTableScan { table: bid, columns: [bid.auction, bid.price, bid.date_time, bid._row_id], pk: [bid._row_id], dist: UpstreamHashShard(bid._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [category, avg], pk_columns: [category] } + StreamMaterialize { columns: [category, avg], pk_columns: [category], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [auction.category, (sum(max(bid.price)) / count(max(bid.price))) as $expr53] } StreamHashAgg { group_key: [auction.category], aggs: [count, sum(max(bid.price)), count(max(bid.price))] } @@ -288,7 +288,7 @@ └─BatchExchange { order: [], dist: HashShard(bid.auction) } └─BatchScan { table: bid, columns: [bid.auction, bid.date_time], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [auction, num, window_start(hidden), window_start#1(hidden)], pk_columns: [window_start, auction, window_start#1] } + StreamMaterialize { columns: [auction, num, window_start(hidden), window_start#1(hidden)], pk_columns: [window_start, auction, window_start#1], pk_conflict: "no check" } └─StreamProject { exprs: [bid.auction, count, window_start, window_start] } └─StreamFilter { predicate: (count >= max(count)) } └─StreamHashJoin { type: Inner, predicate: window_start = window_start, output: all } @@ -308,7 +308,7 @@ └─StreamTableScan { table: bid, columns: [bid.auction, bid.date_time, bid._row_id], pk: [bid._row_id], dist: UpstreamHashShard(bid._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [auction, num, window_start(hidden), window_start#1(hidden)], pk_columns: [window_start, auction, window_start#1] } + StreamMaterialize { columns: [auction, num, window_start(hidden), window_start#1(hidden)], pk_columns: [window_start, auction, window_start#1], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [bid.auction, count, window_start, window_start] } StreamFilter { predicate: (count >= max(count)) } @@ -408,7 +408,7 @@ └─BatchProject { exprs: [(TumbleStart(bid.date_time, '00:00:10':Interval) + '00:00:10':Interval) as $expr1, bid.price] } └─BatchScan { table: bid, columns: [bid.price, bid.date_time], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [auction, price, bidder, date_time, bid._row_id(hidden), $expr112(hidden), max(bid.price)(hidden)], pk_columns: [bid._row_id, $expr112, price, max(bid.price)] } + StreamMaterialize { columns: [auction, price, bidder, date_time, bid._row_id(hidden), $expr112(hidden), max(bid.price)(hidden)], pk_columns: [bid._row_id, $expr112, price, max(bid.price)], pk_conflict: "no check" } └─StreamProject { exprs: [bid.auction, bid.price, bid.bidder, bid.date_time, bid._row_id, $expr1, max(bid.price)] } └─StreamFilter { predicate: (bid.date_time >= $expr2) AND (bid.date_time <= $expr1) } └─StreamHashJoin { type: Inner, predicate: bid.price = max(bid.price), output: all } @@ -422,7 +422,7 @@ └─StreamTableScan { table: bid, columns: [bid.price, bid.date_time, bid._row_id], pk: [bid._row_id], dist: UpstreamHashShard(bid._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [auction, price, bidder, date_time, bid._row_id(hidden), $expr112(hidden), max(bid.price)(hidden)], pk_columns: [bid._row_id, $expr112, price, max(bid.price)] } + StreamMaterialize { columns: [auction, price, bidder, date_time, bid._row_id(hidden), $expr112(hidden), max(bid.price)(hidden)], pk_columns: [bid._row_id, $expr112, price, max(bid.price)], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [bid.auction, bid.price, bid.bidder, bid.date_time, bid._row_id, $expr112, max(bid.price)] } StreamFilter { predicate: (bid.date_time >= $expr113) AND (bid.date_time <= $expr112) } @@ -502,7 +502,7 @@ └─BatchProject { exprs: [auction.seller, TumbleStart(auction.date_time, '00:00:10':Interval) as $expr3, (TumbleStart(auction.date_time, '00:00:10':Interval) + '00:00:10':Interval) as $expr4] } └─BatchScan { table: auction, columns: [auction.date_time, auction.seller], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [id, name, starttime, $expr214(hidden), auction.seller(hidden), $expr215(hidden), $expr216(hidden)], pk_columns: [id, name, starttime, $expr214, auction.seller, $expr215, $expr216] } + StreamMaterialize { columns: [id, name, starttime, $expr214(hidden), auction.seller(hidden), $expr215(hidden), $expr216(hidden)], pk_columns: [id, name, starttime, $expr214, auction.seller, $expr215, $expr216], pk_conflict: "no check" } └─StreamHashJoin { type: Inner, predicate: person.id = auction.seller AND $expr1 = $expr3 AND $expr2 = $expr4, output: all } ├─StreamExchange { dist: HashShard(person.id, $expr1, $expr2) } | └─StreamProject { exprs: [person.id, person.name, $expr1, $expr2] } @@ -516,7 +516,7 @@ └─StreamTableScan { table: auction, columns: [auction.date_time, auction.seller, auction.id], pk: [auction.id], dist: UpstreamHashShard(auction.id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [id, name, starttime, $expr214(hidden), auction.seller(hidden), $expr215(hidden), $expr216(hidden)], pk_columns: [id, name, starttime, $expr214, auction.seller, $expr215, $expr216] } + StreamMaterialize { columns: [id, name, starttime, $expr214(hidden), auction.seller(hidden), $expr215(hidden), $expr216(hidden)], pk_columns: [id, name, starttime, $expr214, auction.seller, $expr215, $expr216], pk_conflict: "no check" } materialized table: 4294967294 StreamHashJoin { type: Inner, predicate: person.id = auction.seller AND $expr213 = $expr215 AND $expr214 = $expr216, output: all } left table: 0, right table 2, left degree table: 1, right degree table: 3, @@ -588,7 +588,7 @@ └─BatchExchange { order: [], dist: HashShard(bid.auction) } └─BatchScan { table: bid, columns: [bid.auction, bid.bidder, bid.price, bid.channel, bid.url, bid.date_time, bid.extra, bid._row_id], distribution: UpstreamHashShard(bid._row_id) } stream_plan: | - StreamMaterialize { columns: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category, auction, bidder, price, bid_date_time, bid._row_id(hidden)], pk_columns: [id, bid._row_id, auction] } + StreamMaterialize { columns: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category, auction, bidder, price, bid_date_time, bid._row_id(hidden)], pk_columns: [id, bid._row_id, auction], pk_conflict: "no check" } └─StreamProject { exprs: [auction.id, auction.item_name, auction.description, auction.initial_bid, auction.reserve, auction.date_time, auction.expires, auction.seller, auction.category, bid.auction, bid.bidder, bid.price, bid.date_time, bid._row_id] } └─StreamGroupTopN { order: "[bid.price DESC, bid.date_time ASC]", limit: 1, offset: 0, group_key: [0] } └─StreamFilter { predicate: (bid.date_time >= auction.date_time) AND (bid.date_time <= auction.expires) } @@ -599,7 +599,7 @@ └─StreamTableScan { table: bid, columns: [bid.auction, bid.bidder, bid.price, bid.channel, bid.url, bid.date_time, bid.extra, bid._row_id], pk: [bid._row_id], dist: UpstreamHashShard(bid._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category, auction, bidder, price, bid_date_time, bid._row_id(hidden)], pk_columns: [id, bid._row_id, auction] } + StreamMaterialize { columns: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category, auction, bidder, price, bid_date_time, bid._row_id(hidden)], pk_columns: [id, bid._row_id, auction], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [auction.id, auction.item_name, auction.description, auction.initial_bid, auction.reserve, auction.date_time, auction.expires, auction.seller, auction.category, bid.auction, bid.bidder, bid.price, bid.date_time, bid._row_id] } StreamGroupTopN { order: "[bid.price DESC, bid.date_time ASC]", limit: 1, offset: 0, group_key: [0] } @@ -636,12 +636,12 @@ └─BatchProject { exprs: [bid.auction, bid.bidder, bid.price, bid.date_time, ToChar(bid.date_time, 'YYYY-MM-DD':Varchar) as $expr1, ToChar(bid.date_time, 'HH:MI':Varchar) as $expr2] } └─BatchScan { table: bid, columns: [bid.auction, bid.bidder, bid.price, bid.date_time], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [auction, bidder, price, date_time, date, time, bid._row_id(hidden)], pk_columns: [bid._row_id] } + StreamMaterialize { columns: [auction, bidder, price, date_time, date, time, bid._row_id(hidden)], pk_columns: [bid._row_id], pk_conflict: "no check" } └─StreamProject { exprs: [bid.auction, bid.bidder, bid.price, bid.date_time, ToChar(bid.date_time, 'YYYY-MM-DD':Varchar) as $expr1, ToChar(bid.date_time, 'HH:MI':Varchar) as $expr2, bid._row_id] } └─StreamTableScan { table: bid, columns: [bid.auction, bid.bidder, bid.price, bid.date_time, bid._row_id], pk: [bid._row_id], dist: UpstreamHashShard(bid._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [auction, bidder, price, date_time, date, time, bid._row_id(hidden)], pk_columns: [bid._row_id] } + StreamMaterialize { columns: [auction, bidder, price, date_time, date, time, bid._row_id(hidden)], pk_columns: [bid._row_id], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [bid.auction, bid.bidder, bid.price, bid.date_time, ToChar(bid.date_time, 'YYYY-MM-DD':Varchar) as $expr103, ToChar(bid.date_time, 'HH:MI':Varchar) as $expr104, bid._row_id] } Chain { table: bid, columns: [bid.auction, bid.bidder, bid.price, bid.date_time, bid._row_id], pk: [bid._row_id], dist: UpstreamHashShard(bid._row_id) } @@ -724,13 +724,13 @@ └─BatchFilter { predicate: ((0.908:Decimal * bid.price) > 1000000:Int32) AND ((0.908:Decimal * bid.price) < 50000000:Int32) } └─BatchScan { table: bid, columns: [bid.auction, bid.bidder, bid.price, bid.date_time, bid.extra], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [auction, bidder, price, bidtimetype, date_time, extra, bid._row_id(hidden)], pk_columns: [bid._row_id] } + StreamMaterialize { columns: [auction, bidder, price, bidtimetype, date_time, extra, bid._row_id(hidden)], pk_columns: [bid._row_id], pk_conflict: "no check" } └─StreamProject { exprs: [bid.auction, bid.bidder, (0.908:Decimal * bid.price) as $expr1, Case(((Extract('HOUR':Varchar, bid.date_time) >= 8:Int32) AND (Extract('HOUR':Varchar, bid.date_time) <= 18:Int32)), 'dayTime':Varchar, ((Extract('HOUR':Varchar, bid.date_time) <= 6:Int32) OR (Extract('HOUR':Varchar, bid.date_time) >= 20:Int32)), 'nightTime':Varchar, 'otherTime':Varchar) as $expr2, bid.date_time, bid.extra, bid._row_id] } └─StreamFilter { predicate: ((0.908:Decimal * bid.price) > 1000000:Int32) AND ((0.908:Decimal * bid.price) < 50000000:Int32) } └─StreamTableScan { table: bid, columns: [bid.auction, bid.bidder, bid.price, bid.date_time, bid.extra, bid._row_id], pk: [bid._row_id], dist: UpstreamHashShard(bid._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [auction, bidder, price, bidtimetype, date_time, extra, bid._row_id(hidden)], pk_columns: [bid._row_id] } + StreamMaterialize { columns: [auction, bidder, price, bidtimetype, date_time, extra, bid._row_id(hidden)], pk_columns: [bid._row_id], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [bid.auction, bid.bidder, (0.908:Decimal * bid.price) as $expr103, Case(((Extract('HOUR':Varchar, bid.date_time) >= 8:Int32) AND (Extract('HOUR':Varchar, bid.date_time) <= 18:Int32)), 'dayTime':Varchar, ((Extract('HOUR':Varchar, bid.date_time) <= 6:Int32) OR (Extract('HOUR':Varchar, bid.date_time) >= 20:Int32)), 'nightTime':Varchar, 'otherTime':Varchar) as $expr104, bid.date_time, bid.extra, bid._row_id] } StreamFilter { predicate: ((0.908:Decimal * bid.price) > 1000000:Int32) AND ((0.908:Decimal * bid.price) < 50000000:Int32) } @@ -770,7 +770,7 @@ └─BatchProject { exprs: [ToChar(bid.date_time, 'yyyy-MM-dd':Varchar) as $expr1, bid.price, bid.bidder, bid.auction] } └─BatchScan { table: bid, columns: [bid.auction, bid.bidder, bid.price, bid.date_time], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [day, total_bids, rank1_bids, rank2_bids, rank3_bids, total_bidders, rank1_bidders, rank2_bidders, rank3_bidders, total_auctions, rank1_auctions, rank2_auctions, rank3_auctions], pk_columns: [day] } + StreamMaterialize { columns: [day, total_bids, rank1_bids, rank2_bids, rank3_bids, total_bidders, rank1_bidders, rank2_bidders, rank3_bidders, total_auctions, rank1_auctions, rank2_auctions, rank3_auctions], pk_columns: [day], pk_conflict: "no check" } └─StreamProject { exprs: [$expr1, sum0(count) filter((flag = 0:Int64)), sum0(count filter((bid.price < 10000:Int32))) filter((flag = 0:Int64)), sum0(count filter((bid.price >= 10000:Int32) AND (bid.price < 1000000:Int32))) filter((flag = 0:Int64)), sum0(count filter((bid.price >= 1000000:Int32))) filter((flag = 0:Int64)), count(bid.bidder) filter((flag = 1:Int64)), count(bid.bidder) filter((count filter((bid.price < 10000:Int32)) > 0:Int64) AND (flag = 1:Int64)), count(bid.bidder) filter((count filter((bid.price >= 10000:Int32) AND (bid.price < 1000000:Int32)) > 0:Int64) AND (flag = 1:Int64)), count(bid.bidder) filter((count filter((bid.price >= 1000000:Int32)) > 0:Int64) AND (flag = 1:Int64)), count(bid.auction) filter((flag = 2:Int64)), count(bid.auction) filter((count filter((bid.price < 10000:Int32)) > 0:Int64) AND (flag = 2:Int64)), count(bid.auction) filter((count filter((bid.price >= 10000:Int32) AND (bid.price < 1000000:Int32)) > 0:Int64) AND (flag = 2:Int64)), count(bid.auction) filter((count filter((bid.price >= 1000000:Int32)) > 0:Int64) AND (flag = 2:Int64))] } └─StreamHashAgg { group_key: [$expr1], aggs: [count, sum0(count) filter((flag = 0:Int64)), sum0(count filter((bid.price < 10000:Int32))) filter((flag = 0:Int64)), sum0(count filter((bid.price >= 10000:Int32) AND (bid.price < 1000000:Int32))) filter((flag = 0:Int64)), sum0(count filter((bid.price >= 1000000:Int32))) filter((flag = 0:Int64)), count(bid.bidder) filter((flag = 1:Int64)), count(bid.bidder) filter((count filter((bid.price < 10000:Int32)) > 0:Int64) AND (flag = 1:Int64)), count(bid.bidder) filter((count filter((bid.price >= 10000:Int32) AND (bid.price < 1000000:Int32)) > 0:Int64) AND (flag = 1:Int64)), count(bid.bidder) filter((count filter((bid.price >= 1000000:Int32)) > 0:Int64) AND (flag = 1:Int64)), count(bid.auction) filter((flag = 2:Int64)), count(bid.auction) filter((count filter((bid.price < 10000:Int32)) > 0:Int64) AND (flag = 2:Int64)), count(bid.auction) filter((count filter((bid.price >= 10000:Int32) AND (bid.price < 1000000:Int32)) > 0:Int64) AND (flag = 2:Int64)), count(bid.auction) filter((count filter((bid.price >= 1000000:Int32)) > 0:Int64) AND (flag = 2:Int64))] } └─StreamExchange { dist: HashShard($expr1) } @@ -782,7 +782,7 @@ └─StreamTableScan { table: bid, columns: [bid.auction, bid.bidder, bid.price, bid.date_time, bid._row_id], pk: [bid._row_id], dist: UpstreamHashShard(bid._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [day, total_bids, rank1_bids, rank2_bids, rank3_bids, total_bidders, rank1_bidders, rank2_bidders, rank3_bidders, total_auctions, rank1_auctions, rank2_auctions, rank3_auctions], pk_columns: [day] } + StreamMaterialize { columns: [day, total_bids, rank1_bids, rank2_bids, rank3_bids, total_bidders, rank1_bidders, rank2_bidders, rank3_bidders, total_auctions, rank1_auctions, rank2_auctions, rank3_auctions], pk_columns: [day], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [$expr52, sum0(count) filter((flag = 0:Int64)), sum0(count filter((bid.price < 10000:Int32))) filter((flag = 0:Int64)), sum0(count filter((bid.price >= 10000:Int32) AND (bid.price < 1000000:Int32))) filter((flag = 0:Int64)), sum0(count filter((bid.price >= 1000000:Int32))) filter((flag = 0:Int64)), count(bid.bidder) filter((flag = 1:Int64)), count(bid.bidder) filter((count filter((bid.price < 10000:Int32)) > 0:Int64) AND (flag = 1:Int64)), count(bid.bidder) filter((count filter((bid.price >= 10000:Int32) AND (bid.price < 1000000:Int32)) > 0:Int64) AND (flag = 1:Int64)), count(bid.bidder) filter((count filter((bid.price >= 1000000:Int32)) > 0:Int64) AND (flag = 1:Int64)), count(bid.auction) filter((flag = 2:Int64)), count(bid.auction) filter((count filter((bid.price < 10000:Int32)) > 0:Int64) AND (flag = 2:Int64)), count(bid.auction) filter((count filter((bid.price >= 10000:Int32) AND (bid.price < 1000000:Int32)) > 0:Int64) AND (flag = 2:Int64)), count(bid.auction) filter((count filter((bid.price >= 1000000:Int32)) > 0:Int64) AND (flag = 2:Int64))] } StreamHashAgg { group_key: [$expr52], aggs: [count, sum0(count) filter((flag = 0:Int64)), sum0(count filter((bid.price < 10000:Int32))) filter((flag = 0:Int64)), sum0(count filter((bid.price >= 10000:Int32) AND (bid.price < 1000000:Int32))) filter((flag = 0:Int64)), sum0(count filter((bid.price >= 1000000:Int32))) filter((flag = 0:Int64)), count(bid.bidder) filter((flag = 1:Int64)), count(bid.bidder) filter((count filter((bid.price < 10000:Int32)) > 0:Int64) AND (flag = 1:Int64)), count(bid.bidder) filter((count filter((bid.price >= 10000:Int32) AND (bid.price < 1000000:Int32)) > 0:Int64) AND (flag = 1:Int64)), count(bid.bidder) filter((count filter((bid.price >= 1000000:Int32)) > 0:Int64) AND (flag = 1:Int64)), count(bid.auction) filter((flag = 2:Int64)), count(bid.auction) filter((count filter((bid.price < 10000:Int32)) > 0:Int64) AND (flag = 2:Int64)), count(bid.auction) filter((count filter((bid.price >= 10000:Int32) AND (bid.price < 1000000:Int32)) > 0:Int64) AND (flag = 2:Int64)), count(bid.auction) filter((count filter((bid.price >= 1000000:Int32)) > 0:Int64) AND (flag = 2:Int64))] } @@ -838,7 +838,7 @@ └─BatchProject { exprs: [bid.channel, ToChar(bid.date_time, 'yyyy-MM-dd':Varchar) as $expr1, ToChar(bid.date_time, 'HH:mm':Varchar) as $expr2, bid.price, bid.bidder, bid.auction] } └─BatchScan { table: bid, columns: [bid.auction, bid.bidder, bid.price, bid.channel, bid.date_time], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [channel, day, minute, total_bids, rank1_bids, rank2_bids, rank3_bids, total_bidders, rank1_bidders, rank2_bidders, rank3_bidders, total_auctions, rank1_auctions, rank2_auctions, rank3_auctions], pk_columns: [channel, day] } + StreamMaterialize { columns: [channel, day, minute, total_bids, rank1_bids, rank2_bids, rank3_bids, total_bidders, rank1_bidders, rank2_bidders, rank3_bidders, total_auctions, rank1_auctions, rank2_auctions, rank3_auctions], pk_columns: [channel, day], pk_conflict: "no check" } └─StreamProject { exprs: [bid.channel, $expr1, max(max($expr2)) filter((flag = 0:Int64)), sum0(count) filter((flag = 0:Int64)), sum0(count filter((bid.price < 10000:Int32))) filter((flag = 0:Int64)), sum0(count filter((bid.price >= 10000:Int32) AND (bid.price < 1000000:Int32))) filter((flag = 0:Int64)), sum0(count filter((bid.price >= 1000000:Int32))) filter((flag = 0:Int64)), count(bid.bidder) filter((flag = 1:Int64)), count(bid.bidder) filter((count filter((bid.price < 10000:Int32)) > 0:Int64) AND (flag = 1:Int64)), count(bid.bidder) filter((count filter((bid.price >= 10000:Int32) AND (bid.price < 1000000:Int32)) > 0:Int64) AND (flag = 1:Int64)), count(bid.bidder) filter((count filter((bid.price >= 1000000:Int32)) > 0:Int64) AND (flag = 1:Int64)), count(bid.auction) filter((flag = 2:Int64)), count(bid.auction) filter((count filter((bid.price < 10000:Int32)) > 0:Int64) AND (flag = 2:Int64)), count(bid.auction) filter((count filter((bid.price >= 10000:Int32) AND (bid.price < 1000000:Int32)) > 0:Int64) AND (flag = 2:Int64)), count(bid.auction) filter((count filter((bid.price >= 1000000:Int32)) > 0:Int64) AND (flag = 2:Int64))] } └─StreamHashAgg { group_key: [bid.channel, $expr1], aggs: [count, max(max($expr2)) filter((flag = 0:Int64)), sum0(count) filter((flag = 0:Int64)), sum0(count filter((bid.price < 10000:Int32))) filter((flag = 0:Int64)), sum0(count filter((bid.price >= 10000:Int32) AND (bid.price < 1000000:Int32))) filter((flag = 0:Int64)), sum0(count filter((bid.price >= 1000000:Int32))) filter((flag = 0:Int64)), count(bid.bidder) filter((flag = 1:Int64)), count(bid.bidder) filter((count filter((bid.price < 10000:Int32)) > 0:Int64) AND (flag = 1:Int64)), count(bid.bidder) filter((count filter((bid.price >= 10000:Int32) AND (bid.price < 1000000:Int32)) > 0:Int64) AND (flag = 1:Int64)), count(bid.bidder) filter((count filter((bid.price >= 1000000:Int32)) > 0:Int64) AND (flag = 1:Int64)), count(bid.auction) filter((flag = 2:Int64)), count(bid.auction) filter((count filter((bid.price < 10000:Int32)) > 0:Int64) AND (flag = 2:Int64)), count(bid.auction) filter((count filter((bid.price >= 10000:Int32) AND (bid.price < 1000000:Int32)) > 0:Int64) AND (flag = 2:Int64)), count(bid.auction) filter((count filter((bid.price >= 1000000:Int32)) > 0:Int64) AND (flag = 2:Int64))] } └─StreamExchange { dist: HashShard(bid.channel, $expr1) } @@ -850,7 +850,7 @@ └─StreamTableScan { table: bid, columns: [bid.auction, bid.bidder, bid.price, bid.channel, bid.date_time, bid._row_id], pk: [bid._row_id], dist: UpstreamHashShard(bid._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [channel, day, minute, total_bids, rank1_bids, rank2_bids, rank3_bids, total_bidders, rank1_bidders, rank2_bidders, rank3_bidders, total_auctions, rank1_auctions, rank2_auctions, rank3_auctions], pk_columns: [channel, day] } + StreamMaterialize { columns: [channel, day, minute, total_bids, rank1_bids, rank2_bids, rank3_bids, total_bidders, rank1_bidders, rank2_bidders, rank3_bidders, total_auctions, rank1_auctions, rank2_auctions, rank3_auctions], pk_columns: [channel, day], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [bid.channel, $expr103, max(max($expr104)) filter((flag = 0:Int64)), sum0(count) filter((flag = 0:Int64)), sum0(count filter((bid.price < 10000:Int32))) filter((flag = 0:Int64)), sum0(count filter((bid.price >= 10000:Int32) AND (bid.price < 1000000:Int32))) filter((flag = 0:Int64)), sum0(count filter((bid.price >= 1000000:Int32))) filter((flag = 0:Int64)), count(bid.bidder) filter((flag = 1:Int64)), count(bid.bidder) filter((count filter((bid.price < 10000:Int32)) > 0:Int64) AND (flag = 1:Int64)), count(bid.bidder) filter((count filter((bid.price >= 10000:Int32) AND (bid.price < 1000000:Int32)) > 0:Int64) AND (flag = 1:Int64)), count(bid.bidder) filter((count filter((bid.price >= 1000000:Int32)) > 0:Int64) AND (flag = 1:Int64)), count(bid.auction) filter((flag = 2:Int64)), count(bid.auction) filter((count filter((bid.price < 10000:Int32)) > 0:Int64) AND (flag = 2:Int64)), count(bid.auction) filter((count filter((bid.price >= 10000:Int32) AND (bid.price < 1000000:Int32)) > 0:Int64) AND (flag = 2:Int64)), count(bid.auction) filter((count filter((bid.price >= 1000000:Int32)) > 0:Int64) AND (flag = 2:Int64))] } StreamHashAgg { group_key: [bid.channel, $expr103], aggs: [count, max(max($expr104)) filter((flag = 0:Int64)), sum0(count) filter((flag = 0:Int64)), sum0(count filter((bid.price < 10000:Int32))) filter((flag = 0:Int64)), sum0(count filter((bid.price >= 10000:Int32) AND (bid.price < 1000000:Int32))) filter((flag = 0:Int64)), sum0(count filter((bid.price >= 1000000:Int32))) filter((flag = 0:Int64)), count(bid.bidder) filter((flag = 1:Int64)), count(bid.bidder) filter((count filter((bid.price < 10000:Int32)) > 0:Int64) AND (flag = 1:Int64)), count(bid.bidder) filter((count filter((bid.price >= 10000:Int32) AND (bid.price < 1000000:Int32)) > 0:Int64) AND (flag = 1:Int64)), count(bid.bidder) filter((count filter((bid.price >= 1000000:Int32)) > 0:Int64) AND (flag = 1:Int64)), count(bid.auction) filter((flag = 2:Int64)), count(bid.auction) filter((count filter((bid.price < 10000:Int32)) > 0:Int64) AND (flag = 2:Int64)), count(bid.auction) filter((count filter((bid.price >= 10000:Int32) AND (bid.price < 1000000:Int32)) > 0:Int64) AND (flag = 2:Int64)), count(bid.auction) filter((count filter((bid.price >= 1000000:Int32)) > 0:Int64) AND (flag = 2:Int64))] } @@ -899,7 +899,7 @@ └─BatchProject { exprs: [bid.auction, ToChar(bid.date_time, 'YYYY-MM-DD':Varchar) as $expr1, bid.price] } └─BatchScan { table: bid, columns: [bid.auction, bid.price, bid.date_time], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [auction, day, total_bids, rank1_bids, rank2_bids, rank3_bids, min_price, max_price, avg_price, sum_price], pk_columns: [auction, day] } + StreamMaterialize { columns: [auction, day, total_bids, rank1_bids, rank2_bids, rank3_bids, min_price, max_price, avg_price, sum_price], pk_columns: [auction, day], pk_conflict: "no check" } └─StreamProject { exprs: [bid.auction, $expr1, count, count filter((bid.price < 10000:Int32)), count filter((bid.price >= 10000:Int32) AND (bid.price < 1000000:Int32)), count filter((bid.price >= 1000000:Int32)), min(bid.price), max(bid.price), (sum(bid.price) / count(bid.price)) as $expr2, sum(bid.price)] } └─StreamAppendOnlyHashAgg { group_key: [bid.auction, $expr1], aggs: [count, count, count filter((bid.price < 10000:Int32)), count filter((bid.price >= 10000:Int32) AND (bid.price < 1000000:Int32)), count filter((bid.price >= 1000000:Int32)), min(bid.price), max(bid.price), sum(bid.price), count(bid.price), sum(bid.price)] } └─StreamExchange { dist: HashShard(bid.auction, $expr1) } @@ -907,7 +907,7 @@ └─StreamTableScan { table: bid, columns: [bid.auction, bid.price, bid.date_time, bid._row_id], pk: [bid._row_id], dist: UpstreamHashShard(bid._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [auction, day, total_bids, rank1_bids, rank2_bids, rank3_bids, min_price, max_price, avg_price, sum_price], pk_columns: [auction, day] } + StreamMaterialize { columns: [auction, day, total_bids, rank1_bids, rank2_bids, rank3_bids, min_price, max_price, avg_price, sum_price], pk_columns: [auction, day], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [bid.auction, $expr104, count, count filter((bid.price < 10000:Int32)), count filter((bid.price >= 10000:Int32) AND (bid.price < 1000000:Int32)), count filter((bid.price >= 1000000:Int32)), min(bid.price), max(bid.price), (sum(bid.price) / count(bid.price)) as $expr105, sum(bid.price)] } StreamAppendOnlyHashAgg { group_key: [bid.auction, $expr104], aggs: [count, count, count filter((bid.price < 10000:Int32)), count filter((bid.price >= 10000:Int32) AND (bid.price < 1000000:Int32)), count filter((bid.price >= 1000000:Int32)), min(bid.price), max(bid.price), sum(bid.price), count(bid.price), sum(bid.price)] } @@ -943,7 +943,7 @@ └─BatchExchange { order: [], dist: HashShard(bid.bidder, bid.auction) } └─BatchScan { table: bid, columns: [bid.auction, bid.bidder, bid.price, bid.channel, bid.url, bid.date_time, bid.extra, bid._row_id], distribution: UpstreamHashShard(bid._row_id) } stream_plan: | - StreamMaterialize { columns: [auction, bidder, price, channel, url, date_time, extra, bid._row_id(hidden)], pk_columns: [bid._row_id] } + StreamMaterialize { columns: [auction, bidder, price, channel, url, date_time, extra, bid._row_id(hidden)], pk_columns: [bid._row_id], pk_conflict: "no check" } └─StreamExchange { dist: HashShard(bid._row_id) } └─StreamProject { exprs: [bid.auction, bid.bidder, bid.price, bid.channel, bid.url, bid.date_time, bid.extra, bid._row_id] } └─StreamAppendOnlyGroupTopN { order: "[bid.date_time DESC]", limit: 1, offset: 0, group_key: [1, 0] } @@ -951,7 +951,7 @@ └─StreamTableScan { table: bid, columns: [bid.auction, bid.bidder, bid.price, bid.channel, bid.url, bid.date_time, bid.extra, bid._row_id], pk: [bid._row_id], dist: UpstreamHashShard(bid._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [auction, bidder, price, channel, url, date_time, extra, bid._row_id(hidden)], pk_columns: [bid._row_id] } + StreamMaterialize { columns: [auction, bidder, price, channel, url, date_time, extra, bid._row_id(hidden)], pk_columns: [bid._row_id], pk_conflict: "no check" } materialized table: 4294967294 StreamExchange Hash([7]) from 1 @@ -1003,7 +1003,7 @@ └─BatchExchange { order: [], dist: UpstreamHashShard(bid.auction) } └─BatchScan { table: bid, columns: [bid.auction, bid.bidder, bid.price, bid.channel, bid.url, bid.date_time], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [auction, bidder, price, channel, url, date_timeb, item_name, description, initial_bid, reserve, date_timea, expires, seller, category, bid._row_id(hidden), auction.id(hidden)], pk_columns: [bid._row_id, auction.id, auction] } + StreamMaterialize { columns: [auction, bidder, price, channel, url, date_timeb, item_name, description, initial_bid, reserve, date_timea, expires, seller, category, bid._row_id(hidden), auction.id(hidden)], pk_columns: [bid._row_id, auction.id, auction], pk_conflict: "no check" } └─StreamHashJoin { type: Inner, predicate: bid.auction = auction.id, output: [bid.auction, bid.bidder, bid.price, bid.channel, bid.url, bid.date_time, auction.item_name, auction.description, auction.initial_bid, auction.reserve, auction.date_time, auction.expires, auction.seller, auction.category, bid._row_id, auction.id] } ├─StreamExchange { dist: HashShard(bid.auction) } | └─StreamTableScan { table: bid, columns: [bid.auction, bid.bidder, bid.price, bid.channel, bid.url, bid.date_time, bid._row_id], pk: [bid._row_id], dist: UpstreamHashShard(bid._row_id) } @@ -1012,7 +1012,7 @@ └─StreamTableScan { table: auction, columns: [auction.id, auction.item_name, auction.description, auction.initial_bid, auction.reserve, auction.date_time, auction.expires, auction.seller, auction.category], pk: [auction.id], dist: UpstreamHashShard(auction.id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [auction, bidder, price, channel, url, date_timeb, item_name, description, initial_bid, reserve, date_timea, expires, seller, category, bid._row_id(hidden), auction.id(hidden)], pk_columns: [bid._row_id, auction.id, auction] } + StreamMaterialize { columns: [auction, bidder, price, channel, url, date_timeb, item_name, description, initial_bid, reserve, date_timea, expires, seller, category, bid._row_id(hidden), auction.id(hidden)], pk_columns: [bid._row_id, auction.id, auction], pk_conflict: "no check" } materialized table: 4294967294 StreamHashJoin { type: Inner, predicate: bid.auction = auction.id, output: [bid.auction, bid.bidder, bid.price, bid.channel, bid.url, bid.date_time, auction.item_name, auction.description, auction.initial_bid, auction.reserve, auction.date_time, auction.expires, auction.seller, auction.category, bid._row_id, auction.id] } left table: 0, right table 2, left degree table: 1, right degree table: 3, @@ -1068,12 +1068,12 @@ └─BatchProject { exprs: [bid.auction, bid.bidder, bid.price, bid.channel, SplitPart(bid.url, '/':Varchar, 4:Int32) as $expr1, SplitPart(bid.url, '/':Varchar, 5:Int32) as $expr2, SplitPart(bid.url, '/':Varchar, 6:Int32) as $expr3] } └─BatchScan { table: bid, columns: [bid.auction, bid.bidder, bid.price, bid.channel, bid.url], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [auction, bidder, price, channel, dir1, dir2, dir3, bid._row_id(hidden)], pk_columns: [bid._row_id] } + StreamMaterialize { columns: [auction, bidder, price, channel, dir1, dir2, dir3, bid._row_id(hidden)], pk_columns: [bid._row_id], pk_conflict: "no check" } └─StreamProject { exprs: [bid.auction, bid.bidder, bid.price, bid.channel, SplitPart(bid.url, '/':Varchar, 4:Int32) as $expr1, SplitPart(bid.url, '/':Varchar, 5:Int32) as $expr2, SplitPart(bid.url, '/':Varchar, 6:Int32) as $expr3, bid._row_id] } └─StreamTableScan { table: bid, columns: [bid.auction, bid.bidder, bid.price, bid.channel, bid.url, bid._row_id], pk: [bid._row_id], dist: UpstreamHashShard(bid._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [auction, bidder, price, channel, dir1, dir2, dir3, bid._row_id(hidden)], pk_columns: [bid._row_id] } + StreamMaterialize { columns: [auction, bidder, price, channel, dir1, dir2, dir3, bid._row_id(hidden)], pk_columns: [bid._row_id], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [bid.auction, bid.bidder, bid.price, bid.channel, SplitPart(bid.url, '/':Varchar, 4:Int32) as $expr154, SplitPart(bid.url, '/':Varchar, 5:Int32) as $expr155, SplitPart(bid.url, '/':Varchar, 6:Int32) as $expr156, bid._row_id] } Chain { table: bid, columns: [bid.auction, bid.bidder, bid.price, bid.channel, bid.url, bid._row_id], pk: [bid._row_id], dist: UpstreamHashShard(bid._row_id) } @@ -1110,7 +1110,7 @@ └─BatchExchange { order: [], dist: HashShard(bid.auction) } └─BatchScan { table: bid, columns: [bid.auction, bid.price], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [auction_id, auction_item_name, current_highest_bid, bid.auction(hidden)], pk_columns: [auction_id, bid.auction] } + StreamMaterialize { columns: [auction_id, auction_item_name, current_highest_bid, bid.auction(hidden)], pk_columns: [auction_id, bid.auction], pk_conflict: "no check" } └─StreamHashJoin { type: LeftOuter, predicate: auction.id = bid.auction, output: [auction.id, auction.item_name, max(bid.price), bid.auction] } ├─StreamExchange { dist: HashShard(auction.id) } | └─StreamTableScan { table: auction, columns: [auction.id, auction.item_name], pk: [auction.id], dist: UpstreamHashShard(auction.id) } @@ -1120,7 +1120,7 @@ └─StreamTableScan { table: bid, columns: [bid.auction, bid.price, bid._row_id], pk: [bid._row_id], dist: UpstreamHashShard(bid._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [auction_id, auction_item_name, current_highest_bid, bid.auction(hidden)], pk_columns: [auction_id, bid.auction] } + StreamMaterialize { columns: [auction_id, auction_item_name, current_highest_bid, bid.auction(hidden)], pk_columns: [auction_id, bid.auction], pk_conflict: "no check" } materialized table: 4294967294 StreamHashJoin { type: LeftOuter, predicate: auction.id = bid.auction, output: [auction.id, auction.item_name, max(bid.price), bid.auction] } left table: 0, right table 2, left degree table: 1, right degree table: 3, @@ -1180,7 +1180,7 @@ └─BatchExchange { order: [], dist: HashShard(bid.auction) } └─BatchScan { table: bid, columns: [bid.auction], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [auction_id, auction_item_name, bid_count], pk_columns: [auction_id, auction_item_name] } + StreamMaterialize { columns: [auction_id, auction_item_name, bid_count], pk_columns: [auction_id, auction_item_name], pk_conflict: "no check" } └─StreamProject { exprs: [auction.id, auction.item_name, count(bid.auction)] } └─StreamDynamicFilter { predicate: (count(bid.auction) >= $expr1), output: [auction.id, auction.item_name, count(bid.auction), count(bid.auction)] } ├─StreamProject { exprs: [auction.id, auction.item_name, count(bid.auction), count(bid.auction)] } @@ -1200,7 +1200,7 @@ └─StreamTableScan { table: bid, columns: [bid.auction, bid._row_id], pk: [bid._row_id], dist: UpstreamHashShard(bid._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [auction_id, auction_item_name, bid_count], pk_columns: [auction_id, auction_item_name] } + StreamMaterialize { columns: [auction_id, auction_item_name, bid_count], pk_columns: [auction_id, auction_item_name], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [auction.id, auction.item_name, count(bid.auction)] } StreamDynamicFilter { predicate: (count(bid.auction) >= $expr53), output: [auction.id, auction.item_name, count(bid.auction), count(bid.auction)] } @@ -1278,7 +1278,7 @@ └─BatchExchange { order: [], dist: HashShard(bid.auction) } └─BatchScan { table: bid, columns: [bid.auction], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [auction_id, auction_item_name], pk_columns: [auction_id] } + StreamMaterialize { columns: [auction_id, auction_item_name], pk_columns: [auction_id], pk_conflict: "no check" } └─StreamHashJoin { type: LeftSemi, predicate: auction.id = bid.auction, output: all } ├─StreamExchange { dist: HashShard(auction.id) } | └─StreamTableScan { table: auction, columns: [auction.id, auction.item_name], pk: [auction.id], dist: UpstreamHashShard(auction.id) } @@ -1290,7 +1290,7 @@ └─StreamTableScan { table: bid, columns: [bid.auction, bid._row_id], pk: [bid._row_id], dist: UpstreamHashShard(bid._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [auction_id, auction_item_name], pk_columns: [auction_id] } + StreamMaterialize { columns: [auction_id, auction_item_name], pk_columns: [auction_id], pk_conflict: "no check" } materialized table: 4294967294 StreamHashJoin { type: LeftSemi, predicate: auction.id = bid.auction, output: all } left table: 0, right table 2, left degree table: 1, right degree table: 3, @@ -1345,7 +1345,7 @@ └─BatchExchange { order: [], dist: HashShard(bid.auction) } └─BatchScan { table: bid, columns: [bid.auction], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [auction_id, auction_item_name], pk_columns: [auction_id] } + StreamMaterialize { columns: [auction_id, auction_item_name], pk_columns: [auction_id], pk_conflict: "no check" } └─StreamHashJoin { type: LeftAnti, predicate: auction.id = bid.auction, output: all } ├─StreamExchange { dist: HashShard(auction.id) } | └─StreamTableScan { table: auction, columns: [auction.id, auction.item_name], pk: [auction.id], dist: UpstreamHashShard(auction.id) } @@ -1357,7 +1357,7 @@ └─StreamTableScan { table: bid, columns: [bid.auction, bid._row_id], pk: [bid._row_id], dist: UpstreamHashShard(bid._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [auction_id, auction_item_name], pk_columns: [auction_id] } + StreamMaterialize { columns: [auction_id, auction_item_name], pk_columns: [auction_id], pk_conflict: "no check" } materialized table: 4294967294 StreamHashJoin { type: LeftAnti, predicate: auction.id = bid.auction, output: all } left table: 0, right table 2, left degree table: 1, right degree table: 3, @@ -1412,7 +1412,7 @@ └─BatchExchange { order: [], dist: HashShard(bid.auction) } └─BatchScan { table: bid, columns: [bid.auction], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [auction_id, auction_item_name, bid_count], pk_columns: [auction_id, auction_item_name], order_descs: [bid_count, auction_id, auction_item_name] } + StreamMaterialize { columns: [auction_id, auction_item_name, bid_count], pk_columns: [auction_id, auction_item_name], order_descs: [bid_count, auction_id, auction_item_name], pk_conflict: "no check" } └─StreamProject { exprs: [auction.id, auction.item_name, count(bid.auction)] } └─StreamTopN { order: "[count(bid.auction) DESC]", limit: 1000, offset: 0 } └─StreamExchange { dist: Single } @@ -1427,7 +1427,7 @@ └─StreamTableScan { table: bid, columns: [bid.auction, bid._row_id], pk: [bid._row_id], dist: UpstreamHashShard(bid._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [auction_id, auction_item_name, bid_count], pk_columns: [auction_id, auction_item_name], order_descs: [bid_count, auction_id, auction_item_name] } + StreamMaterialize { columns: [auction_id, auction_item_name, bid_count], pk_columns: [auction_id, auction_item_name], order_descs: [bid_count, auction_id, auction_item_name], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [auction.id, auction.item_name, count(bid.auction)] } StreamTopN { order: "[count(bid.auction) DESC]", limit: 1000, offset: 0 } diff --git a/src/frontend/planner_test/tests/testdata/nexmark_source.yaml b/src/frontend/planner_test/tests/testdata/nexmark_source.yaml index a1ec0d8bcefd7..00e6eb4ca6074 100644 --- a/src/frontend/planner_test/tests/testdata/nexmark_source.yaml +++ b/src/frontend/planner_test/tests/testdata/nexmark_source.yaml @@ -51,14 +51,14 @@ └─BatchProject { exprs: [auction, bidder, price, date_time] } └─BatchSource { source: "bid", columns: ["auction", "bidder", "price", "channel", "url", "date_time", "extra", "_row_id"], filter: (None, None) } stream_plan: | - StreamMaterialize { columns: [auction, bidder, price, date_time, _row_id(hidden)], pk_columns: [_row_id] } + StreamMaterialize { columns: [auction, bidder, price, date_time, _row_id(hidden)], pk_columns: [_row_id], pk_conflict: "no check" } └─StreamExchange { dist: HashShard(_row_id) } └─StreamProject { exprs: [auction, bidder, price, date_time, _row_id] } └─StreamRowIdGen { row_id_index: 7 } └─StreamSource { source: "bid", columns: ["auction", "bidder", "price", "channel", "url", "date_time", "extra", "_row_id"] } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [auction, bidder, price, date_time, _row_id(hidden)], pk_columns: [_row_id] } + StreamMaterialize { columns: [auction, bidder, price, date_time, _row_id(hidden)], pk_columns: [_row_id], pk_conflict: "no check" } materialized table: 4294967294 StreamExchange Hash([4]) from 1 @@ -85,14 +85,14 @@ └─BatchProject { exprs: [auction, bidder, (0.908:Decimal * price) as $expr1, date_time] } └─BatchSource { source: "bid", columns: ["auction", "bidder", "price", "channel", "url", "date_time", "extra", "_row_id"], filter: (None, None) } stream_plan: | - StreamMaterialize { columns: [auction, bidder, price, date_time, _row_id(hidden)], pk_columns: [_row_id] } + StreamMaterialize { columns: [auction, bidder, price, date_time, _row_id(hidden)], pk_columns: [_row_id], pk_conflict: "no check" } └─StreamExchange { dist: HashShard(_row_id) } └─StreamProject { exprs: [auction, bidder, (0.908:Decimal * price) as $expr1, date_time, _row_id] } └─StreamRowIdGen { row_id_index: 7 } └─StreamSource { source: "bid", columns: ["auction", "bidder", "price", "channel", "url", "date_time", "extra", "_row_id"] } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [auction, bidder, price, date_time, _row_id(hidden)], pk_columns: [_row_id] } + StreamMaterialize { columns: [auction, bidder, price, date_time, _row_id(hidden)], pk_columns: [_row_id], pk_conflict: "no check" } materialized table: 4294967294 StreamExchange Hash([4]) from 1 @@ -114,7 +114,7 @@ └─BatchFilter { predicate: (((((auction = 1007:Int32) OR (auction = 1020:Int32)) OR (auction = 2001:Int32)) OR (auction = 2019:Int32)) OR (auction = 2087:Int32)) } └─BatchSource { source: "bid", columns: ["auction", "bidder", "price", "channel", "url", "date_time", "extra", "_row_id"], filter: (None, None) } stream_plan: | - StreamMaterialize { columns: [auction, price, _row_id(hidden)], pk_columns: [_row_id] } + StreamMaterialize { columns: [auction, price, _row_id(hidden)], pk_columns: [_row_id], pk_conflict: "no check" } └─StreamExchange { dist: HashShard(_row_id) } └─StreamProject { exprs: [auction, price, _row_id] } └─StreamFilter { predicate: (((((auction = 1007:Int32) OR (auction = 1020:Int32)) OR (auction = 2001:Int32)) OR (auction = 2019:Int32)) OR (auction = 2087:Int32)) } @@ -122,7 +122,7 @@ └─StreamSource { source: "bid", columns: ["auction", "bidder", "price", "channel", "url", "date_time", "extra", "_row_id"] } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [auction, price, _row_id(hidden)], pk_columns: [_row_id] } + StreamMaterialize { columns: [auction, price, _row_id(hidden)], pk_columns: [_row_id], pk_conflict: "no check" } materialized table: 4294967294 StreamExchange Hash([2]) from 1 @@ -157,7 +157,7 @@ └─BatchFilter { predicate: (((state = 'or':Varchar) OR (state = 'id':Varchar)) OR (state = 'ca':Varchar)) } └─BatchSource { source: "person", columns: ["id", "name", "email_address", "credit_card", "city", "state", "date_time", "_row_id"], filter: (None, None) } stream_plan: | - StreamMaterialize { columns: [name, city, state, id, _row_id(hidden), seller(hidden), _row_id#1(hidden), id#1(hidden)], pk_columns: [_row_id, _row_id#1, seller, id#1] } + StreamMaterialize { columns: [name, city, state, id, _row_id(hidden), seller(hidden), _row_id#1(hidden), id#1(hidden)], pk_columns: [_row_id, _row_id#1, seller, id#1], pk_conflict: "no check" } └─StreamAppendOnlyHashJoin { type: Inner, predicate: seller = id, output: [name, city, state, id, _row_id, seller, _row_id, id] } ├─StreamExchange { dist: HashShard(seller) } | └─StreamProject { exprs: [id, seller, _row_id] } @@ -171,7 +171,7 @@ └─StreamSource { source: "person", columns: ["id", "name", "email_address", "credit_card", "city", "state", "date_time", "_row_id"] } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [name, city, state, id, _row_id(hidden), seller(hidden), _row_id#1(hidden), id#1(hidden)], pk_columns: [_row_id, _row_id#1, seller, id#1] } + StreamMaterialize { columns: [name, city, state, id, _row_id(hidden), seller(hidden), _row_id#1(hidden), id#1(hidden)], pk_columns: [_row_id, _row_id#1, seller, id#1], pk_conflict: "no check" } materialized table: 4294967294 StreamAppendOnlyHashJoin { type: Inner, predicate: seller = id, output: [name, city, state, id, _row_id, seller, _row_id, id] } left table: 0, right table 2, left degree table: 1, right degree table: 3, @@ -229,7 +229,7 @@ └─BatchProject { exprs: [auction, price, date_time] } └─BatchSource { source: "bid", columns: ["auction", "bidder", "price", "channel", "url", "date_time", "extra", "_row_id"], filter: (None, None) } stream_plan: | - StreamMaterialize { columns: [category, avg], pk_columns: [category] } + StreamMaterialize { columns: [category, avg], pk_columns: [category], pk_conflict: "no check" } └─StreamProject { exprs: [category, (sum(max(price))::Decimal / count(max(price))) as $expr1] } └─StreamHashAgg { group_key: [category], aggs: [count, sum(max(price)), count(max(price))] } └─StreamExchange { dist: HashShard(category) } @@ -248,7 +248,7 @@ └─StreamSource { source: "bid", columns: ["auction", "bidder", "price", "channel", "url", "date_time", "extra", "_row_id"] } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [category, avg], pk_columns: [category] } + StreamMaterialize { columns: [category, avg], pk_columns: [category], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [category, (sum(max(price))::Decimal / count(max(price))) as $expr53] } StreamHashAgg { group_key: [category], aggs: [count, sum(max(price)), count(max(price))] } @@ -340,7 +340,7 @@ └─BatchProject { exprs: [auction, date_time] } └─BatchSource { source: "bid", columns: ["auction", "bidder", "price", "channel", "url", "date_time", "extra", "_row_id"], filter: (None, None) } stream_plan: | - StreamMaterialize { columns: [auction, num, window_start(hidden), window_start#1(hidden)], pk_columns: [window_start, auction, window_start#1] } + StreamMaterialize { columns: [auction, num, window_start(hidden), window_start#1(hidden)], pk_columns: [window_start, auction, window_start#1], pk_conflict: "no check" } └─StreamProject { exprs: [auction, count, window_start, window_start] } └─StreamFilter { predicate: (count >= max(count)) } └─StreamHashJoin { type: Inner, predicate: window_start = window_start, output: all } @@ -368,7 +368,7 @@ └─StreamSource { source: "bid", columns: ["auction", "bidder", "price", "channel", "url", "date_time", "extra", "_row_id"] } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [auction, num, window_start(hidden), window_start#1(hidden)], pk_columns: [window_start, auction, window_start#1] } + StreamMaterialize { columns: [auction, num, window_start(hidden), window_start#1(hidden)], pk_columns: [window_start, auction, window_start#1], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [auction, count, window_start, window_start] } StreamFilter { predicate: (count >= max(count)) } @@ -474,7 +474,7 @@ └─BatchProject { exprs: [(TumbleStart(date_time, '00:00:10':Interval) + '00:00:10':Interval) as $expr1, price] } └─BatchSource { source: "bid", columns: ["auction", "bidder", "price", "channel", "url", "date_time", "extra", "_row_id"], filter: (None, None) } stream_plan: | - StreamMaterialize { columns: [auction, price, bidder, date_time, _row_id(hidden), $expr121(hidden), max(price)(hidden)], pk_columns: [_row_id, $expr121, price, max(price)] } + StreamMaterialize { columns: [auction, price, bidder, date_time, _row_id(hidden), $expr121(hidden), max(price)(hidden)], pk_columns: [_row_id, $expr121, price, max(price)], pk_conflict: "no check" } └─StreamProject { exprs: [auction, price, bidder, date_time, _row_id, $expr1, max(price)] } └─StreamFilter { predicate: (date_time >= $expr2) AND (date_time <= $expr1) } └─StreamHashJoin { type: Inner, predicate: price = max(price), output: all } @@ -495,7 +495,7 @@ └─StreamSource { source: "bid", columns: ["auction", "bidder", "price", "channel", "url", "date_time", "extra", "_row_id"] } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [auction, price, bidder, date_time, _row_id(hidden), $expr121(hidden), max(price)(hidden)], pk_columns: [_row_id, $expr121, price, max(price)] } + StreamMaterialize { columns: [auction, price, bidder, date_time, _row_id(hidden), $expr121(hidden), max(price)(hidden)], pk_columns: [_row_id, $expr121, price, max(price)], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [auction, price, bidder, date_time, _row_id, $expr121, max(price)] } StreamFilter { predicate: (date_time >= $expr122) AND (date_time <= $expr121) } @@ -580,7 +580,7 @@ └─BatchProject { exprs: [seller, TumbleStart(date_time, '00:00:10':Interval) as $expr3, (TumbleStart(date_time, '00:00:10':Interval) + '00:00:10':Interval) as $expr4] } └─BatchSource { source: "auction", columns: ["id", "item_name", "description", "initial_bid", "reserve", "date_time", "expires", "seller", "category", "_row_id"], filter: (None, None) } stream_plan: | - StreamMaterialize { columns: [id, name, starttime, $expr222(hidden), seller(hidden), $expr223(hidden), $expr224(hidden)], pk_columns: [id, name, starttime, $expr222, seller, $expr223, $expr224] } + StreamMaterialize { columns: [id, name, starttime, $expr222(hidden), seller(hidden), $expr223(hidden), $expr224(hidden)], pk_columns: [id, name, starttime, $expr222, seller, $expr223, $expr224], pk_conflict: "no check" } └─StreamHashJoin { type: Inner, predicate: id = seller AND $expr1 = $expr3 AND $expr2 = $expr4, output: all } ├─StreamExchange { dist: HashShard(id, $expr1, $expr2) } | └─StreamProject { exprs: [id, name, $expr1, $expr2] } @@ -597,7 +597,7 @@ └─StreamSource { source: "auction", columns: ["id", "item_name", "description", "initial_bid", "reserve", "date_time", "expires", "seller", "category", "_row_id"] } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [id, name, starttime, $expr222(hidden), seller(hidden), $expr223(hidden), $expr224(hidden)], pk_columns: [id, name, starttime, $expr222, seller, $expr223, $expr224] } + StreamMaterialize { columns: [id, name, starttime, $expr222(hidden), seller(hidden), $expr223(hidden), $expr224(hidden)], pk_columns: [id, name, starttime, $expr222, seller, $expr223, $expr224], pk_conflict: "no check" } materialized table: 4294967294 StreamHashJoin { type: Inner, predicate: id = seller AND $expr221 = $expr223 AND $expr222 = $expr224, output: all } left table: 0, right table 2, left degree table: 1, right degree table: 3, @@ -674,7 +674,7 @@ └─BatchExchange { order: [], dist: HashShard(auction) } └─BatchSource { source: "bid", columns: ["auction", "bidder", "price", "channel", "url", "date_time", "extra", "_row_id"], filter: (None, None) } stream_plan: | - StreamMaterialize { columns: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category, auction, bidder, price, bid_date_time, _row_id(hidden), _row_id#1(hidden)], pk_columns: [_row_id, _row_id#1, id, auction] } + StreamMaterialize { columns: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category, auction, bidder, price, bid_date_time, _row_id(hidden), _row_id#1(hidden)], pk_columns: [_row_id, _row_id#1, id, auction], pk_conflict: "no check" } └─StreamProject { exprs: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category, auction, bidder, price, date_time, _row_id, _row_id] } └─StreamAppendOnlyGroupTopN { order: "[price DESC, date_time ASC]", limit: 1, offset: 0, group_key: [0] } └─StreamFilter { predicate: (date_time >= date_time) AND (date_time <= expires) } @@ -687,7 +687,7 @@ └─StreamSource { source: "bid", columns: ["auction", "bidder", "price", "channel", "url", "date_time", "extra", "_row_id"] } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category, auction, bidder, price, bid_date_time, _row_id(hidden), _row_id#1(hidden)], pk_columns: [_row_id, _row_id#1, id, auction] } + StreamMaterialize { columns: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category, auction, bidder, price, bid_date_time, _row_id(hidden), _row_id#1(hidden)], pk_columns: [_row_id, _row_id#1, id, auction], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category, auction, bidder, price, date_time, _row_id, _row_id] } StreamAppendOnlyGroupTopN { order: "[price DESC, date_time ASC]", limit: 1, offset: 0, group_key: [0] } @@ -726,14 +726,14 @@ └─BatchProject { exprs: [auction, bidder, price, date_time, ToChar(date_time, 'YYYY-MM-DD':Varchar) as $expr1, ToChar(date_time, 'HH:MI':Varchar) as $expr2] } └─BatchSource { source: "bid", columns: ["auction", "bidder", "price", "channel", "url", "date_time", "extra", "_row_id"], filter: (None, None) } stream_plan: | - StreamMaterialize { columns: [auction, bidder, price, date_time, date, time, _row_id(hidden)], pk_columns: [_row_id] } + StreamMaterialize { columns: [auction, bidder, price, date_time, date, time, _row_id(hidden)], pk_columns: [_row_id], pk_conflict: "no check" } └─StreamExchange { dist: HashShard(_row_id) } └─StreamProject { exprs: [auction, bidder, price, date_time, ToChar(date_time, 'YYYY-MM-DD':Varchar) as $expr1, ToChar(date_time, 'HH:MI':Varchar) as $expr2, _row_id] } └─StreamRowIdGen { row_id_index: 7 } └─StreamSource { source: "bid", columns: ["auction", "bidder", "price", "channel", "url", "date_time", "extra", "_row_id"] } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [auction, bidder, price, date_time, date, time, _row_id(hidden)], pk_columns: [_row_id] } + StreamMaterialize { columns: [auction, bidder, price, date_time, date, time, _row_id(hidden)], pk_columns: [_row_id], pk_conflict: "no check" } materialized table: 4294967294 StreamExchange Hash([6]) from 1 @@ -820,7 +820,7 @@ └─BatchFilter { predicate: ((0.908:Decimal * price) > 1000000:Int32) AND ((0.908:Decimal * price) < 50000000:Int32) } └─BatchSource { source: "bid", columns: ["auction", "bidder", "price", "channel", "url", "date_time", "extra", "_row_id"], filter: (None, None) } stream_plan: | - StreamMaterialize { columns: [auction, bidder, price, bidtimetype, date_time, extra, _row_id(hidden)], pk_columns: [_row_id] } + StreamMaterialize { columns: [auction, bidder, price, bidtimetype, date_time, extra, _row_id(hidden)], pk_columns: [_row_id], pk_conflict: "no check" } └─StreamExchange { dist: HashShard(_row_id) } └─StreamProject { exprs: [auction, bidder, (0.908:Decimal * price) as $expr1, Case(((Extract('HOUR':Varchar, date_time) >= 8:Int32) AND (Extract('HOUR':Varchar, date_time) <= 18:Int32)), 'dayTime':Varchar, ((Extract('HOUR':Varchar, date_time) <= 6:Int32) OR (Extract('HOUR':Varchar, date_time) >= 20:Int32)), 'nightTime':Varchar, 'otherTime':Varchar) as $expr2, date_time, extra, _row_id] } └─StreamFilter { predicate: ((0.908:Decimal * price) > 1000000:Int32) AND ((0.908:Decimal * price) < 50000000:Int32) } @@ -828,7 +828,7 @@ └─StreamSource { source: "bid", columns: ["auction", "bidder", "price", "channel", "url", "date_time", "extra", "_row_id"] } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [auction, bidder, price, bidtimetype, date_time, extra, _row_id(hidden)], pk_columns: [_row_id] } + StreamMaterialize { columns: [auction, bidder, price, bidtimetype, date_time, extra, _row_id(hidden)], pk_columns: [_row_id], pk_conflict: "no check" } materialized table: 4294967294 StreamExchange Hash([6]) from 1 @@ -872,7 +872,7 @@ └─BatchProject { exprs: [ToChar(date_time, 'yyyy-MM-dd':Varchar) as $expr1, price, bidder, auction] } └─BatchSource { source: "bid", columns: ["auction", "bidder", "price", "channel", "url", "date_time", "extra", "_row_id"], filter: (None, None) } stream_plan: | - StreamMaterialize { columns: [day, total_bids, rank1_bids, rank2_bids, rank3_bids, total_bidders, rank1_bidders, rank2_bidders, rank3_bidders, total_auctions, rank1_auctions, rank2_auctions, rank3_auctions], pk_columns: [day] } + StreamMaterialize { columns: [day, total_bids, rank1_bids, rank2_bids, rank3_bids, total_bidders, rank1_bidders, rank2_bidders, rank3_bidders, total_auctions, rank1_auctions, rank2_auctions, rank3_auctions], pk_columns: [day], pk_conflict: "no check" } └─StreamProject { exprs: [$expr1, sum0(count) filter((flag = 0:Int64)), sum0(count filter((price < 10000:Int32))) filter((flag = 0:Int64)), sum0(count filter((price >= 10000:Int32) AND (price < 1000000:Int32))) filter((flag = 0:Int64)), sum0(count filter((price >= 1000000:Int32))) filter((flag = 0:Int64)), count(bidder) filter((flag = 1:Int64)), count(bidder) filter((count filter((price < 10000:Int32)) > 0:Int64) AND (flag = 1:Int64)), count(bidder) filter((count filter((price >= 10000:Int32) AND (price < 1000000:Int32)) > 0:Int64) AND (flag = 1:Int64)), count(bidder) filter((count filter((price >= 1000000:Int32)) > 0:Int64) AND (flag = 1:Int64)), count(auction) filter((flag = 2:Int64)), count(auction) filter((count filter((price < 10000:Int32)) > 0:Int64) AND (flag = 2:Int64)), count(auction) filter((count filter((price >= 10000:Int32) AND (price < 1000000:Int32)) > 0:Int64) AND (flag = 2:Int64)), count(auction) filter((count filter((price >= 1000000:Int32)) > 0:Int64) AND (flag = 2:Int64))] } └─StreamHashAgg { group_key: [$expr1], aggs: [count, sum0(count) filter((flag = 0:Int64)), sum0(count filter((price < 10000:Int32))) filter((flag = 0:Int64)), sum0(count filter((price >= 10000:Int32) AND (price < 1000000:Int32))) filter((flag = 0:Int64)), sum0(count filter((price >= 1000000:Int32))) filter((flag = 0:Int64)), count(bidder) filter((flag = 1:Int64)), count(bidder) filter((count filter((price < 10000:Int32)) > 0:Int64) AND (flag = 1:Int64)), count(bidder) filter((count filter((price >= 10000:Int32) AND (price < 1000000:Int32)) > 0:Int64) AND (flag = 1:Int64)), count(bidder) filter((count filter((price >= 1000000:Int32)) > 0:Int64) AND (flag = 1:Int64)), count(auction) filter((flag = 2:Int64)), count(auction) filter((count filter((price < 10000:Int32)) > 0:Int64) AND (flag = 2:Int64)), count(auction) filter((count filter((price >= 10000:Int32) AND (price < 1000000:Int32)) > 0:Int64) AND (flag = 2:Int64)), count(auction) filter((count filter((price >= 1000000:Int32)) > 0:Int64) AND (flag = 2:Int64))] } └─StreamExchange { dist: HashShard($expr1) } @@ -885,7 +885,7 @@ └─StreamSource { source: "bid", columns: ["auction", "bidder", "price", "channel", "url", "date_time", "extra", "_row_id"] } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [day, total_bids, rank1_bids, rank2_bids, rank3_bids, total_bidders, rank1_bidders, rank2_bidders, rank3_bidders, total_auctions, rank1_auctions, rank2_auctions, rank3_auctions], pk_columns: [day] } + StreamMaterialize { columns: [day, total_bids, rank1_bids, rank2_bids, rank3_bids, total_bidders, rank1_bidders, rank2_bidders, rank3_bidders, total_auctions, rank1_auctions, rank2_auctions, rank3_auctions], pk_columns: [day], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [$expr54, sum0(count) filter((flag = 0:Int64)), sum0(count filter((price < 10000:Int32))) filter((flag = 0:Int64)), sum0(count filter((price >= 10000:Int32) AND (price < 1000000:Int32))) filter((flag = 0:Int64)), sum0(count filter((price >= 1000000:Int32))) filter((flag = 0:Int64)), count(bidder) filter((flag = 1:Int64)), count(bidder) filter((count filter((price < 10000:Int32)) > 0:Int64) AND (flag = 1:Int64)), count(bidder) filter((count filter((price >= 10000:Int32) AND (price < 1000000:Int32)) > 0:Int64) AND (flag = 1:Int64)), count(bidder) filter((count filter((price >= 1000000:Int32)) > 0:Int64) AND (flag = 1:Int64)), count(auction) filter((flag = 2:Int64)), count(auction) filter((count filter((price < 10000:Int32)) > 0:Int64) AND (flag = 2:Int64)), count(auction) filter((count filter((price >= 10000:Int32) AND (price < 1000000:Int32)) > 0:Int64) AND (flag = 2:Int64)), count(auction) filter((count filter((price >= 1000000:Int32)) > 0:Int64) AND (flag = 2:Int64))] } StreamHashAgg { group_key: [$expr54], aggs: [count, sum0(count) filter((flag = 0:Int64)), sum0(count filter((price < 10000:Int32))) filter((flag = 0:Int64)), sum0(count filter((price >= 10000:Int32) AND (price < 1000000:Int32))) filter((flag = 0:Int64)), sum0(count filter((price >= 1000000:Int32))) filter((flag = 0:Int64)), count(bidder) filter((flag = 1:Int64)), count(bidder) filter((count filter((price < 10000:Int32)) > 0:Int64) AND (flag = 1:Int64)), count(bidder) filter((count filter((price >= 10000:Int32) AND (price < 1000000:Int32)) > 0:Int64) AND (flag = 1:Int64)), count(bidder) filter((count filter((price >= 1000000:Int32)) > 0:Int64) AND (flag = 1:Int64)), count(auction) filter((flag = 2:Int64)), count(auction) filter((count filter((price < 10000:Int32)) > 0:Int64) AND (flag = 2:Int64)), count(auction) filter((count filter((price >= 10000:Int32) AND (price < 1000000:Int32)) > 0:Int64) AND (flag = 2:Int64)), count(auction) filter((count filter((price >= 1000000:Int32)) > 0:Int64) AND (flag = 2:Int64))] } @@ -942,7 +942,7 @@ └─BatchProject { exprs: [channel, ToChar(date_time, 'yyyy-MM-dd':Varchar) as $expr1, ToChar(date_time, 'HH:mm':Varchar) as $expr2, price, bidder, auction] } └─BatchSource { source: "bid", columns: ["auction", "bidder", "price", "channel", "url", "date_time", "extra", "_row_id"], filter: (None, None) } stream_plan: | - StreamMaterialize { columns: [channel, day, minute, total_bids, rank1_bids, rank2_bids, rank3_bids, total_bidders, rank1_bidders, rank2_bidders, rank3_bidders, total_auctions, rank1_auctions, rank2_auctions, rank3_auctions], pk_columns: [channel, day] } + StreamMaterialize { columns: [channel, day, minute, total_bids, rank1_bids, rank2_bids, rank3_bids, total_bidders, rank1_bidders, rank2_bidders, rank3_bidders, total_auctions, rank1_auctions, rank2_auctions, rank3_auctions], pk_columns: [channel, day], pk_conflict: "no check" } └─StreamProject { exprs: [channel, $expr1, max(max($expr2)) filter((flag = 0:Int64)), sum0(count) filter((flag = 0:Int64)), sum0(count filter((price < 10000:Int32))) filter((flag = 0:Int64)), sum0(count filter((price >= 10000:Int32) AND (price < 1000000:Int32))) filter((flag = 0:Int64)), sum0(count filter((price >= 1000000:Int32))) filter((flag = 0:Int64)), count(bidder) filter((flag = 1:Int64)), count(bidder) filter((count filter((price < 10000:Int32)) > 0:Int64) AND (flag = 1:Int64)), count(bidder) filter((count filter((price >= 10000:Int32) AND (price < 1000000:Int32)) > 0:Int64) AND (flag = 1:Int64)), count(bidder) filter((count filter((price >= 1000000:Int32)) > 0:Int64) AND (flag = 1:Int64)), count(auction) filter((flag = 2:Int64)), count(auction) filter((count filter((price < 10000:Int32)) > 0:Int64) AND (flag = 2:Int64)), count(auction) filter((count filter((price >= 10000:Int32) AND (price < 1000000:Int32)) > 0:Int64) AND (flag = 2:Int64)), count(auction) filter((count filter((price >= 1000000:Int32)) > 0:Int64) AND (flag = 2:Int64))] } └─StreamHashAgg { group_key: [channel, $expr1], aggs: [count, max(max($expr2)) filter((flag = 0:Int64)), sum0(count) filter((flag = 0:Int64)), sum0(count filter((price < 10000:Int32))) filter((flag = 0:Int64)), sum0(count filter((price >= 10000:Int32) AND (price < 1000000:Int32))) filter((flag = 0:Int64)), sum0(count filter((price >= 1000000:Int32))) filter((flag = 0:Int64)), count(bidder) filter((flag = 1:Int64)), count(bidder) filter((count filter((price < 10000:Int32)) > 0:Int64) AND (flag = 1:Int64)), count(bidder) filter((count filter((price >= 10000:Int32) AND (price < 1000000:Int32)) > 0:Int64) AND (flag = 1:Int64)), count(bidder) filter((count filter((price >= 1000000:Int32)) > 0:Int64) AND (flag = 1:Int64)), count(auction) filter((flag = 2:Int64)), count(auction) filter((count filter((price < 10000:Int32)) > 0:Int64) AND (flag = 2:Int64)), count(auction) filter((count filter((price >= 10000:Int32) AND (price < 1000000:Int32)) > 0:Int64) AND (flag = 2:Int64)), count(auction) filter((count filter((price >= 1000000:Int32)) > 0:Int64) AND (flag = 2:Int64))] } └─StreamExchange { dist: HashShard(channel, $expr1) } @@ -955,7 +955,7 @@ └─StreamSource { source: "bid", columns: ["auction", "bidder", "price", "channel", "url", "date_time", "extra", "_row_id"] } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [channel, day, minute, total_bids, rank1_bids, rank2_bids, rank3_bids, total_bidders, rank1_bidders, rank2_bidders, rank3_bidders, total_auctions, rank1_auctions, rank2_auctions, rank3_auctions], pk_columns: [channel, day] } + StreamMaterialize { columns: [channel, day, minute, total_bids, rank1_bids, rank2_bids, rank3_bids, total_bidders, rank1_bidders, rank2_bidders, rank3_bidders, total_auctions, rank1_auctions, rank2_auctions, rank3_auctions], pk_columns: [channel, day], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [channel, $expr107, max(max($expr108)) filter((flag = 0:Int64)), sum0(count) filter((flag = 0:Int64)), sum0(count filter((price < 10000:Int32))) filter((flag = 0:Int64)), sum0(count filter((price >= 10000:Int32) AND (price < 1000000:Int32))) filter((flag = 0:Int64)), sum0(count filter((price >= 1000000:Int32))) filter((flag = 0:Int64)), count(bidder) filter((flag = 1:Int64)), count(bidder) filter((count filter((price < 10000:Int32)) > 0:Int64) AND (flag = 1:Int64)), count(bidder) filter((count filter((price >= 10000:Int32) AND (price < 1000000:Int32)) > 0:Int64) AND (flag = 1:Int64)), count(bidder) filter((count filter((price >= 1000000:Int32)) > 0:Int64) AND (flag = 1:Int64)), count(auction) filter((flag = 2:Int64)), count(auction) filter((count filter((price < 10000:Int32)) > 0:Int64) AND (flag = 2:Int64)), count(auction) filter((count filter((price >= 10000:Int32) AND (price < 1000000:Int32)) > 0:Int64) AND (flag = 2:Int64)), count(auction) filter((count filter((price >= 1000000:Int32)) > 0:Int64) AND (flag = 2:Int64))] } StreamHashAgg { group_key: [channel, $expr107], aggs: [count, max(max($expr108)) filter((flag = 0:Int64)), sum0(count) filter((flag = 0:Int64)), sum0(count filter((price < 10000:Int32))) filter((flag = 0:Int64)), sum0(count filter((price >= 10000:Int32) AND (price < 1000000:Int32))) filter((flag = 0:Int64)), sum0(count filter((price >= 1000000:Int32))) filter((flag = 0:Int64)), count(bidder) filter((flag = 1:Int64)), count(bidder) filter((count filter((price < 10000:Int32)) > 0:Int64) AND (flag = 1:Int64)), count(bidder) filter((count filter((price >= 10000:Int32) AND (price < 1000000:Int32)) > 0:Int64) AND (flag = 1:Int64)), count(bidder) filter((count filter((price >= 1000000:Int32)) > 0:Int64) AND (flag = 1:Int64)), count(auction) filter((flag = 2:Int64)), count(auction) filter((count filter((price < 10000:Int32)) > 0:Int64) AND (flag = 2:Int64)), count(auction) filter((count filter((price >= 10000:Int32) AND (price < 1000000:Int32)) > 0:Int64) AND (flag = 2:Int64)), count(auction) filter((count filter((price >= 1000000:Int32)) > 0:Int64) AND (flag = 2:Int64))] } @@ -1005,7 +1005,7 @@ └─BatchProject { exprs: [auction, ToChar(date_time, 'YYYY-MM-DD':Varchar) as $expr1, price] } └─BatchSource { source: "bid", columns: ["auction", "bidder", "price", "channel", "url", "date_time", "extra", "_row_id"], filter: (None, None) } stream_plan: | - StreamMaterialize { columns: [auction, day, total_bids, rank1_bids, rank2_bids, rank3_bids, min_price, max_price, avg_price, sum_price], pk_columns: [auction, day] } + StreamMaterialize { columns: [auction, day, total_bids, rank1_bids, rank2_bids, rank3_bids, min_price, max_price, avg_price, sum_price], pk_columns: [auction, day], pk_conflict: "no check" } └─StreamProject { exprs: [auction, $expr1, count, count filter((price < 10000:Int32)), count filter((price >= 10000:Int32) AND (price < 1000000:Int32)), count filter((price >= 1000000:Int32)), min(price), max(price), (sum(price)::Decimal / count(price)) as $expr2, sum(price)] } └─StreamAppendOnlyHashAgg { group_key: [auction, $expr1], aggs: [count, count, count filter((price < 10000:Int32)), count filter((price >= 10000:Int32) AND (price < 1000000:Int32)), count filter((price >= 1000000:Int32)), min(price), max(price), sum(price), count(price), sum(price)] } └─StreamExchange { dist: HashShard(auction, $expr1) } @@ -1014,7 +1014,7 @@ └─StreamSource { source: "bid", columns: ["auction", "bidder", "price", "channel", "url", "date_time", "extra", "_row_id"] } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [auction, day, total_bids, rank1_bids, rank2_bids, rank3_bids, min_price, max_price, avg_price, sum_price], pk_columns: [auction, day] } + StreamMaterialize { columns: [auction, day, total_bids, rank1_bids, rank2_bids, rank3_bids, min_price, max_price, avg_price, sum_price], pk_columns: [auction, day], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [auction, $expr106, count, count filter((price < 10000:Int32)), count filter((price >= 10000:Int32) AND (price < 1000000:Int32)), count filter((price >= 1000000:Int32)), min(price), max(price), (sum(price)::Decimal / count(price)) as $expr107, sum(price)] } StreamAppendOnlyHashAgg { group_key: [auction, $expr106], aggs: [count, count, count filter((price < 10000:Int32)), count filter((price >= 10000:Int32) AND (price < 1000000:Int32)), count filter((price >= 1000000:Int32)), min(price), max(price), sum(price), count(price), sum(price)] } @@ -1051,7 +1051,7 @@ └─BatchExchange { order: [], dist: HashShard(bidder, auction) } └─BatchSource { source: "bid", columns: ["auction", "bidder", "price", "channel", "url", "date_time", "extra", "_row_id"], filter: (None, None) } stream_plan: | - StreamMaterialize { columns: [auction, bidder, price, channel, url, date_time, extra, _row_id(hidden)], pk_columns: [_row_id] } + StreamMaterialize { columns: [auction, bidder, price, channel, url, date_time, extra, _row_id(hidden)], pk_columns: [_row_id], pk_conflict: "no check" } └─StreamExchange { dist: HashShard(_row_id) } └─StreamProject { exprs: [auction, bidder, price, channel, url, date_time, extra, _row_id] } └─StreamAppendOnlyGroupTopN { order: "[date_time DESC]", limit: 1, offset: 0, group_key: [1, 0] } @@ -1060,7 +1060,7 @@ └─StreamSource { source: "bid", columns: ["auction", "bidder", "price", "channel", "url", "date_time", "extra", "_row_id"] } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [auction, bidder, price, channel, url, date_time, extra, _row_id(hidden)], pk_columns: [_row_id] } + StreamMaterialize { columns: [auction, bidder, price, channel, url, date_time, extra, _row_id(hidden)], pk_columns: [_row_id], pk_conflict: "no check" } materialized table: 4294967294 StreamExchange Hash([7]) from 1 @@ -1118,7 +1118,7 @@ └─BatchFilter { predicate: (category = 10:Int32) } └─BatchSource { source: "auction", columns: ["id", "item_name", "description", "initial_bid", "reserve", "date_time", "expires", "seller", "category", "_row_id"], filter: (None, None) } stream_plan: | - StreamMaterialize { columns: [auction, bidder, price, channel, url, date_timeb, item_name, description, initial_bid, reserve, date_timea, expires, seller, category, _row_id(hidden), _row_id#1(hidden), id(hidden)], pk_columns: [_row_id, _row_id#1, auction, id] } + StreamMaterialize { columns: [auction, bidder, price, channel, url, date_timeb, item_name, description, initial_bid, reserve, date_timea, expires, seller, category, _row_id(hidden), _row_id#1(hidden), id(hidden)], pk_columns: [_row_id, _row_id#1, auction, id], pk_conflict: "no check" } └─StreamAppendOnlyHashJoin { type: Inner, predicate: auction = id, output: [auction, bidder, price, channel, url, date_time, item_name, description, initial_bid, reserve, date_time, expires, seller, category, _row_id, _row_id, id] } ├─StreamExchange { dist: HashShard(auction) } | └─StreamProject { exprs: [auction, bidder, price, channel, url, date_time, _row_id] } @@ -1131,7 +1131,7 @@ └─StreamSource { source: "auction", columns: ["id", "item_name", "description", "initial_bid", "reserve", "date_time", "expires", "seller", "category", "_row_id"] } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [auction, bidder, price, channel, url, date_timeb, item_name, description, initial_bid, reserve, date_timea, expires, seller, category, _row_id(hidden), _row_id#1(hidden), id(hidden)], pk_columns: [_row_id, _row_id#1, auction, id] } + StreamMaterialize { columns: [auction, bidder, price, channel, url, date_timeb, item_name, description, initial_bid, reserve, date_timea, expires, seller, category, _row_id(hidden), _row_id#1(hidden), id(hidden)], pk_columns: [_row_id, _row_id#1, auction, id], pk_conflict: "no check" } materialized table: 4294967294 StreamAppendOnlyHashJoin { type: Inner, predicate: auction = id, output: [auction, bidder, price, channel, url, date_time, item_name, description, initial_bid, reserve, date_time, expires, seller, category, _row_id, _row_id, id] } left table: 0, right table 2, left degree table: 1, right degree table: 3, @@ -1191,14 +1191,14 @@ └─BatchProject { exprs: [auction, bidder, price, channel, SplitPart(url, '/':Varchar, 4:Int32) as $expr1, SplitPart(url, '/':Varchar, 5:Int32) as $expr2, SplitPart(url, '/':Varchar, 6:Int32) as $expr3] } └─BatchSource { source: "bid", columns: ["auction", "bidder", "price", "channel", "url", "date_time", "extra", "_row_id"], filter: (None, None) } stream_plan: | - StreamMaterialize { columns: [auction, bidder, price, channel, dir1, dir2, dir3, _row_id(hidden)], pk_columns: [_row_id] } + StreamMaterialize { columns: [auction, bidder, price, channel, dir1, dir2, dir3, _row_id(hidden)], pk_columns: [_row_id], pk_conflict: "no check" } └─StreamExchange { dist: HashShard(_row_id) } └─StreamProject { exprs: [auction, bidder, price, channel, SplitPart(url, '/':Varchar, 4:Int32) as $expr1, SplitPart(url, '/':Varchar, 5:Int32) as $expr2, SplitPart(url, '/':Varchar, 6:Int32) as $expr3, _row_id] } └─StreamRowIdGen { row_id_index: 7 } └─StreamSource { source: "bid", columns: ["auction", "bidder", "price", "channel", "url", "date_time", "extra", "_row_id"] } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [auction, bidder, price, channel, dir1, dir2, dir3, _row_id(hidden)], pk_columns: [_row_id] } + StreamMaterialize { columns: [auction, bidder, price, channel, dir1, dir2, dir3, _row_id(hidden)], pk_columns: [_row_id], pk_conflict: "no check" } materialized table: 4294967294 StreamExchange Hash([7]) from 1 @@ -1240,7 +1240,7 @@ └─BatchExchange { order: [], dist: HashShard(auction) } └─BatchSource { source: "bid", columns: ["auction", "bidder", "price", "channel", "url", "date_time", "extra", "_row_id"], filter: (None, None) } stream_plan: | - StreamMaterialize { columns: [auction_id, auction_item_name, current_highest_bid, _row_id(hidden), auction(hidden)], pk_columns: [_row_id, auction, auction_id] } + StreamMaterialize { columns: [auction_id, auction_item_name, current_highest_bid, _row_id(hidden), auction(hidden)], pk_columns: [_row_id, auction, auction_id], pk_conflict: "no check" } └─StreamHashJoin { type: LeftOuter, predicate: id = auction, output: [id, item_name, max(price), _row_id, auction] } ├─StreamExchange { dist: HashShard(id) } | └─StreamProject { exprs: [id, item_name, _row_id] } @@ -1253,7 +1253,7 @@ └─StreamSource { source: "bid", columns: ["auction", "bidder", "price", "channel", "url", "date_time", "extra", "_row_id"] } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [auction_id, auction_item_name, current_highest_bid, _row_id(hidden), auction(hidden)], pk_columns: [_row_id, auction, auction_id] } + StreamMaterialize { columns: [auction_id, auction_item_name, current_highest_bid, _row_id(hidden), auction(hidden)], pk_columns: [_row_id, auction, auction_id], pk_conflict: "no check" } materialized table: 4294967294 StreamHashJoin { type: LeftOuter, predicate: id = auction, output: [id, item_name, max(price), _row_id, auction] } left table: 0, right table 2, left degree table: 1, right degree table: 3, @@ -1319,7 +1319,7 @@ └─BatchProject { exprs: [auction] } └─BatchSource { source: "bid", columns: ["auction", "bidder", "price", "channel", "url", "date_time", "extra", "_row_id"], filter: (None, None) } stream_plan: | - StreamMaterialize { columns: [auction_id, auction_item_name, bid_count], pk_columns: [auction_id, auction_item_name] } + StreamMaterialize { columns: [auction_id, auction_item_name, bid_count], pk_columns: [auction_id, auction_item_name], pk_conflict: "no check" } └─StreamProject { exprs: [id, item_name, count(auction)] } └─StreamDynamicFilter { predicate: (count(auction) >= $expr1), output: [id, item_name, count(auction), count(auction)] } ├─StreamProject { exprs: [id, item_name, count(auction), count(auction)] } @@ -1349,7 +1349,7 @@ └─StreamSource { source: "bid", columns: ["auction", "bidder", "price", "channel", "url", "date_time", "extra", "_row_id"] } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [auction_id, auction_item_name, bid_count], pk_columns: [auction_id, auction_item_name] } + StreamMaterialize { columns: [auction_id, auction_item_name, bid_count], pk_columns: [auction_id, auction_item_name], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [id, item_name, count(auction)] } StreamDynamicFilter { predicate: (count(auction) >= $expr55), output: [id, item_name, count(auction), count(auction)] } @@ -1435,7 +1435,7 @@ └─BatchExchange { order: [], dist: HashShard(auction) } └─BatchSource { source: "bid", columns: ["auction", "bidder", "price", "channel", "url", "date_time", "extra", "_row_id"], filter: (None, None) } stream_plan: | - StreamMaterialize { columns: [auction_id, auction_item_name, _row_id(hidden)], pk_columns: [_row_id, auction_id] } + StreamMaterialize { columns: [auction_id, auction_item_name, _row_id(hidden)], pk_columns: [_row_id, auction_id], pk_conflict: "no check" } └─StreamHashJoin { type: LeftSemi, predicate: id = auction, output: all } ├─StreamExchange { dist: HashShard(id) } | └─StreamProject { exprs: [id, item_name, _row_id] } @@ -1450,7 +1450,7 @@ └─StreamSource { source: "bid", columns: ["auction", "bidder", "price", "channel", "url", "date_time", "extra", "_row_id"] } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [auction_id, auction_item_name, _row_id(hidden)], pk_columns: [_row_id, auction_id] } + StreamMaterialize { columns: [auction_id, auction_item_name, _row_id(hidden)], pk_columns: [_row_id, auction_id], pk_conflict: "no check" } materialized table: 4294967294 StreamHashJoin { type: LeftSemi, predicate: id = auction, output: all } left table: 0, right table 2, left degree table: 1, right degree table: 3, @@ -1509,7 +1509,7 @@ └─BatchExchange { order: [], dist: HashShard(auction) } └─BatchSource { source: "bid", columns: ["auction", "bidder", "price", "channel", "url", "date_time", "extra", "_row_id"], filter: (None, None) } stream_plan: | - StreamMaterialize { columns: [auction_id, auction_item_name, _row_id(hidden)], pk_columns: [_row_id, auction_id] } + StreamMaterialize { columns: [auction_id, auction_item_name, _row_id(hidden)], pk_columns: [_row_id, auction_id], pk_conflict: "no check" } └─StreamHashJoin { type: LeftAnti, predicate: id = auction, output: all } ├─StreamExchange { dist: HashShard(id) } | └─StreamProject { exprs: [id, item_name, _row_id] } @@ -1524,7 +1524,7 @@ └─StreamSource { source: "bid", columns: ["auction", "bidder", "price", "channel", "url", "date_time", "extra", "_row_id"] } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [auction_id, auction_item_name, _row_id(hidden)], pk_columns: [_row_id, auction_id] } + StreamMaterialize { columns: [auction_id, auction_item_name, _row_id(hidden)], pk_columns: [_row_id, auction_id], pk_conflict: "no check" } materialized table: 4294967294 StreamHashJoin { type: LeftAnti, predicate: id = auction, output: all } left table: 0, right table 2, left degree table: 1, right degree table: 3, @@ -1584,7 +1584,7 @@ └─BatchProject { exprs: [auction] } └─BatchSource { source: "bid", columns: ["auction", "bidder", "price", "channel", "url", "date_time", "extra", "_row_id"], filter: (None, None) } stream_plan: | - StreamMaterialize { columns: [auction_id, auction_item_name, bid_count], pk_columns: [auction_id, auction_item_name], order_descs: [bid_count, auction_id, auction_item_name] } + StreamMaterialize { columns: [auction_id, auction_item_name, bid_count], pk_columns: [auction_id, auction_item_name], order_descs: [bid_count, auction_id, auction_item_name], pk_conflict: "no check" } └─StreamProject { exprs: [id, item_name, count(auction)] } └─StreamTopN { order: "[count(auction) DESC]", limit: 1000, offset: 0 } └─StreamExchange { dist: Single } @@ -1603,7 +1603,7 @@ └─StreamSource { source: "bid", columns: ["auction", "bidder", "price", "channel", "url", "date_time", "extra", "_row_id"] } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [auction_id, auction_item_name, bid_count], pk_columns: [auction_id, auction_item_name], order_descs: [bid_count, auction_id, auction_item_name] } + StreamMaterialize { columns: [auction_id, auction_item_name, bid_count], pk_columns: [auction_id, auction_item_name], order_descs: [bid_count, auction_id, auction_item_name], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [id, item_name, count(auction)] } StreamTopN { order: "[count(auction) DESC]", limit: 1000, offset: 0 } diff --git a/src/frontend/planner_test/tests/testdata/order_by.yaml b/src/frontend/planner_test/tests/testdata/order_by.yaml index 69a693306434b..e8f42e306cac6 100644 --- a/src/frontend/planner_test/tests/testdata/order_by.yaml +++ b/src/frontend/planner_test/tests/testdata/order_by.yaml @@ -8,7 +8,7 @@ └─BatchSort { order: [t.v1 DESC] } └─BatchScan { table: t, columns: [t.v1, t.v2], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [v1, v2, t._row_id(hidden)], pk_columns: [t._row_id], order_descs: [v1, t._row_id] } + StreamMaterialize { columns: [v1, v2, t._row_id(hidden)], pk_columns: [t._row_id], order_descs: [v1, t._row_id], pk_conflict: "no check" } └─StreamTableScan { table: t, columns: [t.v1, t.v2, t._row_id], pk: [t._row_id], dist: UpstreamHashShard(t._row_id) } - name: output names are not qualified after table names sql: | @@ -64,7 +64,7 @@ └─BatchProject { exprs: [t.v1, t.v2, 2:Int32] } └─BatchScan { table: t, columns: [t.v1, t.v2], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [v1, v2, 2:Int32(hidden), t._row_id(hidden)], pk_columns: [t._row_id], order_descs: [2:Int32, t._row_id] } + StreamMaterialize { columns: [v1, v2, 2:Int32(hidden), t._row_id(hidden)], pk_columns: [t._row_id], order_descs: [2:Int32, t._row_id], pk_conflict: "no check" } └─StreamProject { exprs: [t.v1, t.v2, 2:Int32, t._row_id] } └─StreamTableScan { table: t, columns: [t.v1, t.v2, t._row_id], pk: [t._row_id], dist: UpstreamHashShard(t._row_id) } - sql: | @@ -80,7 +80,7 @@ └─BatchTopN { order: "[t.v1 DESC]", limit: 5, offset: 0 } └─BatchScan { table: t, columns: [t.v1, t.v2], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [v1, v2, t._row_id(hidden)], pk_columns: [t._row_id], order_descs: [v1, t._row_id] } + StreamMaterialize { columns: [v1, v2, t._row_id(hidden)], pk_columns: [t._row_id], order_descs: [v1, t._row_id], pk_conflict: "no check" } └─StreamProject { exprs: [t.v1, t.v2, t._row_id] } └─StreamTopN { order: "[t.v1 DESC]", limit: 5, offset: 0 } └─StreamExchange { dist: Single } @@ -112,7 +112,7 @@ └─BatchTopN { order: "[t.v1 DESC]", limit: 12, offset: 0 } └─BatchScan { table: t, columns: [t.v1, t.v2], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [v1, v2, t._row_id(hidden)], pk_columns: [t._row_id], order_descs: [v1, t._row_id] } + StreamMaterialize { columns: [v1, v2, t._row_id(hidden)], pk_columns: [t._row_id], order_descs: [v1, t._row_id], pk_conflict: "no check" } └─StreamProject { exprs: [t.v1, t.v2, t._row_id] } └─StreamTopN { order: "[t.v1 DESC]", limit: 5, offset: 7 } └─StreamExchange { dist: Single } @@ -133,7 +133,7 @@ └─BatchProject { exprs: [t.x, t.y, (t.x + t.y) as $expr1, t.z] } └─BatchScan { table: t, columns: [t.x, t.y, t.z], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [x, y, $expr71(hidden), t.z(hidden), t._row_id(hidden)], pk_columns: [t._row_id], order_descs: [$expr71, t.z, t._row_id] } + StreamMaterialize { columns: [x, y, $expr71(hidden), t.z(hidden), t._row_id(hidden)], pk_columns: [t._row_id], order_descs: [$expr71, t.z, t._row_id], pk_conflict: "no check" } └─StreamProject { exprs: [t.x, t.y, (t.x + t.y) as $expr1, t.z, t._row_id] } └─StreamTableScan { table: t, columns: [t.x, t.y, t.z, t._row_id], pk: [t._row_id], dist: UpstreamHashShard(t._row_id) } - name: order by the number of an output column diff --git a/src/frontend/planner_test/tests/testdata/over_window_function.yaml b/src/frontend/planner_test/tests/testdata/over_window_function.yaml index be4bf3c5f4635..92f73a3f043fc 100644 --- a/src/frontend/planner_test/tests/testdata/over_window_function.yaml +++ b/src/frontend/planner_test/tests/testdata/over_window_function.yaml @@ -104,7 +104,7 @@ └─BatchFilter { predicate: (t.x > t.y) } └─BatchScan { table: t, columns: [t.x, t.y, t._row_id], distribution: UpstreamHashShard(t._row_id) } stream_plan: | - StreamMaterialize { columns: [x, y, t._row_id(hidden)], pk_columns: [t._row_id] } + StreamMaterialize { columns: [x, y, t._row_id(hidden)], pk_columns: [t._row_id], pk_conflict: "no check" } └─StreamExchange { dist: HashShard(t._row_id) } └─StreamProject { exprs: [t.x, t.y, t._row_id] } └─StreamGroupTopN { order: "[t.x ASC]", limit: 2, offset: 0, group_key: [1] } @@ -132,7 +132,7 @@ └─BatchExchange { order: [], dist: HashShard(t.y) } └─BatchScan { table: t, columns: [t.x, t.y, t._row_id], distribution: UpstreamHashShard(t._row_id) } stream_plan: | - StreamMaterialize { columns: [x, y, t._row_id(hidden)], pk_columns: [t._row_id] } + StreamMaterialize { columns: [x, y, t._row_id(hidden)], pk_columns: [t._row_id], pk_conflict: "no check" } └─StreamExchange { dist: HashShard(t._row_id) } └─StreamProject { exprs: [t.x, t.y, t._row_id] } └─StreamGroupTopN { order: "[t.x ASC]", limit: 3, offset: 0, group_key: [1], with_ties: true } @@ -288,7 +288,7 @@ ) ) WHERE rownum <= 3; stream_plan: | - StreamMaterialize { columns: [window_start, window_end, supplier_id, price, cnt], pk_columns: [window_start, window_end, supplier_id] } + StreamMaterialize { columns: [window_start, window_end, supplier_id, price, cnt], pk_columns: [window_start, window_end, supplier_id], pk_conflict: "no check" } └─StreamGroupTopN { order: "[sum(bid.price) DESC]", limit: 3, offset: 0, group_key: [0, 1] } └─StreamExchange { dist: HashShard($expr1, $expr2) } └─StreamProject { exprs: [$expr1, $expr2, bid.supplier_id, sum(bid.price), count] } @@ -308,7 +308,7 @@ TUMBLE(Bid, bidtime, INTERVAL '10' MINUTE) ) WHERE rownum <= 3; stream_plan: | - StreamMaterialize { columns: [window_start, window_end, supplier_id, price, bid._row_id(hidden)], pk_columns: [bid._row_id] } + StreamMaterialize { columns: [window_start, window_end, supplier_id, price, bid._row_id(hidden)], pk_columns: [bid._row_id], pk_conflict: "no check" } └─StreamExchange { dist: HashShard(bid._row_id) } └─StreamProject { exprs: [$expr1, $expr2, bid.supplier_id, bid.price, bid._row_id] } └─StreamGroupTopN { order: "[bid.price DESC]", limit: 3, offset: 0, group_key: [5, 6] } @@ -332,7 +332,7 @@ └─LogicalTopN { order: "[t.y ASC]", limit: 1, offset: 0, group_key: [0] } └─LogicalScan { table: t, columns: [t.x, t.y, t._row_id] } stream_plan: | - StreamMaterialize { columns: [x, y, t._row_id(hidden)], pk_columns: [t._row_id] } + StreamMaterialize { columns: [x, y, t._row_id(hidden)], pk_columns: [t._row_id], pk_conflict: "no check" } └─StreamExchange { dist: HashShard(t._row_id) } └─StreamProject { exprs: [t.x, t.y, t._row_id] } └─StreamGroupTopN { order: "[t.y ASC]", limit: 1, offset: 0, group_key: [0] } diff --git a/src/frontend/planner_test/tests/testdata/pk_derive.yaml b/src/frontend/planner_test/tests/testdata/pk_derive.yaml index 3ec7e4f7c06c8..4fc006614482c 100644 --- a/src/frontend/planner_test/tests/testdata/pk_derive.yaml +++ b/src/frontend/planner_test/tests/testdata/pk_derive.yaml @@ -20,7 +20,7 @@ ON Tone.id = Ttwo.id; stream_plan: | - StreamMaterialize { columns: [max_v1, max_v2, t1.id(hidden), t2.id(hidden)], pk_columns: [t1.id, t2.id] } + StreamMaterialize { columns: [max_v1, max_v2, t1.id(hidden), t2.id(hidden)], pk_columns: [t1.id, t2.id], pk_conflict: "no check" } └─StreamHashJoin { type: Inner, predicate: t1.id = t2.id, output: [max(t1.v1), max(t2.v2), t1.id, t2.id] } ├─StreamProject { exprs: [max(t1.v1), t1.id] } | └─StreamHashAgg { group_key: [t1.id], aggs: [count, max(t1.v1)] } @@ -50,7 +50,7 @@ ON Tone.id = Ttwo.id; stream_plan: | - StreamMaterialize { columns: [max_v, min_v, t.id(hidden), t.id#1(hidden)], pk_columns: [t.id, t.id#1] } + StreamMaterialize { columns: [max_v, min_v, t.id(hidden), t.id#1(hidden)], pk_columns: [t.id, t.id#1], pk_conflict: "no check" } └─StreamHashJoin { type: Inner, predicate: t.id = t.id, output: [max(t.v), min(t.v), t.id, t.id] } ├─StreamProject { exprs: [max(t.v), t.id] } | └─StreamHashAgg { group_key: [t.id], aggs: [count, max(t.v)] } @@ -74,7 +74,7 @@ LogicalAgg { group_key: [t.v1, t.v2, t.v3], aggs: [] } └─LogicalScan { table: t, columns: [t.v1, t.v2, t.v3] } stream_plan: | - StreamMaterialize { columns: [v1, v2, v3], pk_columns: [v1, v2, v3] } + StreamMaterialize { columns: [v1, v2, v3], pk_columns: [v1, v2, v3], pk_conflict: "no check" } └─StreamProject { exprs: [t.v1, t.v2, t.v3] } └─StreamHashAgg { group_key: [t.v1, t.v2, t.v3], aggs: [count] } └─StreamExchange { dist: HashShard(t.v1, t.v2, t.v3) } @@ -99,6 +99,6 @@ optimized_logical_plan: | LogicalScan { table: mv, output_columns: [mv.v1], required_columns: [mv.v1, mv.v3], predicate: ((mv.v3 = 'world':Varchar) OR (mv.v3 = 'hello':Varchar)) } stream_plan: | - StreamMaterialize { columns: [v1, mv.v2(hidden), mv.v3(hidden)], pk_columns: [v1, mv.v2, mv.v3] } + StreamMaterialize { columns: [v1, mv.v2(hidden), mv.v3(hidden)], pk_columns: [v1, mv.v2, mv.v3], pk_conflict: "no check" } └─StreamFilter { predicate: ((mv.v3 = 'world':Varchar) OR (mv.v3 = 'hello':Varchar)) } └─StreamTableScan { table: mv, columns: [mv.v1, mv.v2, mv.v3], pk: [mv.v1, mv.v2, mv.v3], dist: UpstreamHashShard(mv.v1, mv.v2, mv.v3) } diff --git a/src/frontend/planner_test/tests/testdata/predicate_pushdown.yaml b/src/frontend/planner_test/tests/testdata/predicate_pushdown.yaml index c98c825c600ff..e68f9ac5ef81f 100644 --- a/src/frontend/planner_test/tests/testdata/predicate_pushdown.yaml +++ b/src/frontend/planner_test/tests/testdata/predicate_pushdown.yaml @@ -261,7 +261,7 @@ | └─LogicalScan { table: t1, columns: [t1.v1] } └─LogicalScan { table: t2, columns: [t2.v2] } stream_plan: | - StreamMaterialize { columns: [v1, v2, t1._row_id(hidden), t2._row_id(hidden)], pk_columns: [t1._row_id, t2._row_id, v1, v2] } + StreamMaterialize { columns: [v1, v2, t1._row_id(hidden), t2._row_id(hidden)], pk_columns: [t1._row_id, t2._row_id, v1, v2], pk_conflict: "no check" } └─StreamHashJoin { type: Inner, predicate: t1.v1 = t2.v2, output: [t1.v1, t2.v2, t1._row_id, t2._row_id] } ├─StreamExchange { dist: HashShard(t1.v1) } | └─StreamDynamicFilter { predicate: (t1.v1 > $expr1), output: [t1.v1, t1._row_id] } @@ -301,7 +301,7 @@ LogicalFilter { predicate: (t1.v1 > (Now + '00:30:00':Interval)) } └─LogicalScan { table: t1, columns: [t1.v1, t1.v2], predicate: (t1.v2 > 5:Int32) } stream_plan: | - StreamMaterialize { columns: [v1, v2, t1._row_id(hidden)], pk_columns: [t1._row_id] } + StreamMaterialize { columns: [v1, v2, t1._row_id(hidden)], pk_columns: [t1._row_id], pk_conflict: "no check" } └─StreamDynamicFilter { predicate: (t1.v1 > $expr1), output: [t1.v1, t1.v2, t1._row_id] } ├─StreamFilter { predicate: (t1.v2 > 5:Int32) } | └─StreamTableScan { table: t1, columns: [t1.v1, t1.v2, t1._row_id], pk: [t1._row_id], dist: UpstreamHashShard(t1._row_id) } @@ -347,7 +347,7 @@ | └─LogicalScan { table: t1, columns: [t1.v1] } └─LogicalScan { table: t2, columns: [t2.v2] } stream_plan: | - StreamMaterialize { columns: [v1, v2, t1._row_id(hidden), t2._row_id(hidden)], pk_columns: [t1._row_id, t2._row_id, v1, v2] } + StreamMaterialize { columns: [v1, v2, t1._row_id(hidden), t2._row_id(hidden)], pk_columns: [t1._row_id, t2._row_id, v1, v2], pk_conflict: "no check" } └─StreamHashJoin { type: Inner, predicate: t1.v1 = t2.v2, output: [t1.v1, t2.v2, t1._row_id, t2._row_id] } ├─StreamExchange { dist: HashShard(t1.v1) } | └─StreamDynamicFilter { predicate: (t1.v1 > now), output: [t1.v1, t1._row_id] } diff --git a/src/frontend/planner_test/tests/testdata/project_set.yaml b/src/frontend/planner_test/tests/testdata/project_set.yaml index 03626a2da6ab6..6c3d4f496d951 100644 --- a/src/frontend/planner_test/tests/testdata/project_set.yaml +++ b/src/frontend/planner_test/tests/testdata/project_set.yaml @@ -26,7 +26,7 @@ └─BatchProjectSet { select_list: [Unnest($0)] } └─BatchScan { table: t, columns: [t.x, t._row_id], distribution: UpstreamHashShard(t._row_id) } stream_plan: | - StreamMaterialize { columns: [projected_row_id(hidden), unnest, t._row_id(hidden)], pk_columns: [t._row_id, projected_row_id] } + StreamMaterialize { columns: [projected_row_id(hidden), unnest, t._row_id(hidden)], pk_columns: [t._row_id, projected_row_id], pk_conflict: "no check" } └─StreamProjectSet { select_list: [Unnest($0), $1] } └─StreamTableScan { table: t, columns: [t.x, t._row_id], pk: [t._row_id], dist: UpstreamHashShard(t._row_id) } - name: table functions used with usual expressions @@ -67,7 +67,7 @@ └─BatchProjectSet { select_list: [$0, $1, Unnest($0), Unnest($0)] } └─BatchScan { table: t, columns: [t.x, t._row_id], distribution: UpstreamHashShard(t._row_id) } stream_plan: | - StreamMaterialize { columns: [projected_row_id(hidden), a, b, t._row_id(hidden), projected_row_id#1(hidden)], pk_columns: [t._row_id, projected_row_id#1, projected_row_id] } + StreamMaterialize { columns: [projected_row_id(hidden), a, b, t._row_id(hidden), projected_row_id#1(hidden)], pk_columns: [t._row_id, projected_row_id#1, projected_row_id], pk_conflict: "no check" } └─StreamProjectSet { select_list: [($3 * $4), Unnest($1), $2, $0] } └─StreamProjectSet { select_list: [$0, $1, Unnest($0), Unnest($0)] } └─StreamTableScan { table: t, columns: [t.x, t._row_id], pk: [t._row_id], dist: UpstreamHashShard(t._row_id) } @@ -94,7 +94,7 @@ └─BatchProjectSet { select_list: [Unnest($0)] } └─BatchScan { table: t, columns: [t.x, t._row_id], distribution: UpstreamHashShard(t._row_id) } stream_plan: | - StreamMaterialize { columns: [projected_row_id(hidden), unnest, t._row_id(hidden)], pk_columns: [t._row_id, projected_row_id], order_descs: [projected_row_id, t._row_id] } + StreamMaterialize { columns: [projected_row_id(hidden), unnest, t._row_id(hidden)], pk_columns: [t._row_id, projected_row_id], order_descs: [projected_row_id, t._row_id], pk_conflict: "no check" } └─StreamProject { exprs: [projected_row_id, Unnest($0), t._row_id] } └─StreamTopN { order: "[projected_row_id ASC]", limit: 1, offset: 0 } └─StreamExchange { dist: Single } @@ -114,7 +114,7 @@ └─BatchProjectSet { select_list: [Unnest($0)] } └─BatchScan { table: t, columns: [t.x, t._row_id], distribution: UpstreamHashShard(t._row_id) } stream_plan: | - StreamMaterialize { columns: [unnest], pk_columns: [unnest] } + StreamMaterialize { columns: [unnest], pk_columns: [unnest], pk_conflict: "no check" } └─StreamProject { exprs: [Unnest($0)] } └─StreamHashAgg { group_key: [Unnest($0)], aggs: [count] } └─StreamExchange { dist: HashShard(Unnest($0)) } @@ -130,7 +130,7 @@ └─BatchProjectSet { select_list: [Unnest($0)] } └─BatchScan { table: t, columns: [t.x, t._row_id], distribution: UpstreamHashShard(t._row_id) } stream_plan: | - StreamMaterialize { columns: [unnest, t._row_id(hidden), projected_row_id(hidden)], pk_columns: [t._row_id, projected_row_id] } + StreamMaterialize { columns: [unnest, t._row_id(hidden), projected_row_id(hidden)], pk_columns: [t._row_id, projected_row_id], pk_conflict: "no check" } └─StreamProject { exprs: [Unnest($0), t._row_id, projected_row_id] } └─StreamFilter { predicate: (Unnest($0) > 1:Int32) } └─StreamProjectSet { select_list: [Unnest($0), $1] } @@ -153,7 +153,7 @@ └─BatchProjectSet { select_list: [Unnest($0)] } └─BatchScan { table: t, columns: [t.x, t._row_id], distribution: UpstreamHashShard(t._row_id) } stream_plan: | - StreamMaterialize { columns: [unnest, t._row_id(hidden), projected_row_id(hidden), t._row_id#1(hidden), projected_row_id#1(hidden), Unnest($0)(hidden)], pk_columns: [t._row_id, projected_row_id, t._row_id#1, projected_row_id#1, unnest, Unnest($0)] } + StreamMaterialize { columns: [unnest, t._row_id(hidden), projected_row_id(hidden), t._row_id#1(hidden), projected_row_id#1(hidden), Unnest($0)(hidden)], pk_columns: [t._row_id, projected_row_id, t._row_id#1, projected_row_id#1, unnest, Unnest($0)], pk_conflict: "no check" } └─StreamHashJoin { type: Inner, predicate: Unnest($0) = Unnest($0), output: [Unnest($0), t._row_id, projected_row_id, t._row_id, projected_row_id, Unnest($0)] } ├─StreamExchange { dist: HashShard(Unnest($0)) } | └─StreamProject { exprs: [Unnest($0), t._row_id, projected_row_id] } diff --git a/src/frontend/planner_test/tests/testdata/share.yaml b/src/frontend/planner_test/tests/testdata/share.yaml index 0c8619f888f20..868ccc0c02c71 100644 --- a/src/frontend/planner_test/tests/testdata/share.yaml +++ b/src/frontend/planner_test/tests/testdata/share.yaml @@ -38,7 +38,7 @@ └─BatchFilter { predicate: ((initial_bid = 1:Int32) OR (initial_bid = 2:Int32)) } └─BatchSource { source: "auction", columns: ["id", "item_name", "description", "initial_bid", "reserve", "date_time", "expires", "seller", "category", "extra", "_row_id"], filter: (None, None) } stream_plan: | - StreamMaterialize { columns: [cnt], pk_columns: [] } + StreamMaterialize { columns: [cnt], pk_columns: [], pk_conflict: "no check" } └─StreamProject { exprs: [sum0(count)] } └─StreamAppendOnlyGlobalSimpleAgg { aggs: [count, sum0(count)] } └─StreamExchange { dist: Single } @@ -115,7 +115,7 @@ └─BatchProject { exprs: [auction, date_time] } └─BatchSource { source: "bid", columns: ["auction", "bidder", "price", "channel", "url", "date_time", "extra", "_row_id"], filter: (None, None) } stream_plan: | - StreamMaterialize { columns: [auction, num, window_start(hidden), window_start#1(hidden)], pk_columns: [window_start, auction, window_start#1] } + StreamMaterialize { columns: [auction, num, window_start(hidden), window_start#1(hidden)], pk_columns: [window_start, auction, window_start#1], pk_conflict: "no check" } └─StreamProject { exprs: [auction, count, window_start, window_start] } └─StreamFilter { predicate: (count >= max(count)) } └─StreamHashJoin { type: Inner, predicate: window_start = window_start, output: all } @@ -146,7 +146,7 @@ create table t(a int, b int); with cte as (select count(*) from t) select * from cte union all select * from cte; stream_plan: | - StreamMaterialize { columns: [count, 0:Int32(hidden)], pk_columns: [0:Int32] } + StreamMaterialize { columns: [count, 0:Int32(hidden)], pk_columns: [0:Int32], pk_conflict: "no check" } └─StreamUnion { all: true } ├─StreamExchange { dist: HashShard(0:Int32) } | └─StreamProject { exprs: [sum0(count), 0:Int32] } @@ -169,7 +169,7 @@ create table t(a int, b int); with cte as (select count(*) from t) select * from cte union all select * from cte; stream_plan: | - StreamMaterialize { columns: [count, 0:Int32(hidden)], pk_columns: [0:Int32] } + StreamMaterialize { columns: [count, 0:Int32(hidden)], pk_columns: [0:Int32], pk_conflict: "no check" } └─StreamUnion { all: true } ├─StreamExchange { dist: HashShard(0:Int32) } | └─StreamProject { exprs: [sum0(count), 0:Int32] } @@ -190,7 +190,7 @@ set rw_enable_share_plan=false; select count(*) cnt from auction A join auction B on A.id = B.id; stream_plan: | - StreamMaterialize { columns: [cnt], pk_columns: [] } + StreamMaterialize { columns: [cnt], pk_columns: [], pk_conflict: "no check" } └─StreamProject { exprs: [sum0(count)] } └─StreamAppendOnlyGlobalSimpleAgg { aggs: [count, sum0(count)] } └─StreamExchange { dist: Single } diff --git a/src/frontend/planner_test/tests/testdata/shared_views.yaml b/src/frontend/planner_test/tests/testdata/shared_views.yaml index 4e54ec97e0189..ff9326cbee7a8 100644 --- a/src/frontend/planner_test/tests/testdata/shared_views.yaml +++ b/src/frontend/planner_test/tests/testdata/shared_views.yaml @@ -22,7 +22,7 @@ └─LogicalFilter { predicate: (t1.y > 0:Int32) } └─LogicalScan { table: t1, columns: [t1.x, t1.y, t1._row_id] } stream_plan: | - StreamMaterialize { columns: [z, a, b, t1._row_id(hidden), t1._row_id#1(hidden), t1._row_id#2(hidden), t1.x(hidden), $expr90(hidden)], pk_columns: [t1._row_id, t1._row_id#1, t1._row_id#2, t1.x, $expr90, z, a] } + StreamMaterialize { columns: [z, a, b, t1._row_id(hidden), t1._row_id#1(hidden), t1._row_id#2(hidden), t1.x(hidden), $expr90(hidden)], pk_columns: [t1._row_id, t1._row_id#1, t1._row_id#2, t1.x, $expr90, z, a], pk_conflict: "no check" } └─StreamHashJoin { type: Inner, predicate: $expr1 = $expr2, output: [$expr1, $expr2, $expr3, t1._row_id, t1._row_id, t1._row_id, t1.x, $expr1] } ├─StreamExchange { dist: HashShard($expr1) } | └─StreamProject { exprs: [$expr1, t1._row_id] } diff --git a/src/frontend/planner_test/tests/testdata/stream_dist_agg.yaml b/src/frontend/planner_test/tests/testdata/stream_dist_agg.yaml index ac044ee5576dd..5cfb004b9e9fb 100644 --- a/src/frontend/planner_test/tests/testdata/stream_dist_agg.yaml +++ b/src/frontend/planner_test/tests/testdata/stream_dist_agg.yaml @@ -16,13 +16,13 @@ └─BatchSimpleAgg { aggs: [max(s.v)] } └─BatchScan { table: s, columns: [s.v], distribution: Single } stream_plan: | - StreamMaterialize { columns: [a1], pk_columns: [] } + StreamMaterialize { columns: [a1], pk_columns: [], pk_conflict: "no check" } └─StreamProject { exprs: [max(s.v)] } └─StreamGlobalSimpleAgg { aggs: [count, max(s.v)] } └─StreamTableScan { table: s, columns: [s.v, s.o, s.t._row_id], pk: [s.t._row_id], dist: Single } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [a1], pk_columns: [] } + StreamMaterialize { columns: [a1], pk_columns: [], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [max(s.v)] } StreamGlobalSimpleAgg { aggs: [count, max(s.v)] } @@ -44,13 +44,13 @@ └─BatchSimpleAgg { aggs: [sum(s.v)] } └─BatchScan { table: s, columns: [s.v], distribution: Single } stream_plan: | - StreamMaterialize { columns: [a1], pk_columns: [] } + StreamMaterialize { columns: [a1], pk_columns: [], pk_conflict: "no check" } └─StreamProject { exprs: [sum(s.v)] } └─StreamGlobalSimpleAgg { aggs: [count, sum(s.v)] } └─StreamTableScan { table: s, columns: [s.v, s.o, s.t._row_id], pk: [s.t._row_id], dist: Single } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [a1], pk_columns: [] } + StreamMaterialize { columns: [a1], pk_columns: [], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [sum(s.v)] } StreamGlobalSimpleAgg { aggs: [count, sum(s.v)] } @@ -71,13 +71,13 @@ └─BatchSimpleAgg { aggs: [count(s.v)] } └─BatchScan { table: s, columns: [s.v], distribution: Single } stream_plan: | - StreamMaterialize { columns: [a1], pk_columns: [] } + StreamMaterialize { columns: [a1], pk_columns: [], pk_conflict: "no check" } └─StreamProject { exprs: [count(s.v)] } └─StreamGlobalSimpleAgg { aggs: [count, count(s.v)] } └─StreamTableScan { table: s, columns: [s.v, s.o, s.t._row_id], pk: [s.t._row_id], dist: Single } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [a1], pk_columns: [] } + StreamMaterialize { columns: [a1], pk_columns: [], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [count(s.v)] } StreamGlobalSimpleAgg { aggs: [count, count(s.v)] } @@ -99,14 +99,14 @@ └─BatchProject { exprs: [s.s, ',':Varchar, s.v] } └─BatchScan { table: s, columns: [s.v, s.s], distribution: Single } stream_plan: | - StreamMaterialize { columns: [a1], pk_columns: [] } + StreamMaterialize { columns: [a1], pk_columns: [], pk_conflict: "no check" } └─StreamProject { exprs: [string_agg(s.s, ',':Varchar order_by(s.v ASC NULLS LAST))] } └─StreamGlobalSimpleAgg { aggs: [count, string_agg(s.s, ',':Varchar order_by(s.v ASC NULLS LAST))] } └─StreamProject { exprs: [s.s, ',':Varchar, s.v, s.t._row_id] } └─StreamTableScan { table: s, columns: [s.v, s.s, s.o, s.t._row_id], pk: [s.t._row_id], dist: Single } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [a1], pk_columns: [] } + StreamMaterialize { columns: [a1], pk_columns: [], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [string_agg(s.s, ',':Varchar order_by(s.v ASC NULLS LAST))] } StreamGlobalSimpleAgg { aggs: [count, string_agg(s.s, ',':Varchar order_by(s.v ASC NULLS LAST))] } @@ -130,7 +130,7 @@ └─BatchSimpleAgg { aggs: [max(t.v)] } └─BatchScan { table: t, columns: [t.v], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [a1], pk_columns: [] } + StreamMaterialize { columns: [a1], pk_columns: [], pk_conflict: "no check" } └─StreamProject { exprs: [max(max(t.v))] } └─StreamGlobalSimpleAgg { aggs: [count, max(max(t.v))] } └─StreamExchange { dist: Single } @@ -139,7 +139,7 @@ └─StreamTableScan { table: t, columns: [t.v, t._row_id], pk: [t._row_id], dist: UpstreamHashShard(t._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [a1], pk_columns: [] } + StreamMaterialize { columns: [a1], pk_columns: [], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [max(max(t.v))] } StreamGlobalSimpleAgg { aggs: [count, max(max(t.v))] } @@ -165,7 +165,7 @@ sql: | select max(v) as a1 from AO; stream_plan: | - StreamMaterialize { columns: [a1], pk_columns: [] } + StreamMaterialize { columns: [a1], pk_columns: [], pk_conflict: "no check" } └─StreamProject { exprs: [max(max(ao.v))] } └─StreamAppendOnlyGlobalSimpleAgg { aggs: [count, max(max(ao.v))] } └─StreamExchange { dist: Single } @@ -173,7 +173,7 @@ └─StreamTableScan { table: ao, columns: [ao.v, ao._row_id], pk: [ao._row_id], dist: UpstreamHashShard(ao._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [a1], pk_columns: [] } + StreamMaterialize { columns: [a1], pk_columns: [], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [max(max(ao.v))] } StreamAppendOnlyGlobalSimpleAgg { aggs: [count, max(max(ao.v))] } @@ -199,7 +199,7 @@ └─BatchSimpleAgg { aggs: [sum(t.v)] } └─BatchScan { table: t, columns: [t.v], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [a1], pk_columns: [] } + StreamMaterialize { columns: [a1], pk_columns: [], pk_conflict: "no check" } └─StreamProject { exprs: [sum(sum(t.v))] } └─StreamGlobalSimpleAgg { aggs: [count, sum(sum(t.v))] } └─StreamExchange { dist: Single } @@ -207,7 +207,7 @@ └─StreamTableScan { table: t, columns: [t.v, t._row_id], pk: [t._row_id], dist: UpstreamHashShard(t._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [a1], pk_columns: [] } + StreamMaterialize { columns: [a1], pk_columns: [], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [sum(sum(t.v))] } StreamGlobalSimpleAgg { aggs: [count, sum(sum(t.v))] } @@ -228,7 +228,7 @@ sql: | select sum(v) as a1 from AO; stream_plan: | - StreamMaterialize { columns: [a1], pk_columns: [] } + StreamMaterialize { columns: [a1], pk_columns: [], pk_conflict: "no check" } └─StreamProject { exprs: [sum(sum(ao.v))] } └─StreamAppendOnlyGlobalSimpleAgg { aggs: [count, sum(sum(ao.v))] } └─StreamExchange { dist: Single } @@ -236,7 +236,7 @@ └─StreamTableScan { table: ao, columns: [ao.v, ao._row_id], pk: [ao._row_id], dist: UpstreamHashShard(ao._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [a1], pk_columns: [] } + StreamMaterialize { columns: [a1], pk_columns: [], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [sum(sum(ao.v))] } StreamAppendOnlyGlobalSimpleAgg { aggs: [count, sum(sum(ao.v))] } @@ -262,7 +262,7 @@ └─BatchSimpleAgg { aggs: [count(t.v)] } └─BatchScan { table: t, columns: [t.v], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [a1], pk_columns: [] } + StreamMaterialize { columns: [a1], pk_columns: [], pk_conflict: "no check" } └─StreamProject { exprs: [sum0(count(t.v))] } └─StreamGlobalSimpleAgg { aggs: [count, sum0(count(t.v))] } └─StreamExchange { dist: Single } @@ -270,7 +270,7 @@ └─StreamTableScan { table: t, columns: [t.v, t._row_id], pk: [t._row_id], dist: UpstreamHashShard(t._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [a1], pk_columns: [] } + StreamMaterialize { columns: [a1], pk_columns: [], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [sum0(count(t.v))] } StreamGlobalSimpleAgg { aggs: [count, sum0(count(t.v))] } @@ -291,7 +291,7 @@ sql: | select count(v) as a1 from AO; stream_plan: | - StreamMaterialize { columns: [a1], pk_columns: [] } + StreamMaterialize { columns: [a1], pk_columns: [], pk_conflict: "no check" } └─StreamProject { exprs: [sum0(count(ao.v))] } └─StreamAppendOnlyGlobalSimpleAgg { aggs: [count, sum0(count(ao.v))] } └─StreamExchange { dist: Single } @@ -299,7 +299,7 @@ └─StreamTableScan { table: ao, columns: [ao.v, ao._row_id], pk: [ao._row_id], dist: UpstreamHashShard(ao._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [a1], pk_columns: [] } + StreamMaterialize { columns: [a1], pk_columns: [], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [sum0(count(ao.v))] } StreamAppendOnlyGlobalSimpleAgg { aggs: [count, sum0(count(ao.v))] } @@ -325,7 +325,7 @@ └─BatchProject { exprs: [t.s, ',':Varchar, t.o] } └─BatchScan { table: t, columns: [t.o, t.s], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [a1], pk_columns: [] } + StreamMaterialize { columns: [a1], pk_columns: [], pk_conflict: "no check" } └─StreamProject { exprs: [string_agg(t.s, ',':Varchar order_by(t.o ASC NULLS LAST))] } └─StreamGlobalSimpleAgg { aggs: [count, string_agg(t.s, ',':Varchar order_by(t.o ASC NULLS LAST))] } └─StreamExchange { dist: Single } @@ -333,7 +333,7 @@ └─StreamTableScan { table: t, columns: [t.o, t.s, t._row_id], pk: [t._row_id], dist: UpstreamHashShard(t._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [a1], pk_columns: [] } + StreamMaterialize { columns: [a1], pk_columns: [], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [string_agg(t.s, ',':Varchar order_by(t.o ASC NULLS LAST))] } StreamGlobalSimpleAgg { aggs: [count, string_agg(t.s, ',':Varchar order_by(t.o ASC NULLS LAST))] } @@ -355,7 +355,7 @@ sql: | select string_agg(s, ',' order by o) as a1 from AO; stream_plan: | - StreamMaterialize { columns: [a1], pk_columns: [] } + StreamMaterialize { columns: [a1], pk_columns: [], pk_conflict: "no check" } └─StreamProject { exprs: [string_agg(ao.s, ',':Varchar order_by(ao.o ASC NULLS LAST))] } └─StreamAppendOnlyGlobalSimpleAgg { aggs: [count, string_agg(ao.s, ',':Varchar order_by(ao.o ASC NULLS LAST))] } └─StreamExchange { dist: Single } @@ -363,7 +363,7 @@ └─StreamTableScan { table: ao, columns: [ao.o, ao.s, ao._row_id], pk: [ao._row_id], dist: UpstreamHashShard(ao._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [a1], pk_columns: [] } + StreamMaterialize { columns: [a1], pk_columns: [], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [string_agg(ao.s, ',':Varchar order_by(ao.o ASC NULLS LAST))] } StreamAppendOnlyGlobalSimpleAgg { aggs: [count, string_agg(ao.s, ',':Varchar order_by(ao.o ASC NULLS LAST))] } @@ -389,7 +389,7 @@ └─BatchSimpleAgg { aggs: [max(t.v), count(t.v)] } └─BatchScan { table: t, columns: [t.v], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [a1, a2], pk_columns: [] } + StreamMaterialize { columns: [a1, a2], pk_columns: [], pk_conflict: "no check" } └─StreamProject { exprs: [max(max(t.v)), sum0(count(t.v))] } └─StreamGlobalSimpleAgg { aggs: [count, max(max(t.v)), sum0(count(t.v))] } └─StreamExchange { dist: Single } @@ -398,7 +398,7 @@ └─StreamTableScan { table: t, columns: [t.v, t._row_id], pk: [t._row_id], dist: UpstreamHashShard(t._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [a1, a2], pk_columns: [] } + StreamMaterialize { columns: [a1, a2], pk_columns: [], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [max(max(t.v)), sum0(count(t.v))] } StreamGlobalSimpleAgg { aggs: [count, max(max(t.v)), sum0(count(t.v))] } @@ -424,7 +424,7 @@ sql: | select max(v) as a1, count(v) as a2 from AO; stream_plan: | - StreamMaterialize { columns: [a1, a2], pk_columns: [] } + StreamMaterialize { columns: [a1, a2], pk_columns: [], pk_conflict: "no check" } └─StreamProject { exprs: [max(max(ao.v)), sum0(count(ao.v))] } └─StreamAppendOnlyGlobalSimpleAgg { aggs: [count, max(max(ao.v)), sum0(count(ao.v))] } └─StreamExchange { dist: Single } @@ -432,7 +432,7 @@ └─StreamTableScan { table: ao, columns: [ao.v, ao._row_id], pk: [ao._row_id], dist: UpstreamHashShard(ao._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [a1, a2], pk_columns: [] } + StreamMaterialize { columns: [a1, a2], pk_columns: [], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [max(max(ao.v)), sum0(count(ao.v))] } StreamAppendOnlyGlobalSimpleAgg { aggs: [count, max(max(ao.v)), sum0(count(ao.v))] } @@ -458,7 +458,7 @@ └─BatchProject { exprs: [t.v, t.s, ',':Varchar, t.o] } └─BatchScan { table: t, columns: [t.v, t.o, t.s], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [a1, a2], pk_columns: [] } + StreamMaterialize { columns: [a1, a2], pk_columns: [], pk_conflict: "no check" } └─StreamProject { exprs: [count(t.v), string_agg(t.s, ',':Varchar order_by(t.o ASC NULLS LAST))] } └─StreamGlobalSimpleAgg { aggs: [count, count(t.v), string_agg(t.s, ',':Varchar order_by(t.o ASC NULLS LAST))] } └─StreamExchange { dist: Single } @@ -466,7 +466,7 @@ └─StreamTableScan { table: t, columns: [t.v, t.o, t.s, t._row_id], pk: [t._row_id], dist: UpstreamHashShard(t._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [a1, a2], pk_columns: [] } + StreamMaterialize { columns: [a1, a2], pk_columns: [], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [count(t.v), string_agg(t.s, ',':Varchar order_by(t.o ASC NULLS LAST))] } StreamGlobalSimpleAgg { aggs: [count, count(t.v), string_agg(t.s, ',':Varchar order_by(t.o ASC NULLS LAST))] } @@ -488,7 +488,7 @@ sql: | select count(v) as a1, string_agg(s, ',' order by o) as a2 from AO; stream_plan: | - StreamMaterialize { columns: [a1, a2], pk_columns: [] } + StreamMaterialize { columns: [a1, a2], pk_columns: [], pk_conflict: "no check" } └─StreamProject { exprs: [count(ao.v), string_agg(ao.s, ',':Varchar order_by(ao.o ASC NULLS LAST))] } └─StreamAppendOnlyGlobalSimpleAgg { aggs: [count, count(ao.v), string_agg(ao.s, ',':Varchar order_by(ao.o ASC NULLS LAST))] } └─StreamExchange { dist: Single } @@ -496,7 +496,7 @@ └─StreamTableScan { table: ao, columns: [ao.v, ao.o, ao.s, ao._row_id], pk: [ao._row_id], dist: UpstreamHashShard(ao._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [a1, a2], pk_columns: [] } + StreamMaterialize { columns: [a1, a2], pk_columns: [], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [count(ao.v), string_agg(ao.s, ',':Varchar order_by(ao.o ASC NULLS LAST))] } StreamAppendOnlyGlobalSimpleAgg { aggs: [count, count(ao.v), string_agg(ao.s, ',':Varchar order_by(ao.o ASC NULLS LAST))] } @@ -522,7 +522,7 @@ └─BatchProject { exprs: [t.v, t.s, ',':Varchar, t.o] } └─BatchScan { table: t, columns: [t.v, t.o, t.s], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [a1, a2], pk_columns: [] } + StreamMaterialize { columns: [a1, a2], pk_columns: [], pk_conflict: "no check" } └─StreamProject { exprs: [max(t.v), string_agg(t.s, ',':Varchar order_by(t.o ASC NULLS LAST))] } └─StreamGlobalSimpleAgg { aggs: [count, max(t.v), string_agg(t.s, ',':Varchar order_by(t.o ASC NULLS LAST))] } └─StreamExchange { dist: Single } @@ -530,7 +530,7 @@ └─StreamTableScan { table: t, columns: [t.v, t.o, t.s, t._row_id], pk: [t._row_id], dist: UpstreamHashShard(t._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [a1, a2], pk_columns: [] } + StreamMaterialize { columns: [a1, a2], pk_columns: [], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [max(t.v), string_agg(t.s, ',':Varchar order_by(t.o ASC NULLS LAST))] } StreamGlobalSimpleAgg { aggs: [count, max(t.v), string_agg(t.s, ',':Varchar order_by(t.o ASC NULLS LAST))] } @@ -553,7 +553,7 @@ sql: | select max(v) as a1, string_agg(s, ',' order by o) as a2 from AO; stream_plan: | - StreamMaterialize { columns: [a1, a2], pk_columns: [] } + StreamMaterialize { columns: [a1, a2], pk_columns: [], pk_conflict: "no check" } └─StreamProject { exprs: [max(ao.v), string_agg(ao.s, ',':Varchar order_by(ao.o ASC NULLS LAST))] } └─StreamAppendOnlyGlobalSimpleAgg { aggs: [count, max(ao.v), string_agg(ao.s, ',':Varchar order_by(ao.o ASC NULLS LAST))] } └─StreamExchange { dist: Single } @@ -561,7 +561,7 @@ └─StreamTableScan { table: ao, columns: [ao.v, ao.o, ao.s, ao._row_id], pk: [ao._row_id], dist: UpstreamHashShard(ao._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [a1, a2], pk_columns: [] } + StreamMaterialize { columns: [a1, a2], pk_columns: [], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [max(ao.v), string_agg(ao.s, ',':Varchar order_by(ao.o ASC NULLS LAST))] } StreamAppendOnlyGlobalSimpleAgg { aggs: [count, max(ao.v), string_agg(ao.s, ',':Varchar order_by(ao.o ASC NULLS LAST))] } @@ -588,14 +588,14 @@ └─BatchExchange { order: [], dist: HashShard(t.k) } └─BatchScan { table: t, columns: [t.k, t.v], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [a1, t.k(hidden)], pk_columns: [t.k] } + StreamMaterialize { columns: [a1, t.k(hidden)], pk_columns: [t.k], pk_conflict: "no check" } └─StreamProject { exprs: [max(t.v), t.k] } └─StreamHashAgg { group_key: [t.k], aggs: [count, max(t.v)] } └─StreamExchange { dist: HashShard(t.k) } └─StreamTableScan { table: t, columns: [t.k, t.v, t._row_id], pk: [t._row_id], dist: UpstreamHashShard(t._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [a1, t.k(hidden)], pk_columns: [t.k] } + StreamMaterialize { columns: [a1, t.k(hidden)], pk_columns: [t.k], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [max(t.v), t.k] } StreamHashAgg { group_key: [t.k], aggs: [count, max(t.v)] } @@ -621,13 +621,13 @@ └─BatchSortAgg { group_key: [tk.k], aggs: [max(tk.v)] } └─BatchScan { table: tk, columns: [tk.k, tk.v], distribution: UpstreamHashShard(tk.k) } stream_plan: | - StreamMaterialize { columns: [a1, tk.k(hidden)], pk_columns: [tk.k] } + StreamMaterialize { columns: [a1, tk.k(hidden)], pk_columns: [tk.k], pk_conflict: "no check" } └─StreamProject { exprs: [max(tk.v), tk.k] } └─StreamHashAgg { group_key: [tk.k], aggs: [count, max(tk.v)] } └─StreamTableScan { table: tk, columns: [tk.k, tk.v, tk.t._row_id], pk: [tk.t._row_id], dist: UpstreamHashShard(tk.k) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [a1, tk.k(hidden)], pk_columns: [tk.k] } + StreamMaterialize { columns: [a1, tk.k(hidden)], pk_columns: [tk.k], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [max(tk.v), tk.k] } StreamHashAgg { group_key: [tk.k], aggs: [count, max(tk.v)] } @@ -651,14 +651,14 @@ └─BatchExchange { order: [], dist: HashShard(s.k) } └─BatchScan { table: s, columns: [s.k, s.v], distribution: Single } stream_plan: | - StreamMaterialize { columns: [a1, s.k(hidden)], pk_columns: [s.k] } + StreamMaterialize { columns: [a1, s.k(hidden)], pk_columns: [s.k], pk_conflict: "no check" } └─StreamProject { exprs: [max(s.v), s.k] } └─StreamHashAgg { group_key: [s.k], aggs: [count, max(s.v)] } └─StreamExchange { dist: HashShard(s.k) } └─StreamTableScan { table: s, columns: [s.k, s.v, s.o, s.t._row_id], pk: [s.t._row_id], dist: Single } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [a1, s.k(hidden)], pk_columns: [s.k] } + StreamMaterialize { columns: [a1, s.k(hidden)], pk_columns: [s.k], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [max(s.v), s.k] } StreamHashAgg { group_key: [s.k], aggs: [count, max(s.v)] } @@ -679,14 +679,14 @@ sql: | select max(v) as a1 from AO group by k; stream_plan: | - StreamMaterialize { columns: [a1, ao.k(hidden)], pk_columns: [ao.k] } + StreamMaterialize { columns: [a1, ao.k(hidden)], pk_columns: [ao.k], pk_conflict: "no check" } └─StreamProject { exprs: [max(ao.v), ao.k] } └─StreamAppendOnlyHashAgg { group_key: [ao.k], aggs: [count, max(ao.v)] } └─StreamExchange { dist: HashShard(ao.k) } └─StreamTableScan { table: ao, columns: [ao.k, ao.v, ao._row_id], pk: [ao._row_id], dist: UpstreamHashShard(ao._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [a1, ao.k(hidden)], pk_columns: [ao.k] } + StreamMaterialize { columns: [a1, ao.k(hidden)], pk_columns: [ao.k], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [max(ao.v), ao.k] } StreamAppendOnlyHashAgg { group_key: [ao.k], aggs: [count, max(ao.v)] } @@ -712,14 +712,14 @@ └─BatchExchange { order: [], dist: HashShard(t.k) } └─BatchScan { table: t, columns: [t.k, t.v], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [a1, t.k(hidden)], pk_columns: [t.k] } + StreamMaterialize { columns: [a1, t.k(hidden)], pk_columns: [t.k], pk_conflict: "no check" } └─StreamProject { exprs: [sum(t.v), t.k] } └─StreamHashAgg { group_key: [t.k], aggs: [count, sum(t.v)] } └─StreamExchange { dist: HashShard(t.k) } └─StreamTableScan { table: t, columns: [t.k, t.v, t._row_id], pk: [t._row_id], dist: UpstreamHashShard(t._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [a1, t.k(hidden)], pk_columns: [t.k] } + StreamMaterialize { columns: [a1, t.k(hidden)], pk_columns: [t.k], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [sum(t.v), t.k] } StreamHashAgg { group_key: [t.k], aggs: [count, sum(t.v)] } @@ -744,13 +744,13 @@ └─BatchSortAgg { group_key: [tk.k], aggs: [sum(tk.v)] } └─BatchScan { table: tk, columns: [tk.k, tk.v], distribution: UpstreamHashShard(tk.k) } stream_plan: | - StreamMaterialize { columns: [a1, tk.k(hidden)], pk_columns: [tk.k] } + StreamMaterialize { columns: [a1, tk.k(hidden)], pk_columns: [tk.k], pk_conflict: "no check" } └─StreamProject { exprs: [sum(tk.v), tk.k] } └─StreamHashAgg { group_key: [tk.k], aggs: [count, sum(tk.v)] } └─StreamTableScan { table: tk, columns: [tk.k, tk.v, tk.t._row_id], pk: [tk.t._row_id], dist: UpstreamHashShard(tk.k) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [a1, tk.k(hidden)], pk_columns: [tk.k] } + StreamMaterialize { columns: [a1, tk.k(hidden)], pk_columns: [tk.k], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [sum(tk.v), tk.k] } StreamHashAgg { group_key: [tk.k], aggs: [count, sum(tk.v)] } @@ -773,14 +773,14 @@ └─BatchExchange { order: [], dist: HashShard(s.k) } └─BatchScan { table: s, columns: [s.k, s.v], distribution: Single } stream_plan: | - StreamMaterialize { columns: [a1, s.k(hidden)], pk_columns: [s.k] } + StreamMaterialize { columns: [a1, s.k(hidden)], pk_columns: [s.k], pk_conflict: "no check" } └─StreamProject { exprs: [sum(s.v), s.k] } └─StreamHashAgg { group_key: [s.k], aggs: [count, sum(s.v)] } └─StreamExchange { dist: HashShard(s.k) } └─StreamTableScan { table: s, columns: [s.k, s.v, s.o, s.t._row_id], pk: [s.t._row_id], dist: Single } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [a1, s.k(hidden)], pk_columns: [s.k] } + StreamMaterialize { columns: [a1, s.k(hidden)], pk_columns: [s.k], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [sum(s.v), s.k] } StreamHashAgg { group_key: [s.k], aggs: [count, sum(s.v)] } @@ -800,14 +800,14 @@ sql: | select sum(v) as a1 from AO group by k; stream_plan: | - StreamMaterialize { columns: [a1, ao.k(hidden)], pk_columns: [ao.k] } + StreamMaterialize { columns: [a1, ao.k(hidden)], pk_columns: [ao.k], pk_conflict: "no check" } └─StreamProject { exprs: [sum(ao.v), ao.k] } └─StreamAppendOnlyHashAgg { group_key: [ao.k], aggs: [count, sum(ao.v)] } └─StreamExchange { dist: HashShard(ao.k) } └─StreamTableScan { table: ao, columns: [ao.k, ao.v, ao._row_id], pk: [ao._row_id], dist: UpstreamHashShard(ao._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [a1, ao.k(hidden)], pk_columns: [ao.k] } + StreamMaterialize { columns: [a1, ao.k(hidden)], pk_columns: [ao.k], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [sum(ao.v), ao.k] } StreamAppendOnlyHashAgg { group_key: [ao.k], aggs: [count, sum(ao.v)] } @@ -833,14 +833,14 @@ └─BatchExchange { order: [], dist: HashShard(t.k) } └─BatchScan { table: t, columns: [t.k, t.v], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [a1, t.k(hidden)], pk_columns: [t.k] } + StreamMaterialize { columns: [a1, t.k(hidden)], pk_columns: [t.k], pk_conflict: "no check" } └─StreamProject { exprs: [count(t.v), t.k] } └─StreamHashAgg { group_key: [t.k], aggs: [count, count(t.v)] } └─StreamExchange { dist: HashShard(t.k) } └─StreamTableScan { table: t, columns: [t.k, t.v, t._row_id], pk: [t._row_id], dist: UpstreamHashShard(t._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [a1, t.k(hidden)], pk_columns: [t.k] } + StreamMaterialize { columns: [a1, t.k(hidden)], pk_columns: [t.k], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [count(t.v), t.k] } StreamHashAgg { group_key: [t.k], aggs: [count, count(t.v)] } @@ -865,13 +865,13 @@ └─BatchSortAgg { group_key: [tk.k], aggs: [count(tk.v)] } └─BatchScan { table: tk, columns: [tk.k, tk.v], distribution: UpstreamHashShard(tk.k) } stream_plan: | - StreamMaterialize { columns: [a1, tk.k(hidden)], pk_columns: [tk.k] } + StreamMaterialize { columns: [a1, tk.k(hidden)], pk_columns: [tk.k], pk_conflict: "no check" } └─StreamProject { exprs: [count(tk.v), tk.k] } └─StreamHashAgg { group_key: [tk.k], aggs: [count, count(tk.v)] } └─StreamTableScan { table: tk, columns: [tk.k, tk.v, tk.t._row_id], pk: [tk.t._row_id], dist: UpstreamHashShard(tk.k) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [a1, tk.k(hidden)], pk_columns: [tk.k] } + StreamMaterialize { columns: [a1, tk.k(hidden)], pk_columns: [tk.k], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [count(tk.v), tk.k] } StreamHashAgg { group_key: [tk.k], aggs: [count, count(tk.v)] } @@ -894,14 +894,14 @@ └─BatchExchange { order: [], dist: HashShard(s.k) } └─BatchScan { table: s, columns: [s.k, s.v], distribution: Single } stream_plan: | - StreamMaterialize { columns: [a1, s.k(hidden)], pk_columns: [s.k] } + StreamMaterialize { columns: [a1, s.k(hidden)], pk_columns: [s.k], pk_conflict: "no check" } └─StreamProject { exprs: [count(s.v), s.k] } └─StreamHashAgg { group_key: [s.k], aggs: [count, count(s.v)] } └─StreamExchange { dist: HashShard(s.k) } └─StreamTableScan { table: s, columns: [s.k, s.v, s.o, s.t._row_id], pk: [s.t._row_id], dist: Single } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [a1, s.k(hidden)], pk_columns: [s.k] } + StreamMaterialize { columns: [a1, s.k(hidden)], pk_columns: [s.k], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [count(s.v), s.k] } StreamHashAgg { group_key: [s.k], aggs: [count, count(s.v)] } @@ -921,14 +921,14 @@ sql: | select count(v) as a1 from AO group by k; stream_plan: | - StreamMaterialize { columns: [a1, ao.k(hidden)], pk_columns: [ao.k] } + StreamMaterialize { columns: [a1, ao.k(hidden)], pk_columns: [ao.k], pk_conflict: "no check" } └─StreamProject { exprs: [count(ao.v), ao.k] } └─StreamAppendOnlyHashAgg { group_key: [ao.k], aggs: [count, count(ao.v)] } └─StreamExchange { dist: HashShard(ao.k) } └─StreamTableScan { table: ao, columns: [ao.k, ao.v, ao._row_id], pk: [ao._row_id], dist: UpstreamHashShard(ao._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [a1, ao.k(hidden)], pk_columns: [ao.k] } + StreamMaterialize { columns: [a1, ao.k(hidden)], pk_columns: [ao.k], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [count(ao.v), ao.k] } StreamAppendOnlyHashAgg { group_key: [ao.k], aggs: [count, count(ao.v)] } @@ -955,7 +955,7 @@ └─BatchProject { exprs: [t.k, t.s, ',':Varchar, t.o] } └─BatchScan { table: t, columns: [t.k, t.o, t.s], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [a1, t.k(hidden)], pk_columns: [t.k] } + StreamMaterialize { columns: [a1, t.k(hidden)], pk_columns: [t.k], pk_conflict: "no check" } └─StreamProject { exprs: [string_agg(t.s, ',':Varchar order_by(t.o ASC NULLS LAST)), t.k] } └─StreamHashAgg { group_key: [t.k], aggs: [count, string_agg(t.s, ',':Varchar order_by(t.o ASC NULLS LAST))] } └─StreamExchange { dist: HashShard(t.k) } @@ -963,7 +963,7 @@ └─StreamTableScan { table: t, columns: [t.k, t.o, t.s, t._row_id], pk: [t._row_id], dist: UpstreamHashShard(t._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [a1, t.k(hidden)], pk_columns: [t.k] } + StreamMaterialize { columns: [a1, t.k(hidden)], pk_columns: [t.k], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [string_agg(t.s, ',':Varchar order_by(t.o ASC NULLS LAST)), t.k] } StreamHashAgg { group_key: [t.k], aggs: [count, string_agg(t.s, ',':Varchar order_by(t.o ASC NULLS LAST))] } @@ -991,14 +991,14 @@ └─BatchProject { exprs: [tk.k, tk.s, ',':Varchar, tk.o] } └─BatchScan { table: tk, columns: [tk.k, tk.o, tk.s], distribution: UpstreamHashShard(tk.k) } stream_plan: | - StreamMaterialize { columns: [a1, tk.k(hidden)], pk_columns: [tk.k] } + StreamMaterialize { columns: [a1, tk.k(hidden)], pk_columns: [tk.k], pk_conflict: "no check" } └─StreamProject { exprs: [string_agg(tk.s, ',':Varchar order_by(tk.o ASC NULLS LAST)), tk.k] } └─StreamHashAgg { group_key: [tk.k], aggs: [count, string_agg(tk.s, ',':Varchar order_by(tk.o ASC NULLS LAST))] } └─StreamProject { exprs: [tk.k, tk.s, ',':Varchar, tk.o, tk.t._row_id] } └─StreamTableScan { table: tk, columns: [tk.k, tk.o, tk.s, tk.t._row_id], pk: [tk.t._row_id], dist: UpstreamHashShard(tk.k) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [a1, tk.k(hidden)], pk_columns: [tk.k] } + StreamMaterialize { columns: [a1, tk.k(hidden)], pk_columns: [tk.k], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [string_agg(tk.s, ',':Varchar order_by(tk.o ASC NULLS LAST)), tk.k] } StreamHashAgg { group_key: [tk.k], aggs: [count, string_agg(tk.s, ',':Varchar order_by(tk.o ASC NULLS LAST))] } @@ -1024,7 +1024,7 @@ └─BatchProject { exprs: [s.k, s.s, ',':Varchar, s.o] } └─BatchScan { table: s, columns: [s.k, s.o, s.s], distribution: Single } stream_plan: | - StreamMaterialize { columns: [a1, s.k(hidden)], pk_columns: [s.k] } + StreamMaterialize { columns: [a1, s.k(hidden)], pk_columns: [s.k], pk_conflict: "no check" } └─StreamProject { exprs: [string_agg(s.s, ',':Varchar order_by(s.o ASC NULLS LAST)), s.k] } └─StreamHashAgg { group_key: [s.k], aggs: [count, string_agg(s.s, ',':Varchar order_by(s.o ASC NULLS LAST))] } └─StreamExchange { dist: HashShard(s.k) } @@ -1032,7 +1032,7 @@ └─StreamTableScan { table: s, columns: [s.k, s.o, s.s, s.t._row_id], pk: [s.t._row_id], dist: Single } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [a1, s.k(hidden)], pk_columns: [s.k] } + StreamMaterialize { columns: [a1, s.k(hidden)], pk_columns: [s.k], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [string_agg(s.s, ',':Varchar order_by(s.o ASC NULLS LAST)), s.k] } StreamHashAgg { group_key: [s.k], aggs: [count, string_agg(s.s, ',':Varchar order_by(s.o ASC NULLS LAST))] } @@ -1054,7 +1054,7 @@ sql: | select string_agg(s, ',' order by o) as a1 from AO group by k; stream_plan: | - StreamMaterialize { columns: [a1, ao.k(hidden)], pk_columns: [ao.k] } + StreamMaterialize { columns: [a1, ao.k(hidden)], pk_columns: [ao.k], pk_conflict: "no check" } └─StreamProject { exprs: [string_agg(ao.s, ',':Varchar order_by(ao.o ASC NULLS LAST)), ao.k] } └─StreamAppendOnlyHashAgg { group_key: [ao.k], aggs: [count, string_agg(ao.s, ',':Varchar order_by(ao.o ASC NULLS LAST))] } └─StreamExchange { dist: HashShard(ao.k) } @@ -1062,7 +1062,7 @@ └─StreamTableScan { table: ao, columns: [ao.k, ao.o, ao.s, ao._row_id], pk: [ao._row_id], dist: UpstreamHashShard(ao._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [a1, ao.k(hidden)], pk_columns: [ao.k] } + StreamMaterialize { columns: [a1, ao.k(hidden)], pk_columns: [ao.k], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [string_agg(ao.s, ',':Varchar order_by(ao.o ASC NULLS LAST)), ao.k] } StreamAppendOnlyHashAgg { group_key: [ao.k], aggs: [count, string_agg(ao.s, ',':Varchar order_by(ao.o ASC NULLS LAST))] } diff --git a/src/frontend/planner_test/tests/testdata/struct_query.yaml b/src/frontend/planner_test/tests/testdata/struct_query.yaml index 8d90395ecceb9..3ba6dbe2fcb8c 100644 --- a/src/frontend/planner_test/tests/testdata/struct_query.yaml +++ b/src/frontend/planner_test/tests/testdata/struct_query.yaml @@ -6,7 +6,7 @@ BatchExchange { order: [], dist: Single } └─BatchScan { table: t, columns: [t.country], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [country, t._row_id(hidden)], pk_columns: [t._row_id] } + StreamMaterialize { columns: [country, t._row_id(hidden)], pk_columns: [t._row_id], pk_conflict: "no check" } └─StreamTableScan { table: t, columns: [t.country, t._row_id], pk: [t._row_id], dist: UpstreamHashShard(t._row_id) } create_source: row_format: protobuf diff --git a/src/frontend/planner_test/tests/testdata/temporal_filter.yaml b/src/frontend/planner_test/tests/testdata/temporal_filter.yaml index 41fdd3835a5f1..13850fe1188cb 100644 --- a/src/frontend/planner_test/tests/testdata/temporal_filter.yaml +++ b/src/frontend/planner_test/tests/testdata/temporal_filter.yaml @@ -4,7 +4,7 @@ create table t1 (ts timestamp with time zone); select * from t1 where ts + interval '1 hour' > now(); stream_plan: | - StreamMaterialize { columns: [ts, t1._row_id(hidden)], pk_columns: [t1._row_id] } + StreamMaterialize { columns: [ts, t1._row_id(hidden)], pk_columns: [t1._row_id], pk_conflict: "no check" } └─StreamProject { exprs: [t1.ts, t1._row_id] } └─StreamDynamicFilter { predicate: ($expr1 > now), output: [t1.ts, $expr1, t1._row_id] } ├─StreamProject { exprs: [t1.ts, (AtTimeZone((AtTimeZone(t1.ts, 'UTC':Varchar) + '00:00:00':Interval), 'UTC':Varchar) + '01:00:00':Interval) as $expr1, t1._row_id] } @@ -16,7 +16,7 @@ create table t1 (ts timestamp with time zone, time_to_live interval); select * from t1 where ts + time_to_live * 1.5 > now(); stream_plan: | - StreamMaterialize { columns: [ts, time_to_live, t1._row_id(hidden)], pk_columns: [t1._row_id] } + StreamMaterialize { columns: [ts, time_to_live, t1._row_id(hidden)], pk_columns: [t1._row_id], pk_conflict: "no check" } └─StreamProject { exprs: [t1.ts, t1.time_to_live, t1._row_id] } └─StreamDynamicFilter { predicate: ($expr1 > now), output: [t1.ts, t1.time_to_live, $expr1, t1._row_id] } ├─StreamProject { exprs: [t1.ts, t1.time_to_live, (AtTimeZone((AtTimeZone(t1.ts, 'UTC':Varchar) + DateTrunc('day':Varchar, (t1.time_to_live * 1.5:Decimal))), 'UTC':Varchar) + ((t1.time_to_live * 1.5:Decimal) - DateTrunc('day':Varchar, (t1.time_to_live * 1.5:Decimal)))) as $expr1, t1._row_id] } @@ -28,7 +28,7 @@ create table t1 (ts timestamp with time zone, additional_time_to_live interval); select * from t1 where now() - interval '15 minutes' < ts + additional_time_to_live * 1.5; stream_plan: | - StreamMaterialize { columns: [ts, additional_time_to_live, t1._row_id(hidden)], pk_columns: [t1._row_id] } + StreamMaterialize { columns: [ts, additional_time_to_live, t1._row_id(hidden)], pk_columns: [t1._row_id], pk_conflict: "no check" } └─StreamProject { exprs: [t1.ts, t1.additional_time_to_live, t1._row_id] } └─StreamDynamicFilter { predicate: ($expr1 > $expr2), output: [t1.ts, t1.additional_time_to_live, $expr1, t1._row_id] } ├─StreamProject { exprs: [t1.ts, t1.additional_time_to_live, (AtTimeZone((AtTimeZone(t1.ts, 'UTC':Varchar) + DateTrunc('day':Varchar, (t1.additional_time_to_live * 1.5:Decimal))), 'UTC':Varchar) + ((t1.additional_time_to_live * 1.5:Decimal) - DateTrunc('day':Varchar, (t1.additional_time_to_live * 1.5:Decimal)))) as $expr1, t1._row_id] } @@ -46,7 +46,7 @@ create table t1 (ts timestamp with time zone); select * from t1 where ts < now() - interval '1 hour' and ts >= now() - interval '2 hour'; stream_plan: | - StreamMaterialize { columns: [ts, t1._row_id(hidden)], pk_columns: [t1._row_id] } + StreamMaterialize { columns: [ts, t1._row_id(hidden)], pk_columns: [t1._row_id], pk_conflict: "no check" } └─StreamDynamicFilter { predicate: (t1.ts < $expr2), output: [t1.ts, t1._row_id] } ├─StreamDynamicFilter { predicate: (t1.ts >= $expr1), output: [t1.ts, t1._row_id] } | ├─StreamTableScan { table: t1, columns: [t1.ts, t1._row_id], pk: [t1._row_id], dist: UpstreamHashShard(t1._row_id) } diff --git a/src/frontend/planner_test/tests/testdata/time_window.yaml b/src/frontend/planner_test/tests/testdata/time_window.yaml index df3dd8c1946da..1575c405567f3 100644 --- a/src/frontend/planner_test/tests/testdata/time_window.yaml +++ b/src/frontend/planner_test/tests/testdata/time_window.yaml @@ -64,7 +64,7 @@ └─LogicalHopWindow { time_col: t1.created_at, slide: 1 day, size: 3 days, output: all } └─LogicalScan { table: t1, columns: [t1.id, t1.created_at, t1._row_id] } stream_plan: | - StreamMaterialize { columns: [id, created_at, window_start, window_end, t1._row_id(hidden)], pk_columns: [t1._row_id, window_start, window_end] } + StreamMaterialize { columns: [id, created_at, window_start, window_end, t1._row_id(hidden)], pk_columns: [t1._row_id, window_start, window_end], pk_conflict: "no check" } └─StreamHopWindow { time_col: t1.created_at, slide: 1 day, size: 3 days, output: [t1.id, t1.created_at, window_start, window_end, t1._row_id] } └─StreamTableScan { table: t1, columns: [t1.id, t1.created_at, t1._row_id], pk: [t1._row_id], dist: UpstreamHashShard(t1._row_id) } - sql: | @@ -75,7 +75,7 @@ └─LogicalHopWindow { time_col: t1.created_at, slide: 1 day, size: 3 days, output: all } └─LogicalScan { table: t1, columns: [t1.id, t1.created_at, t1._row_id] } stream_plan: | - StreamMaterialize { columns: [id, created_at, window_start, t1._row_id(hidden)], pk_columns: [t1._row_id, window_start] } + StreamMaterialize { columns: [id, created_at, window_start, t1._row_id(hidden)], pk_columns: [t1._row_id, window_start], pk_conflict: "no check" } └─StreamHopWindow { time_col: t1.created_at, slide: 1 day, size: 3 days, output: [t1.id, t1.created_at, window_start, t1._row_id] } └─StreamTableScan { table: t1, columns: [t1.id, t1.created_at, t1._row_id], pk: [t1._row_id], dist: UpstreamHashShard(t1._row_id) } - sql: | @@ -86,7 +86,7 @@ └─LogicalHopWindow { time_col: t1.created_at, slide: 1 day, size: 3 days, output: all } └─LogicalScan { table: t1, columns: [t1.id, t1.created_at, t1._row_id] } stream_plan: | - StreamMaterialize { columns: [id, created_at, window_end, t1._row_id(hidden)], pk_columns: [t1._row_id, window_end] } + StreamMaterialize { columns: [id, created_at, window_end, t1._row_id(hidden)], pk_columns: [t1._row_id, window_end], pk_conflict: "no check" } └─StreamHopWindow { time_col: t1.created_at, slide: 1 day, size: 3 days, output: [t1.id, t1.created_at, window_end, t1._row_id] } └─StreamTableScan { table: t1, columns: [t1.id, t1.created_at, t1._row_id], pk: [t1._row_id], dist: UpstreamHashShard(t1._row_id) } - sql: | @@ -101,7 +101,7 @@ └─BatchExchange { order: [], dist: Single } └─BatchScan { table: t1, columns: [t1.id, t1.created_at], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [id, created_at, window_start(hidden), t1._row_id(hidden)], pk_columns: [t1._row_id, window_start] } + StreamMaterialize { columns: [id, created_at, window_start(hidden), t1._row_id(hidden)], pk_columns: [t1._row_id, window_start], pk_conflict: "no check" } └─StreamHopWindow { time_col: t1.created_at, slide: 1 day, size: 3 days, output: [t1.id, t1.created_at, window_start, t1._row_id] } └─StreamTableScan { table: t1, columns: [t1.id, t1.created_at, t1._row_id], pk: [t1._row_id], dist: UpstreamHashShard(t1._row_id) } - sql: | @@ -116,7 +116,7 @@ └─BatchExchange { order: [], dist: Single } └─BatchScan { table: t1, columns: [t1.id, t1.created_at], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [id, created_at, window_start(hidden), t1._row_id(hidden)], pk_columns: [t1._row_id, window_start] } + StreamMaterialize { columns: [id, created_at, window_start(hidden), t1._row_id(hidden)], pk_columns: [t1._row_id, window_start], pk_conflict: "no check" } └─StreamHopWindow { time_col: t1.created_at, slide: 1 day, size: 3 days, output: [t1.id, t1.created_at, window_start, t1._row_id] } └─StreamTableScan { table: t1, columns: [t1.id, t1.created_at, t1._row_id], pk: [t1._row_id], dist: UpstreamHashShard(t1._row_id) } - sql: | @@ -136,7 +136,7 @@ └─BatchExchange { order: [], dist: HashShard(t.v1) } └─BatchScan { table: t, columns: [t.v1, t.v2, t.v3], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [v1, window_end, avg], pk_columns: [v1, window_end] } + StreamMaterialize { columns: [v1, window_end, avg], pk_columns: [v1, window_end], pk_conflict: "no check" } └─StreamProject { exprs: [t.v1, window_end, (sum(t.v3) / count(t.v3)::Float64) as $expr1] } └─StreamHashAgg { group_key: [t.v1, window_end], aggs: [count, sum(t.v3), count(t.v3)] } └─StreamExchange { dist: HashShard(t.v1, window_end) } @@ -159,7 +159,7 @@ └─BatchFilter { predicate: (t1.v1 >= 10:Int32) } └─BatchScan { table: t1, columns: [t1.id, t1.v1, t1.created_at], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [id, v1, created_at, window_start, window_end, t1._row_id(hidden)], pk_columns: [t1._row_id] } + StreamMaterialize { columns: [id, v1, created_at, window_start, window_end, t1._row_id(hidden)], pk_columns: [t1._row_id], pk_conflict: "no check" } └─StreamProject { exprs: [t1.id, t1.v1, t1.created_at, TumbleStart(t1.created_at, '3 days':Interval) as $expr1, (TumbleStart(t1.created_at, '3 days':Interval) + '3 days':Interval) as $expr2, t1._row_id] } └─StreamFilter { predicate: (t1.v1 >= 10:Int32) } └─StreamTableScan { table: t1, columns: [t1.id, t1.v1, t1.created_at, t1._row_id], pk: [t1._row_id], dist: UpstreamHashShard(t1._row_id) } @@ -180,7 +180,7 @@ └─BatchFilter { predicate: (t1.v1 >= 10:Int32) } └─BatchScan { table: t1, columns: [t1.id, t1.v1, t1.created_at], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [id, v1, created_at, window_start, window_end, t1._row_id(hidden)], pk_columns: [t1._row_id, window_start, window_end] } + StreamMaterialize { columns: [id, v1, created_at, window_start, window_end, t1._row_id(hidden)], pk_columns: [t1._row_id, window_start, window_end], pk_conflict: "no check" } └─StreamHopWindow { time_col: t1.created_at, slide: 1 day, size: 3 days, output: [t1.id, t1.v1, t1.created_at, window_start, window_end, t1._row_id] } └─StreamFilter { predicate: (t1.v1 >= 10:Int32) } └─StreamTableScan { table: t1, columns: [t1.id, t1.v1, t1.created_at, t1._row_id], pk: [t1._row_id], dist: UpstreamHashShard(t1._row_id) } diff --git a/src/frontend/planner_test/tests/testdata/tpch.yaml b/src/frontend/planner_test/tests/testdata/tpch.yaml index 0656da6e52618..8a0be5b78b3f0 100644 --- a/src/frontend/planner_test/tests/testdata/tpch.yaml +++ b/src/frontend/planner_test/tests/testdata/tpch.yaml @@ -139,7 +139,7 @@ └─BatchFilter { predicate: (lineitem.l_shipdate <= '1998-09-21 00:00:00':Timestamp) } └─BatchScan { table: lineitem, columns: [lineitem.l_quantity, lineitem.l_extendedprice, lineitem.l_discount, lineitem.l_tax, lineitem.l_returnflag, lineitem.l_linestatus, lineitem.l_shipdate], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [l_returnflag, l_linestatus, sum_qty, sum_base_price, sum_disc_price, sum_charge, avg_qty, avg_price, avg_disc, count_order], pk_columns: [l_returnflag, l_linestatus] } + StreamMaterialize { columns: [l_returnflag, l_linestatus, sum_qty, sum_base_price, sum_disc_price, sum_charge, avg_qty, avg_price, avg_disc, count_order], pk_columns: [l_returnflag, l_linestatus], pk_conflict: "no check" } └─StreamProject { exprs: [lineitem.l_returnflag, lineitem.l_linestatus, sum(lineitem.l_quantity), sum(lineitem.l_extendedprice), sum($expr1), sum($expr2), RoundDigit((sum(lineitem.l_quantity) / count(lineitem.l_quantity)), 4:Int32) as $expr3, RoundDigit((sum(lineitem.l_extendedprice) / count(lineitem.l_extendedprice)), 4:Int32) as $expr4, RoundDigit((sum(lineitem.l_discount) / count(lineitem.l_discount)), 4:Int32) as $expr5, count] } └─StreamHashAgg { group_key: [lineitem.l_returnflag, lineitem.l_linestatus], aggs: [count, sum(lineitem.l_quantity), sum(lineitem.l_extendedprice), sum($expr1), sum($expr2), sum(lineitem.l_quantity), count(lineitem.l_quantity), sum(lineitem.l_extendedprice), count(lineitem.l_extendedprice), sum(lineitem.l_discount), count(lineitem.l_discount), count] } └─StreamExchange { dist: HashShard(lineitem.l_returnflag, lineitem.l_linestatus) } @@ -148,7 +148,7 @@ └─StreamTableScan { table: lineitem, columns: [lineitem.l_quantity, lineitem.l_extendedprice, lineitem.l_discount, lineitem.l_tax, lineitem.l_returnflag, lineitem.l_linestatus, lineitem.l_orderkey, lineitem.l_linenumber, lineitem.l_shipdate], pk: [lineitem.l_orderkey, lineitem.l_linenumber], dist: UpstreamHashShard(lineitem.l_orderkey, lineitem.l_linenumber) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [l_returnflag, l_linestatus, sum_qty, sum_base_price, sum_disc_price, sum_charge, avg_qty, avg_price, avg_disc, count_order], pk_columns: [l_returnflag, l_linestatus] } + StreamMaterialize { columns: [l_returnflag, l_linestatus, sum_qty, sum_base_price, sum_disc_price, sum_charge, avg_qty, avg_price, avg_disc, count_order], pk_columns: [l_returnflag, l_linestatus], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [lineitem.l_returnflag, lineitem.l_linestatus, sum(lineitem.l_quantity), sum(lineitem.l_extendedprice), sum($expr358), sum($expr359), RoundDigit((sum(lineitem.l_quantity) / count(lineitem.l_quantity)), 4:Int32) as $expr360, RoundDigit((sum(lineitem.l_extendedprice) / count(lineitem.l_extendedprice)), 4:Int32) as $expr361, RoundDigit((sum(lineitem.l_discount) / count(lineitem.l_discount)), 4:Int32) as $expr362, count] } StreamHashAgg { group_key: [lineitem.l_returnflag, lineitem.l_linestatus], aggs: [count, sum(lineitem.l_quantity), sum(lineitem.l_extendedprice), sum($expr358), sum($expr359), sum(lineitem.l_quantity), count(lineitem.l_quantity), sum(lineitem.l_extendedprice), count(lineitem.l_extendedprice), sum(lineitem.l_discount), count(lineitem.l_discount), count] } @@ -296,7 +296,7 @@ └─BatchFilter { predicate: IsNotNull(partsupp.ps_partkey) } └─BatchScan { table: partsupp, columns: [partsupp.ps_partkey, partsupp.ps_suppkey, partsupp.ps_supplycost], distribution: UpstreamHashShard(partsupp.ps_partkey, partsupp.ps_suppkey) } stream_plan: | - StreamMaterialize { columns: [s_acctbal, s_name, n_name, p_partkey, p_mfgr, s_address, s_phone, s_comment, partsupp.ps_partkey(hidden), partsupp.ps_suppkey(hidden), supplier.s_suppkey(hidden), nation.n_nationkey(hidden), supplier.s_nationkey(hidden), part.p_partkey(hidden), partsupp.ps_supplycost(hidden), min(partsupp.ps_supplycost)(hidden), nation.n_regionkey(hidden), region.r_regionkey(hidden)], pk_columns: [p_partkey, partsupp.ps_partkey, partsupp.ps_suppkey, supplier.s_suppkey, nation.n_nationkey, supplier.s_nationkey, part.p_partkey, partsupp.ps_supplycost, min(partsupp.ps_supplycost), region.r_regionkey, nation.n_regionkey], order_descs: [s_acctbal, n_name, s_name, p_partkey, partsupp.ps_partkey, partsupp.ps_suppkey, supplier.s_suppkey, nation.n_nationkey, supplier.s_nationkey, part.p_partkey, partsupp.ps_supplycost, min(partsupp.ps_supplycost), region.r_regionkey, nation.n_regionkey] } + StreamMaterialize { columns: [s_acctbal, s_name, n_name, p_partkey, p_mfgr, s_address, s_phone, s_comment, partsupp.ps_partkey(hidden), partsupp.ps_suppkey(hidden), supplier.s_suppkey(hidden), nation.n_nationkey(hidden), supplier.s_nationkey(hidden), part.p_partkey(hidden), partsupp.ps_supplycost(hidden), min(partsupp.ps_supplycost)(hidden), nation.n_regionkey(hidden), region.r_regionkey(hidden)], pk_columns: [p_partkey, partsupp.ps_partkey, partsupp.ps_suppkey, supplier.s_suppkey, nation.n_nationkey, supplier.s_nationkey, part.p_partkey, partsupp.ps_supplycost, min(partsupp.ps_supplycost), region.r_regionkey, nation.n_regionkey], order_descs: [s_acctbal, n_name, s_name, p_partkey, partsupp.ps_partkey, partsupp.ps_suppkey, supplier.s_suppkey, nation.n_nationkey, supplier.s_nationkey, part.p_partkey, partsupp.ps_supplycost, min(partsupp.ps_supplycost), region.r_regionkey, nation.n_regionkey], pk_conflict: "no check" } └─StreamProject { exprs: [supplier.s_acctbal, supplier.s_name, nation.n_name, part.p_partkey, part.p_mfgr, supplier.s_address, supplier.s_phone, supplier.s_comment, partsupp.ps_partkey, partsupp.ps_suppkey, supplier.s_suppkey, nation.n_nationkey, supplier.s_nationkey, part.p_partkey, partsupp.ps_supplycost, min(partsupp.ps_supplycost), nation.n_regionkey, region.r_regionkey] } └─StreamTopN { order: "[supplier.s_acctbal DESC, nation.n_name ASC, supplier.s_name ASC, part.p_partkey ASC]", limit: 100, offset: 0 } └─StreamExchange { dist: Single } @@ -353,7 +353,7 @@ └─StreamTableScan { table: region, columns: [region.r_regionkey, region.r_name], pk: [region.r_regionkey], dist: UpstreamHashShard(region.r_regionkey) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [s_acctbal, s_name, n_name, p_partkey, p_mfgr, s_address, s_phone, s_comment, partsupp.ps_partkey(hidden), partsupp.ps_suppkey(hidden), supplier.s_suppkey(hidden), nation.n_nationkey(hidden), supplier.s_nationkey(hidden), part.p_partkey(hidden), partsupp.ps_supplycost(hidden), min(partsupp.ps_supplycost)(hidden), nation.n_regionkey(hidden), region.r_regionkey(hidden)], pk_columns: [p_partkey, partsupp.ps_partkey, partsupp.ps_suppkey, supplier.s_suppkey, nation.n_nationkey, supplier.s_nationkey, part.p_partkey, partsupp.ps_supplycost, min(partsupp.ps_supplycost), region.r_regionkey, nation.n_regionkey], order_descs: [s_acctbal, n_name, s_name, p_partkey, partsupp.ps_partkey, partsupp.ps_suppkey, supplier.s_suppkey, nation.n_nationkey, supplier.s_nationkey, part.p_partkey, partsupp.ps_supplycost, min(partsupp.ps_supplycost), region.r_regionkey, nation.n_regionkey] } + StreamMaterialize { columns: [s_acctbal, s_name, n_name, p_partkey, p_mfgr, s_address, s_phone, s_comment, partsupp.ps_partkey(hidden), partsupp.ps_suppkey(hidden), supplier.s_suppkey(hidden), nation.n_nationkey(hidden), supplier.s_nationkey(hidden), part.p_partkey(hidden), partsupp.ps_supplycost(hidden), min(partsupp.ps_supplycost)(hidden), nation.n_regionkey(hidden), region.r_regionkey(hidden)], pk_columns: [p_partkey, partsupp.ps_partkey, partsupp.ps_suppkey, supplier.s_suppkey, nation.n_nationkey, supplier.s_nationkey, part.p_partkey, partsupp.ps_supplycost, min(partsupp.ps_supplycost), region.r_regionkey, nation.n_regionkey], order_descs: [s_acctbal, n_name, s_name, p_partkey, partsupp.ps_partkey, partsupp.ps_suppkey, supplier.s_suppkey, nation.n_nationkey, supplier.s_nationkey, part.p_partkey, partsupp.ps_supplycost, min(partsupp.ps_supplycost), region.r_regionkey, nation.n_regionkey], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [supplier.s_acctbal, supplier.s_name, nation.n_name, part.p_partkey, part.p_mfgr, supplier.s_address, supplier.s_phone, supplier.s_comment, partsupp.ps_partkey, partsupp.ps_suppkey, supplier.s_suppkey, nation.n_nationkey, supplier.s_nationkey, part.p_partkey, partsupp.ps_supplycost, min(partsupp.ps_supplycost), nation.n_regionkey, region.r_regionkey] } StreamTopN { order: "[supplier.s_acctbal DESC, nation.n_name ASC, supplier.s_name ASC, part.p_partkey ASC]", limit: 100, offset: 0 } @@ -592,7 +592,7 @@ └─BatchFilter { predicate: (lineitem.l_shipdate > '1995-03-29':Date) } └─BatchScan { table: lineitem, columns: [lineitem.l_orderkey, lineitem.l_extendedprice, lineitem.l_discount, lineitem.l_shipdate], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [l_orderkey, revenue, o_orderdate, o_shippriority], pk_columns: [l_orderkey, o_orderdate, o_shippriority], order_descs: [revenue, o_orderdate, l_orderkey, o_shippriority] } + StreamMaterialize { columns: [l_orderkey, revenue, o_orderdate, o_shippriority], pk_columns: [l_orderkey, o_orderdate, o_shippriority], order_descs: [revenue, o_orderdate, l_orderkey, o_shippriority], pk_conflict: "no check" } └─StreamProject { exprs: [lineitem.l_orderkey, sum($expr1), orders.o_orderdate, orders.o_shippriority] } └─StreamTopN { order: "[sum($expr1) DESC, orders.o_orderdate ASC]", limit: 10, offset: 0 } └─StreamExchange { dist: Single } @@ -618,7 +618,7 @@ └─StreamTableScan { table: lineitem, columns: [lineitem.l_orderkey, lineitem.l_extendedprice, lineitem.l_discount, lineitem.l_linenumber, lineitem.l_shipdate], pk: [lineitem.l_orderkey, lineitem.l_linenumber], dist: UpstreamHashShard(lineitem.l_orderkey, lineitem.l_linenumber) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [l_orderkey, revenue, o_orderdate, o_shippriority], pk_columns: [l_orderkey, o_orderdate, o_shippriority], order_descs: [revenue, o_orderdate, l_orderkey, o_shippriority] } + StreamMaterialize { columns: [l_orderkey, revenue, o_orderdate, o_shippriority], pk_columns: [l_orderkey, o_orderdate, o_shippriority], order_descs: [revenue, o_orderdate, l_orderkey, o_shippriority], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [lineitem.l_orderkey, sum($expr73), orders.o_orderdate, orders.o_shippriority] } StreamTopN { order: "[sum($expr73) DESC, orders.o_orderdate ASC]", limit: 10, offset: 0 } @@ -734,7 +734,7 @@ └─BatchFilter { predicate: (lineitem.l_commitdate < lineitem.l_receiptdate) } └─BatchScan { table: lineitem, columns: [lineitem.l_orderkey, lineitem.l_commitdate, lineitem.l_receiptdate], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [o_orderpriority, order_count], pk_columns: [o_orderpriority] } + StreamMaterialize { columns: [o_orderpriority, order_count], pk_columns: [o_orderpriority], pk_conflict: "no check" } └─StreamProject { exprs: [orders.o_orderpriority, count] } └─StreamHashAgg { group_key: [orders.o_orderpriority], aggs: [count, count] } └─StreamExchange { dist: HashShard(orders.o_orderpriority) } @@ -749,7 +749,7 @@ └─StreamTableScan { table: lineitem, columns: [lineitem.l_orderkey, lineitem.l_linenumber, lineitem.l_commitdate, lineitem.l_receiptdate], pk: [lineitem.l_orderkey, lineitem.l_linenumber], dist: UpstreamHashShard(lineitem.l_orderkey, lineitem.l_linenumber) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [o_orderpriority, order_count], pk_columns: [o_orderpriority] } + StreamMaterialize { columns: [o_orderpriority, order_count], pk_columns: [o_orderpriority], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [orders.o_orderpriority, count] } StreamHashAgg { group_key: [orders.o_orderpriority], aggs: [count, count] } @@ -866,7 +866,7 @@ └─BatchExchange { order: [], dist: HashShard(lineitem.l_orderkey, lineitem.l_suppkey) } └─BatchScan { table: lineitem, columns: [lineitem.l_orderkey, lineitem.l_suppkey, lineitem.l_extendedprice, lineitem.l_discount], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [n_name, revenue], pk_columns: [n_name], order_descs: [revenue, n_name] } + StreamMaterialize { columns: [n_name, revenue], pk_columns: [n_name], order_descs: [revenue, n_name], pk_conflict: "no check" } └─StreamProject { exprs: [nation.n_name, sum($expr1)] } └─StreamHashAgg { group_key: [nation.n_name], aggs: [count, sum($expr1)] } └─StreamExchange { dist: HashShard(nation.n_name) } @@ -898,7 +898,7 @@ └─StreamTableScan { table: region, columns: [region.r_regionkey, region.r_name], pk: [region.r_regionkey], dist: UpstreamHashShard(region.r_regionkey) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [n_name, revenue], pk_columns: [n_name], order_descs: [revenue, n_name] } + StreamMaterialize { columns: [n_name, revenue], pk_columns: [n_name], order_descs: [revenue, n_name], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [nation.n_name, sum($expr71)] } StreamHashAgg { group_key: [nation.n_name], aggs: [count, sum($expr71)] } @@ -1023,7 +1023,7 @@ └─BatchFilter { predicate: (lineitem.l_shipdate >= '1994-01-01':Date) AND (lineitem.l_shipdate < '1995-01-01 00:00:00':Timestamp) AND (lineitem.l_discount >= 0.07:Decimal) AND (lineitem.l_discount <= 0.09:Decimal) AND (lineitem.l_quantity < 24:Int32) } └─BatchScan { table: lineitem, columns: [lineitem.l_extendedprice, lineitem.l_discount, lineitem.l_quantity, lineitem.l_shipdate], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [revenue], pk_columns: [] } + StreamMaterialize { columns: [revenue], pk_columns: [], pk_conflict: "no check" } └─StreamProject { exprs: [sum(sum($expr1))] } └─StreamGlobalSimpleAgg { aggs: [count, sum(sum($expr1))] } └─StreamExchange { dist: Single } @@ -1033,7 +1033,7 @@ └─StreamTableScan { table: lineitem, columns: [lineitem.l_extendedprice, lineitem.l_discount, lineitem.l_orderkey, lineitem.l_linenumber, lineitem.l_quantity, lineitem.l_shipdate], pk: [lineitem.l_orderkey, lineitem.l_linenumber], dist: UpstreamHashShard(lineitem.l_orderkey, lineitem.l_linenumber) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [revenue], pk_columns: [] } + StreamMaterialize { columns: [revenue], pk_columns: [], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [sum(sum($expr73))] } StreamGlobalSimpleAgg { aggs: [count, sum(sum($expr73))] } @@ -1145,7 +1145,7 @@ └─BatchFilter { predicate: (lineitem.l_shipdate >= '1983-01-01':Date) AND (lineitem.l_shipdate <= '2000-12-31':Date) } └─BatchScan { table: lineitem, columns: [lineitem.l_orderkey, lineitem.l_suppkey, lineitem.l_extendedprice, lineitem.l_discount, lineitem.l_shipdate], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [supp_nation, cust_nation, l_year, revenue], pk_columns: [supp_nation, cust_nation, l_year] } + StreamMaterialize { columns: [supp_nation, cust_nation, l_year, revenue], pk_columns: [supp_nation, cust_nation, l_year], pk_conflict: "no check" } └─StreamProject { exprs: [nation.n_name, nation.n_name, $expr1, sum($expr2)] } └─StreamHashAgg { group_key: [nation.n_name, nation.n_name, $expr1], aggs: [count, sum($expr2)] } └─StreamExchange { dist: HashShard(nation.n_name, nation.n_name, $expr1) } @@ -1175,7 +1175,7 @@ └─StreamTableScan { table: nation, columns: [nation.n_nationkey, nation.n_name], pk: [nation.n_nationkey], dist: UpstreamHashShard(nation.n_nationkey) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [supp_nation, cust_nation, l_year, revenue], pk_columns: [supp_nation, cust_nation, l_year] } + StreamMaterialize { columns: [supp_nation, cust_nation, l_year, revenue], pk_columns: [supp_nation, cust_nation, l_year], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [nation.n_name, nation.n_name, $expr149, sum($expr150)] } StreamHashAgg { group_key: [nation.n_name, nation.n_name, $expr149], aggs: [count, sum($expr150)] } @@ -1375,7 +1375,7 @@ └─BatchExchange { order: [], dist: HashShard(lineitem.l_partkey) } └─BatchScan { table: lineitem, columns: [lineitem.l_orderkey, lineitem.l_partkey, lineitem.l_suppkey, lineitem.l_extendedprice, lineitem.l_discount], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [o_year, mkt_share], pk_columns: [o_year] } + StreamMaterialize { columns: [o_year, mkt_share], pk_columns: [o_year], pk_conflict: "no check" } └─StreamProject { exprs: [$expr1, RoundDigit((sum($expr2) / sum($expr3)), 6:Int32) as $expr4] } └─StreamHashAgg { group_key: [$expr1], aggs: [count, sum($expr2), sum($expr3)] } └─StreamExchange { dist: HashShard($expr1) } @@ -1416,7 +1416,7 @@ └─StreamTableScan { table: region, columns: [region.r_regionkey, region.r_name], pk: [region.r_regionkey], dist: UpstreamHashShard(region.r_regionkey) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [o_year, mkt_share], pk_columns: [o_year] } + StreamMaterialize { columns: [o_year, mkt_share], pk_columns: [o_year], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [$expr291, RoundDigit((sum($expr292) / sum($expr293)), 6:Int32) as $expr294] } StreamHashAgg { group_key: [$expr291], aggs: [count, sum($expr292), sum($expr293)] } @@ -1632,7 +1632,7 @@ └─BatchExchange { order: [], dist: HashShard(lineitem.l_partkey) } └─BatchScan { table: lineitem, columns: [lineitem.l_orderkey, lineitem.l_partkey, lineitem.l_suppkey, lineitem.l_quantity, lineitem.l_extendedprice, lineitem.l_discount], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [nation, o_year, sum_profit], pk_columns: [nation, o_year] } + StreamMaterialize { columns: [nation, o_year, sum_profit], pk_columns: [nation, o_year], pk_conflict: "no check" } └─StreamProject { exprs: [nation.n_name, $expr1, RoundDigit(sum($expr2), 2:Int32) as $expr3] } └─StreamHashAgg { group_key: [nation.n_name, $expr1], aggs: [count, sum($expr2)] } └─StreamExchange { dist: HashShard(nation.n_name, $expr1) } @@ -1662,7 +1662,7 @@ └─StreamTableScan { table: orders, columns: [orders.o_orderkey, orders.o_orderdate], pk: [orders.o_orderkey], dist: UpstreamHashShard(orders.o_orderkey) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [nation, o_year, sum_profit], pk_columns: [nation, o_year] } + StreamMaterialize { columns: [nation, o_year, sum_profit], pk_columns: [nation, o_year], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [nation.n_name, $expr218, RoundDigit(sum($expr219), 2:Int32) as $expr220] } StreamHashAgg { group_key: [nation.n_name, $expr218], aggs: [count, sum($expr219)] } @@ -1839,7 +1839,7 @@ └─BatchFilter { predicate: (lineitem.l_returnflag = 'R':Varchar) } └─BatchScan { table: lineitem, columns: [lineitem.l_orderkey, lineitem.l_extendedprice, lineitem.l_discount, lineitem.l_returnflag], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [c_custkey, c_name, revenue, c_acctbal, n_name, c_address, c_phone, c_comment], pk_columns: [c_custkey, c_name, c_acctbal, c_phone, n_name, c_address, c_comment], order_descs: [revenue, c_custkey, c_name, c_acctbal, c_phone, n_name, c_address, c_comment] } + StreamMaterialize { columns: [c_custkey, c_name, revenue, c_acctbal, n_name, c_address, c_phone, c_comment], pk_columns: [c_custkey, c_name, c_acctbal, c_phone, n_name, c_address, c_comment], order_descs: [revenue, c_custkey, c_name, c_acctbal, c_phone, n_name, c_address, c_comment], pk_conflict: "no check" } └─StreamProject { exprs: [customer.c_custkey, customer.c_name, sum($expr1), customer.c_acctbal, nation.n_name, customer.c_address, customer.c_phone, customer.c_comment] } └─StreamTopN { order: "[sum($expr1) DESC]", limit: 20, offset: 0 } └─StreamExchange { dist: Single } @@ -1868,7 +1868,7 @@ └─StreamTableScan { table: lineitem, columns: [lineitem.l_orderkey, lineitem.l_extendedprice, lineitem.l_discount, lineitem.l_linenumber, lineitem.l_returnflag], pk: [lineitem.l_orderkey, lineitem.l_linenumber], dist: UpstreamHashShard(lineitem.l_orderkey, lineitem.l_linenumber) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [c_custkey, c_name, revenue, c_acctbal, n_name, c_address, c_phone, c_comment], pk_columns: [c_custkey, c_name, c_acctbal, c_phone, n_name, c_address, c_comment], order_descs: [revenue, c_custkey, c_name, c_acctbal, c_phone, n_name, c_address, c_comment] } + StreamMaterialize { columns: [c_custkey, c_name, revenue, c_acctbal, n_name, c_address, c_phone, c_comment], pk_columns: [c_custkey, c_name, c_acctbal, c_phone, n_name, c_address, c_comment], order_descs: [revenue, c_custkey, c_name, c_acctbal, c_phone, n_name, c_address, c_comment], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [customer.c_custkey, customer.c_name, sum($expr73), customer.c_acctbal, nation.n_name, customer.c_address, customer.c_phone, customer.c_comment] } StreamTopN { order: "[sum($expr73) DESC]", limit: 20, offset: 0 } @@ -2036,7 +2036,7 @@ └─BatchExchange { order: [], dist: UpstreamHashShard(partsupp.ps_suppkey) } └─BatchScan { table: partsupp, columns: [partsupp.ps_suppkey, partsupp.ps_availqty, partsupp.ps_supplycost], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [ps_partkey, value], pk_columns: [ps_partkey], order_descs: [value, ps_partkey] } + StreamMaterialize { columns: [ps_partkey, value], pk_columns: [ps_partkey], order_descs: [value, ps_partkey], pk_conflict: "no check" } └─StreamProject { exprs: [partsupp.ps_partkey, sum($expr1)] } └─StreamDynamicFilter { predicate: (sum($expr1) > $expr3), output: [partsupp.ps_partkey, sum($expr1), sum($expr1)] } ├─StreamProject { exprs: [partsupp.ps_partkey, sum($expr1), sum($expr1)] } @@ -2073,7 +2073,7 @@ └─StreamTableScan { table: nation, columns: [nation.n_nationkey, nation.n_name], pk: [nation.n_nationkey], dist: UpstreamHashShard(nation.n_nationkey) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [ps_partkey, value], pk_columns: [ps_partkey], order_descs: [value, ps_partkey] } + StreamMaterialize { columns: [ps_partkey, value], pk_columns: [ps_partkey], order_descs: [value, ps_partkey], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [partsupp.ps_partkey, sum($expr212)] } StreamDynamicFilter { predicate: (sum($expr212) > $expr214), output: [partsupp.ps_partkey, sum($expr212), sum($expr212)] } @@ -2232,7 +2232,7 @@ └─BatchFilter { predicate: In(lineitem.l_shipmode, 'FOB':Varchar, 'SHIP':Varchar) AND (lineitem.l_commitdate < lineitem.l_receiptdate) AND (lineitem.l_shipdate < lineitem.l_commitdate) AND (lineitem.l_receiptdate >= '1994-01-01':Date) AND (lineitem.l_receiptdate < '1995-01-01 00:00:00':Timestamp) } └─BatchScan { table: lineitem, columns: [lineitem.l_orderkey, lineitem.l_shipmode, lineitem.l_shipdate, lineitem.l_commitdate, lineitem.l_receiptdate], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [l_shipmode, high_line_count, low_line_count], pk_columns: [l_shipmode] } + StreamMaterialize { columns: [l_shipmode, high_line_count, low_line_count], pk_columns: [l_shipmode], pk_conflict: "no check" } └─StreamProject { exprs: [lineitem.l_shipmode, sum($expr1), sum($expr2)] } └─StreamHashAgg { group_key: [lineitem.l_shipmode], aggs: [count, sum($expr1), sum($expr2)] } └─StreamExchange { dist: HashShard(lineitem.l_shipmode) } @@ -2246,7 +2246,7 @@ └─StreamTableScan { table: lineitem, columns: [lineitem.l_orderkey, lineitem.l_shipmode, lineitem.l_linenumber, lineitem.l_shipdate, lineitem.l_commitdate, lineitem.l_receiptdate], pk: [lineitem.l_orderkey, lineitem.l_linenumber], dist: UpstreamHashShard(lineitem.l_orderkey, lineitem.l_linenumber) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [l_shipmode, high_line_count, low_line_count], pk_columns: [l_shipmode] } + StreamMaterialize { columns: [l_shipmode, high_line_count, low_line_count], pk_columns: [l_shipmode], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [lineitem.l_shipmode, sum($expr141), sum($expr142)] } StreamHashAgg { group_key: [lineitem.l_shipmode], aggs: [count, sum($expr141), sum($expr142)] } @@ -2332,7 +2332,7 @@ └─BatchFilter { predicate: Not(Like(orders.o_comment, '%:1%:2%':Varchar)) } └─BatchScan { table: orders, columns: [orders.o_orderkey, orders.o_custkey, orders.o_comment], distribution: UpstreamHashShard(orders.o_orderkey) } stream_plan: | - StreamMaterialize { columns: [c_count, custdist], pk_columns: [c_count], order_descs: [custdist, c_count] } + StreamMaterialize { columns: [c_count, custdist], pk_columns: [c_count], order_descs: [custdist, c_count], pk_conflict: "no check" } └─StreamProject { exprs: [count(orders.o_orderkey), count] } └─StreamHashAgg { group_key: [count(orders.o_orderkey)], aggs: [count, count] } └─StreamExchange { dist: HashShard(count(orders.o_orderkey)) } @@ -2347,7 +2347,7 @@ └─StreamTableScan { table: orders, columns: [orders.o_orderkey, orders.o_custkey, orders.o_comment], pk: [orders.o_orderkey], dist: UpstreamHashShard(orders.o_orderkey) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [c_count, custdist], pk_columns: [c_count], order_descs: [custdist, c_count] } + StreamMaterialize { columns: [c_count, custdist], pk_columns: [c_count], order_descs: [custdist, c_count], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [count(orders.o_orderkey), count] } StreamHashAgg { group_key: [count(orders.o_orderkey)], aggs: [count, count] } @@ -2426,7 +2426,7 @@ └─BatchFilter { predicate: (lineitem.l_shipdate >= '1995-09-01':Date) AND (lineitem.l_shipdate < '1995-10-01 00:00:00':Timestamp) } └─BatchScan { table: lineitem, columns: [lineitem.l_partkey, lineitem.l_extendedprice, lineitem.l_discount, lineitem.l_shipdate], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [promo_revenue], pk_columns: [] } + StreamMaterialize { columns: [promo_revenue], pk_columns: [], pk_conflict: "no check" } └─StreamProject { exprs: [((100.00:Decimal * sum(sum($expr1))) / sum(sum($expr2))) as $expr3] } └─StreamGlobalSimpleAgg { aggs: [count, sum(sum($expr1)), sum(sum($expr2))] } └─StreamExchange { dist: Single } @@ -2441,7 +2441,7 @@ └─StreamTableScan { table: part, columns: [part.p_partkey, part.p_type], pk: [part.p_partkey], dist: UpstreamHashShard(part.p_partkey) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [promo_revenue], pk_columns: [] } + StreamMaterialize { columns: [promo_revenue], pk_columns: [], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [((100.00:Decimal * sum(sum($expr212))) / sum(sum($expr213))) as $expr214] } StreamGlobalSimpleAgg { aggs: [count, sum(sum($expr212)), sum(sum($expr213))] } @@ -2566,7 +2566,7 @@ └─BatchFilter { predicate: (lineitem.l_shipdate >= '1993-01-01':Date) AND (lineitem.l_shipdate < '1993-04-01 00:00:00':Timestamp) } └─BatchScan { table: lineitem, columns: [lineitem.l_suppkey, lineitem.l_extendedprice, lineitem.l_discount, lineitem.l_shipdate], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [s_suppkey, s_name, s_address, s_phone, total_revenue, lineitem.l_suppkey(hidden), max(max(sum($expr121)))(hidden)], pk_columns: [s_suppkey, lineitem.l_suppkey, total_revenue, max(max(sum($expr121)))] } + StreamMaterialize { columns: [s_suppkey, s_name, s_address, s_phone, total_revenue, lineitem.l_suppkey(hidden), max(max(sum($expr121)))(hidden)], pk_columns: [s_suppkey, lineitem.l_suppkey, total_revenue, max(max(sum($expr121)))], pk_conflict: "no check" } └─StreamHashJoin { type: Inner, predicate: sum($expr1) = max(max(sum($expr1))), output: all } ├─StreamExchange { dist: HashShard(sum($expr1)) } | └─StreamHashJoin { type: Inner, predicate: supplier.s_suppkey = lineitem.l_suppkey, output: [supplier.s_suppkey, supplier.s_name, supplier.s_address, supplier.s_phone, sum($expr1), lineitem.l_suppkey] } @@ -2596,7 +2596,7 @@ └─StreamTableScan { table: lineitem, columns: [lineitem.l_suppkey, lineitem.l_extendedprice, lineitem.l_discount, lineitem.l_orderkey, lineitem.l_linenumber, lineitem.l_shipdate], pk: [lineitem.l_orderkey, lineitem.l_linenumber], dist: UpstreamHashShard(lineitem.l_orderkey, lineitem.l_linenumber) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [s_suppkey, s_name, s_address, s_phone, total_revenue, lineitem.l_suppkey(hidden), max(max(sum($expr121)))(hidden)], pk_columns: [s_suppkey, lineitem.l_suppkey, total_revenue, max(max(sum($expr121)))] } + StreamMaterialize { columns: [s_suppkey, s_name, s_address, s_phone, total_revenue, lineitem.l_suppkey(hidden), max(max(sum($expr121)))(hidden)], pk_columns: [s_suppkey, lineitem.l_suppkey, total_revenue, max(max(sum($expr121)))], pk_conflict: "no check" } materialized table: 4294967294 StreamHashJoin { type: Inner, predicate: sum($expr121) = max(max(sum($expr121))), output: all } left table: 0, right table 2, left degree table: 1, right degree table: 3, @@ -2721,7 +2721,7 @@ └─BatchExchange { order: [], dist: UpstreamHashShard(partsupp.ps_partkey) } └─BatchScan { table: partsupp, columns: [partsupp.ps_partkey, partsupp.ps_suppkey], distribution: UpstreamHashShard(partsupp.ps_partkey, partsupp.ps_suppkey) } stream_plan: | - StreamMaterialize { columns: [p_brand, p_type, p_size, supplier_cnt], pk_columns: [p_brand, p_type, p_size], order_descs: [supplier_cnt, p_brand, p_type, p_size] } + StreamMaterialize { columns: [p_brand, p_type, p_size, supplier_cnt], pk_columns: [p_brand, p_type, p_size], order_descs: [supplier_cnt, p_brand, p_type, p_size], pk_conflict: "no check" } └─StreamProject { exprs: [part.p_brand, part.p_type, part.p_size, count(partsupp.ps_suppkey)] } └─StreamHashAgg { group_key: [part.p_brand, part.p_type, part.p_size], aggs: [count, count(partsupp.ps_suppkey)] } └─StreamExchange { dist: HashShard(part.p_brand, part.p_type, part.p_size) } @@ -2741,7 +2741,7 @@ └─StreamTableScan { table: supplier, columns: [supplier.s_suppkey, supplier.s_comment], pk: [supplier.s_suppkey], dist: UpstreamHashShard(supplier.s_suppkey) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [p_brand, p_type, p_size, supplier_cnt], pk_columns: [p_brand, p_type, p_size], order_descs: [supplier_cnt, p_brand, p_type, p_size] } + StreamMaterialize { columns: [p_brand, p_type, p_size, supplier_cnt], pk_columns: [p_brand, p_type, p_size], order_descs: [supplier_cnt, p_brand, p_type, p_size], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [part.p_brand, part.p_type, part.p_size, count(partsupp.ps_suppkey)] } StreamHashAgg { group_key: [part.p_brand, part.p_type, part.p_size], aggs: [count, count(partsupp.ps_suppkey)] } @@ -2864,7 +2864,7 @@ └─BatchFilter { predicate: IsNotNull(lineitem.l_partkey) } └─BatchScan { table: lineitem, columns: [lineitem.l_partkey, lineitem.l_quantity], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [avg_yearly], pk_columns: [] } + StreamMaterialize { columns: [avg_yearly], pk_columns: [], pk_conflict: "no check" } └─StreamProject { exprs: [RoundDigit((sum(sum(lineitem.l_extendedprice)) / 7.0:Decimal), 16:Int32) as $expr2] } └─StreamGlobalSimpleAgg { aggs: [count, sum(sum(lineitem.l_extendedprice))] } └─StreamExchange { dist: Single } @@ -2894,7 +2894,7 @@ └─StreamTableScan { table: lineitem, columns: [lineitem.l_partkey, lineitem.l_quantity, lineitem.l_orderkey, lineitem.l_linenumber], pk: [lineitem.l_orderkey, lineitem.l_linenumber], dist: UpstreamHashShard(lineitem.l_orderkey, lineitem.l_linenumber) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [avg_yearly], pk_columns: [] } + StreamMaterialize { columns: [avg_yearly], pk_columns: [], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [RoundDigit((sum(sum(lineitem.l_extendedprice)) / 7.0:Decimal), 16:Int32) as $expr153] } StreamGlobalSimpleAgg { aggs: [count, sum(sum(lineitem.l_extendedprice))] } @@ -3055,7 +3055,7 @@ └─BatchExchange { order: [], dist: HashShard(lineitem.l_orderkey) } └─BatchScan { table: lineitem, columns: [lineitem.l_orderkey, lineitem.l_quantity], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice, quantity], pk_columns: [c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice], order_descs: [o_totalprice, o_orderdate, c_name, c_custkey, o_orderkey] } + StreamMaterialize { columns: [c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice, quantity], pk_columns: [c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice], order_descs: [o_totalprice, o_orderdate, c_name, c_custkey, o_orderkey], pk_conflict: "no check" } └─StreamProject { exprs: [customer.c_name, customer.c_custkey, orders.o_orderkey, orders.o_orderdate, orders.o_totalprice, sum(lineitem.l_quantity)] } └─StreamTopN { order: "[orders.o_totalprice DESC, orders.o_orderdate ASC]", limit: 100, offset: 0 } └─StreamExchange { dist: Single } @@ -3081,7 +3081,7 @@ └─StreamTableScan { table: lineitem, columns: [lineitem.l_orderkey, lineitem.l_quantity, lineitem.l_linenumber], pk: [lineitem.l_orderkey, lineitem.l_linenumber], dist: UpstreamHashShard(lineitem.l_orderkey, lineitem.l_linenumber) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice, quantity], pk_columns: [c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice], order_descs: [o_totalprice, o_orderdate, c_name, c_custkey, o_orderkey] } + StreamMaterialize { columns: [c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice, quantity], pk_columns: [c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice], order_descs: [o_totalprice, o_orderdate, c_name, c_custkey, o_orderkey], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [customer.c_name, customer.c_custkey, orders.o_orderkey, orders.o_orderdate, orders.o_totalprice, sum(lineitem.l_quantity)] } StreamTopN { order: "[orders.o_totalprice DESC, orders.o_orderdate ASC]", limit: 100, offset: 0 } @@ -3215,7 +3215,7 @@ └─BatchFilter { predicate: In(lineitem.l_shipmode, 'AIR':Varchar, 'AIR REG':Varchar) AND (lineitem.l_shipinstruct = 'DELIVER IN PERSON':Varchar) } └─BatchScan { table: lineitem, columns: [lineitem.l_partkey, lineitem.l_quantity, lineitem.l_extendedprice, lineitem.l_discount, lineitem.l_shipinstruct, lineitem.l_shipmode], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [revenue], pk_columns: [] } + StreamMaterialize { columns: [revenue], pk_columns: [], pk_conflict: "no check" } └─StreamProject { exprs: [sum(sum($expr1))] } └─StreamGlobalSimpleAgg { aggs: [count, sum(sum($expr1))] } └─StreamExchange { dist: Single } @@ -3232,7 +3232,7 @@ └─StreamTableScan { table: part, columns: [part.p_partkey, part.p_brand, part.p_size, part.p_container], pk: [part.p_partkey], dist: UpstreamHashShard(part.p_partkey) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [revenue], pk_columns: [] } + StreamMaterialize { columns: [revenue], pk_columns: [], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [sum(sum($expr72))] } StreamGlobalSimpleAgg { aggs: [count, sum(sum($expr72))] } @@ -3372,7 +3372,7 @@ └─BatchFilter { predicate: IsNotNull(lineitem.l_partkey) AND IsNotNull(lineitem.l_suppkey) AND (lineitem.l_shipdate >= '1994-01-01':Date) AND (lineitem.l_shipdate < '1995-01-01 00:00:00':Timestamp) } └─BatchScan { table: lineitem, columns: [lineitem.l_partkey, lineitem.l_suppkey, lineitem.l_quantity, lineitem.l_shipdate], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [s_name, s_address, supplier.s_suppkey(hidden), nation.n_nationkey(hidden), supplier.s_nationkey(hidden)], pk_columns: [supplier.s_suppkey, nation.n_nationkey, supplier.s_nationkey], order_descs: [s_name, supplier.s_suppkey, nation.n_nationkey, supplier.s_nationkey] } + StreamMaterialize { columns: [s_name, s_address, supplier.s_suppkey(hidden), nation.n_nationkey(hidden), supplier.s_nationkey(hidden)], pk_columns: [supplier.s_suppkey, nation.n_nationkey, supplier.s_nationkey], order_descs: [s_name, supplier.s_suppkey, nation.n_nationkey, supplier.s_nationkey], pk_conflict: "no check" } └─StreamHashJoin { type: LeftSemi, predicate: supplier.s_suppkey = partsupp.ps_suppkey, output: [supplier.s_name, supplier.s_address, supplier.s_suppkey, nation.n_nationkey, supplier.s_nationkey] } ├─StreamExchange { dist: HashShard(supplier.s_suppkey) } | └─StreamHashJoin { type: Inner, predicate: supplier.s_nationkey = nation.n_nationkey, output: all } @@ -3408,7 +3408,7 @@ └─StreamTableScan { table: lineitem, columns: [lineitem.l_partkey, lineitem.l_suppkey, lineitem.l_quantity, lineitem.l_orderkey, lineitem.l_linenumber, lineitem.l_shipdate], pk: [lineitem.l_orderkey, lineitem.l_linenumber], dist: UpstreamHashShard(lineitem.l_orderkey, lineitem.l_linenumber) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [s_name, s_address, supplier.s_suppkey(hidden), nation.n_nationkey(hidden), supplier.s_nationkey(hidden)], pk_columns: [supplier.s_suppkey, nation.n_nationkey, supplier.s_nationkey], order_descs: [s_name, supplier.s_suppkey, nation.n_nationkey, supplier.s_nationkey] } + StreamMaterialize { columns: [s_name, s_address, supplier.s_suppkey(hidden), nation.n_nationkey(hidden), supplier.s_nationkey(hidden)], pk_columns: [supplier.s_suppkey, nation.n_nationkey, supplier.s_nationkey], order_descs: [s_name, supplier.s_suppkey, nation.n_nationkey, supplier.s_nationkey], pk_conflict: "no check" } materialized table: 4294967294 StreamHashJoin { type: LeftSemi, predicate: supplier.s_suppkey = partsupp.ps_suppkey, output: [supplier.s_name, supplier.s_address, supplier.s_suppkey, nation.n_nationkey, supplier.s_nationkey] } left table: 0, right table 2, left degree table: 1, right degree table: 3, @@ -3610,7 +3610,7 @@ └─BatchFilter { predicate: (lineitem.l_receiptdate > lineitem.l_commitdate) } └─BatchScan { table: lineitem, columns: [lineitem.l_orderkey, lineitem.l_suppkey, lineitem.l_commitdate, lineitem.l_receiptdate], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [s_name, numwait], pk_columns: [s_name], order_descs: [numwait, s_name] } + StreamMaterialize { columns: [s_name, numwait], pk_columns: [s_name], order_descs: [numwait, s_name], pk_conflict: "no check" } └─StreamProject { exprs: [supplier.s_name, count] } └─StreamTopN { order: "[count DESC, supplier.s_name ASC]", limit: 100, offset: 0 } └─StreamExchange { dist: Single } @@ -3648,7 +3648,7 @@ └─StreamTableScan { table: lineitem, columns: [lineitem.l_orderkey, lineitem.l_suppkey, lineitem.l_linenumber, lineitem.l_commitdate, lineitem.l_receiptdate], pk: [lineitem.l_orderkey, lineitem.l_linenumber], dist: UpstreamHashShard(lineitem.l_orderkey, lineitem.l_linenumber) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [s_name, numwait], pk_columns: [s_name], order_descs: [numwait, s_name] } + StreamMaterialize { columns: [s_name, numwait], pk_columns: [s_name], order_descs: [numwait, s_name], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [supplier.s_name, count] } StreamTopN { order: "[count DESC, supplier.s_name ASC]", limit: 100, offset: 0 } @@ -3840,7 +3840,7 @@ └─BatchFilter { predicate: (customer.c_acctbal > 0.00:Decimal) AND In(Substr(customer.c_phone, 1:Int32, 2:Int32), '30':Varchar, '24':Varchar, '31':Varchar, '38':Varchar, '25':Varchar, '34':Varchar, '37':Varchar) } └─BatchScan { table: customer, columns: [customer.c_acctbal, customer.c_phone], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [cntrycode, numcust, totacctbal], pk_columns: [cntrycode] } + StreamMaterialize { columns: [cntrycode, numcust, totacctbal], pk_columns: [cntrycode], pk_conflict: "no check" } └─StreamProject { exprs: [$expr2, count, sum(customer.c_acctbal)] } └─StreamHashAgg { group_key: [$expr2], aggs: [count, count, sum(customer.c_acctbal)] } └─StreamExchange { dist: HashShard($expr2) } diff --git a/src/frontend/planner_test/tests/testdata/union.yaml b/src/frontend/planner_test/tests/testdata/union.yaml index b904226c0f06e..12ff56b04204e 100644 --- a/src/frontend/planner_test/tests/testdata/union.yaml +++ b/src/frontend/planner_test/tests/testdata/union.yaml @@ -10,7 +10,7 @@ └─BatchExchange { order: [], dist: Single } └─BatchScan { table: t2, columns: [t2.a, t2.b, t2.c], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [a, b, c, t1._row_id(hidden), null:Int64(hidden), 0:Int32(hidden)], pk_columns: [t1._row_id, null:Int64, 0:Int32] } + StreamMaterialize { columns: [a, b, c, t1._row_id(hidden), null:Int64(hidden), 0:Int32(hidden)], pk_columns: [t1._row_id, null:Int64, 0:Int32], pk_conflict: "no check" } └─StreamUnion { all: true } ├─StreamExchange { dist: HashShard(t1._row_id, null:Int64, 0:Int32) } | └─StreamProject { exprs: [t1.a, t1.b, t1.c, t1._row_id, null:Int64, 0:Int32] } @@ -20,7 +20,7 @@ └─StreamTableScan { table: t2, columns: [t2.a, t2.b, t2.c, t2._row_id], pk: [t2._row_id], dist: UpstreamHashShard(t2._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [a, b, c, t1._row_id(hidden), null:Int64(hidden), 0:Int32(hidden)], pk_columns: [t1._row_id, null:Int64, 0:Int32] } + StreamMaterialize { columns: [a, b, c, t1._row_id(hidden), null:Int64(hidden), 0:Int32(hidden)], pk_columns: [t1._row_id, null:Int64, 0:Int32], pk_conflict: "no check" } materialized table: 4294967294 StreamUnion { all: true } StreamExchange Hash([3, 4, 5]) from 1 @@ -58,7 +58,7 @@ └─BatchExchange { order: [], dist: Single } └─BatchScan { table: t2, columns: [t2.a, t2.b, t2.c], distribution: SomeShard } stream_plan: | - StreamMaterialize { columns: [a, b, c], pk_columns: [a, b, c] } + StreamMaterialize { columns: [a, b, c], pk_columns: [a, b, c], pk_conflict: "no check" } └─StreamProject { exprs: [t1.a, t1.b, t1.c] } └─StreamHashAgg { group_key: [t1.a, t1.b, t1.c], aggs: [count] } └─StreamExchange { dist: HashShard(t1.a, t1.b, t1.c) } @@ -71,7 +71,7 @@ └─StreamTableScan { table: t2, columns: [t2.a, t2.b, t2.c, t2._row_id], pk: [t2._row_id], dist: UpstreamHashShard(t2._row_id) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [a, b, c], pk_columns: [a, b, c] } + StreamMaterialize { columns: [a, b, c], pk_columns: [a, b, c], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [t1.a, t1.b, t1.c] } StreamHashAgg { group_key: [t1.a, t1.b, t1.c], aggs: [count] } @@ -116,7 +116,7 @@ └─BatchExchange { order: [], dist: Single } └─BatchScan { table: t2, columns: [t2.a, t2.b, t2.c], distribution: UpstreamHashShard(t2.a) } stream_plan: | - StreamMaterialize { columns: [a, b, c], pk_columns: [a, b, c] } + StreamMaterialize { columns: [a, b, c], pk_columns: [a, b, c], pk_conflict: "no check" } └─StreamProject { exprs: [t1.a, t1.b, t1.c] } └─StreamHashAgg { group_key: [t1.a, t1.b, t1.c], aggs: [count] } └─StreamExchange { dist: HashShard(t1.a, t1.b, t1.c) } @@ -129,7 +129,7 @@ └─StreamTableScan { table: t2, columns: [t2.a, t2.b, t2.c], pk: [t2.a], dist: UpstreamHashShard(t2.a) } stream_dist_plan: | Fragment 0 - StreamMaterialize { columns: [a, b, c], pk_columns: [a, b, c] } + StreamMaterialize { columns: [a, b, c], pk_columns: [a, b, c], pk_conflict: "no check" } materialized table: 4294967294 StreamProject { exprs: [t1.a, t1.b, t1.c] } StreamHashAgg { group_key: [t1.a, t1.b, t1.c], aggs: [count] } diff --git a/src/frontend/planner_test/tests/testdata/watermark.yaml b/src/frontend/planner_test/tests/testdata/watermark.yaml index fb989822cb6c9..b18dfa545f184 100644 --- a/src/frontend/planner_test/tests/testdata/watermark.yaml +++ b/src/frontend/planner_test/tests/testdata/watermark.yaml @@ -7,7 +7,7 @@ LogicalProject { exprs: [(v1 - '00:00:02':Interval) as $expr1] } └─LogicalSource { source: t, columns: [v1, _row_id], time_range: [(Unbounded, Unbounded)] } stream_plan: | - StreamMaterialize { columns: [v1, _row_id(hidden)], pk_columns: [_row_id] } + StreamMaterialize { columns: [v1, _row_id(hidden)], pk_columns: [_row_id], pk_conflict: "no check" } └─StreamExchange { dist: HashShard(_row_id) } └─StreamProject { exprs: [(AtTimeZone((AtTimeZone(v1, 'UTC':Varchar) - '00:00:00':Interval), 'UTC':Varchar) - '00:00:02':Interval) as $expr1, _row_id], watermark_columns: [(AtTimeZone((AtTimeZone(v1, 'UTC':Varchar) - '00:00:00':Interval), 'UTC':Varchar) - '00:00:02':Interval)] } └─StreamRowIdGen { row_id_index: 1 } diff --git a/src/frontend/src/optimizer/plan_node/stream_materialize.rs b/src/frontend/src/optimizer/plan_node/stream_materialize.rs index 39f6f7edd1e9f..daad13346c5e3 100644 --- a/src/frontend/src/optimizer/plan_node/stream_materialize.rs +++ b/src/frontend/src/optimizer/plan_node/stream_materialize.rs @@ -235,6 +235,13 @@ impl fmt::Display for StreamMaterialize { if pk_column_names != order_descs { builder.field("order_descs", &format_args!("[{}]", order_descs)); } + + let pk_conflict_behavior = match self.table.handle_pk_conflict() { + true => "overwrite", + false => "no check", + }; + builder.field("pk_conflict", &pk_conflict_behavior); + builder.finish() } }