Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

planner/core: check the window func arg first before checking window specs #11613

Merged
merged 14 commits into from
Aug 10, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
planner/window: fix explain test(#11008)
  • Loading branch information
gaoxingliang committed Aug 9, 2019
commit 85d9720b3d7d6eb457fd77f706b73fe22f73c723
66 changes: 33 additions & 33 deletions cmd/explaintest/r/window_function.result
Original file line number Diff line number Diff line change
Expand Up @@ -4,48 +4,48 @@ create table t (a int, b int, c timestamp, index idx(a));
set @@tidb_enable_window_function = 1;
explain select sum(a) over() from t;
id count task operator info
Projection_8 10000.00 root sum(a) over()
└─Window_9 10000.00 root sum(cast(test.t.a)) over()
└─TableReader_11 10000.00 root data:TableScan_10
└─TableScan_10 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo
Projection_7 10000.00 root sum(a) over()
└─Window_8 10000.00 root sum(cast(test.t.a)) over()
└─TableReader_10 10000.00 root data:TableScan_9
└─TableScan_9 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo
explain select sum(a) over(partition by a) from t;
id count task operator info
Projection_8 10000.00 root sum(a) over(partition by a)
└─Window_9 10000.00 root sum(cast(test.t.a)) over(partition by test.t.a)
└─IndexReader_11 10000.00 root index:IndexScan_10
└─IndexScan_10 10000.00 cop table:t, index:a, range:[NULL,+inf], keep order:true, stats:pseudo
Projection_7 10000.00 root sum(a) over(partition by a)
└─Window_8 10000.00 root sum(cast(test.t.a)) over(partition by test.t.a)
└─IndexReader_10 10000.00 root index:IndexScan_9
└─IndexScan_9 10000.00 cop table:t, index:a, range:[NULL,+inf], keep order:true, stats:pseudo
explain select sum(a) over(partition by a order by b) from t;
id count task operator info
Projection_8 10000.00 root sum(a) over(partition by a order by b)
└─Window_9 10000.00 root sum(cast(test.t.a)) over(partition by test.t.a order by test.t.b asc range between unbounded preceding and current row)
└─Sort_12 10000.00 root test.t.a:asc, test.t.b:asc
└─TableReader_11 10000.00 root data:TableScan_10
└─TableScan_10 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo
Projection_7 10000.00 root sum(a) over(partition by a order by b)
└─Window_8 10000.00 root sum(cast(test.t.a)) over(partition by test.t.a order by test.t.b asc range between unbounded preceding and current row)
└─Sort_11 10000.00 root test.t.a:asc, test.t.b:asc
└─TableReader_10 10000.00 root data:TableScan_9
└─TableScan_9 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo
explain select sum(a) over(partition by a order by b rows unbounded preceding) from t;
id count task operator info
Projection_8 10000.00 root sum(a) over(partition by a order by b rows unbounded preceding)
└─Window_9 10000.00 root sum(cast(test.t.a)) over(partition by test.t.a order by test.t.b asc rows between unbounded preceding and current row)
└─Sort_12 10000.00 root test.t.a:asc, test.t.b:asc
└─TableReader_11 10000.00 root data:TableScan_10
└─TableScan_10 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo
Projection_7 10000.00 root sum(a) over(partition by a order by b rows unbounded preceding)
└─Window_8 10000.00 root sum(cast(test.t.a)) over(partition by test.t.a order by test.t.b asc rows between unbounded preceding and current row)
└─Sort_11 10000.00 root test.t.a:asc, test.t.b:asc
└─TableReader_10 10000.00 root data:TableScan_9
└─TableScan_9 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo
explain select sum(a) over(partition by a order by b rows between 1 preceding and 1 following) from t;
id count task operator info
Projection_8 10000.00 root sum(a) over(partition by a order by b rows between 1 preceding and 1 following)
└─Window_9 10000.00 root sum(cast(test.t.a)) over(partition by test.t.a order by test.t.b asc rows between 1 preceding and 1 following)
└─Sort_12 10000.00 root test.t.a:asc, test.t.b:asc
└─TableReader_11 10000.00 root data:TableScan_10
└─TableScan_10 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo
Projection_7 10000.00 root sum(a) over(partition by a order by b rows between 1 preceding and 1 following)
└─Window_8 10000.00 root sum(cast(test.t.a)) over(partition by test.t.a order by test.t.b asc rows between 1 preceding and 1 following)
└─Sort_11 10000.00 root test.t.a:asc, test.t.b:asc
└─TableReader_10 10000.00 root data:TableScan_9
└─TableScan_9 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo
explain select sum(a) over(partition by a order by b range between 1 preceding and 1 following) from t;
id count task operator info
Projection_8 10000.00 root sum(a) over(partition by a order by b range between 1 preceding and 1 following)
└─Window_9 10000.00 root sum(cast(test.t.a)) over(partition by test.t.a order by test.t.b asc range between 1 preceding and 1 following)
└─Sort_12 10000.00 root test.t.a:asc, test.t.b:asc
└─TableReader_11 10000.00 root data:TableScan_10
└─TableScan_10 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo
Projection_7 10000.00 root sum(a) over(partition by a order by b range between 1 preceding and 1 following)
└─Window_8 10000.00 root sum(cast(test.t.a)) over(partition by test.t.a order by test.t.b asc range between 1 preceding and 1 following)
└─Sort_11 10000.00 root test.t.a:asc, test.t.b:asc
└─TableReader_10 10000.00 root data:TableScan_9
└─TableScan_9 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo
explain select sum(a) over(partition by a order by c range between interval '2:30' minute_second preceding and interval '2:30' minute_second following) from t;
id count task operator info
Projection_8 10000.00 root sum(a) over(partition by a order by c range between interval '2:30' minute_second preceding and interval '2:30' minute_second following)
└─Window_9 10000.00 root sum(cast(test.t.a)) over(partition by test.t.a order by test.t.c asc range between interval "2:30" "MINUTE_SECOND" preceding and interval "2:30" "MINUTE_SECOND" following)
└─Sort_12 10000.00 root test.t.a:asc, test.t.c:asc
└─TableReader_11 10000.00 root data:TableScan_10
└─TableScan_10 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo
Projection_7 10000.00 root sum(a) over(partition by a order by c range between interval '2:30' minute_second preceding and interval '2:30' minute_second following)
└─Window_8 10000.00 root sum(cast(test.t.a)) over(partition by test.t.a order by test.t.c asc range between interval "2:30" "MINUTE_SECOND" preceding and interval "2:30" "MINUTE_SECOND" following)
└─Sort_11 10000.00 root test.t.a:asc, test.t.c:asc
└─TableReader_10 10000.00 root data:TableScan_9
└─TableScan_9 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo