Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[ASTERIXDB-3007][COMP] Fix ConsolidateWindowOperatorsRule
- user model changes: no - storage format changes: no - interface changes: no Details: - Fix ConsolidateWindowOperatorsRule to correclty merge window operator with subplans into window operator without subplans - Fix deep copy visitors for window operator with subplans - Add compiler sanity check code to verify that each nested tuple source operator correctly points to its datasource operator Change-Id: Ib9077a0331ab57cdd449426be77f05741d0778cc Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/15063 Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu> Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu> Reviewed-by: Dmitry Lychagin <dmitry.lychagin@couchbase.com> Reviewed-by: Ali Alsuliman <ali.al.solaiman@gmail.com>
- Loading branch information
Dmitry Lychagin
committed
Feb 1, 2022
1 parent
9e1c416
commit 11a30f10ab84c523cbea10b879bd1c2a245dda00
Showing
8 changed files
with
161 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
/* | ||
* Description : Test fix for ASTERIXDB-3007 | ||
* Expected Res : SUCCESS | ||
*/ | ||
|
||
with ds1 as ( | ||
select r as t, r*r as x | ||
from range(1, 10) r | ||
) | ||
|
||
select t, x, dt, dx, int(v) as v, int(a) as a | ||
from ds1 | ||
let dt = t - lag(t) over (order by t), | ||
dx = x - lag(x) over (order by t), | ||
v = dx/dt, | ||
a = v - lag(v) over (order by t) | ||
order by t; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
-- DISTRIBUTE_RESULT |LOCAL| | ||
-- ONE_TO_ONE_EXCHANGE |LOCAL| | ||
-- STREAM_PROJECT |LOCAL| | ||
-- ASSIGN |LOCAL| | ||
-- STREAM_PROJECT |LOCAL| | ||
-- ASSIGN |LOCAL| | ||
-- STREAM_PROJECT |LOCAL| | ||
-- WINDOW |LOCAL| | ||
{ | ||
-- AGGREGATE |LOCAL| | ||
-- NESTED_TUPLE_SOURCE |LOCAL| | ||
} | ||
-- WINDOW |LOCAL| | ||
{ | ||
-- AGGREGATE |LOCAL| | ||
-- NESTED_TUPLE_SOURCE |LOCAL| | ||
} | ||
-- WINDOW_STREAM |LOCAL| | ||
-- ONE_TO_ONE_EXCHANGE |LOCAL| | ||
-- STABLE_SORT [$$r(ASC)] |LOCAL| | ||
-- ONE_TO_ONE_EXCHANGE |UNPARTITIONED| | ||
-- UNNEST |UNPARTITIONED| | ||
-- EMPTY_TUPLE_SOURCE |UNPARTITIONED| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
/* | ||
* Description : Test fix for ASTERIXDB-3007 | ||
* Expected Res : SUCCESS | ||
*/ | ||
|
||
use test; | ||
|
||
with ds1 as ( | ||
select r as t, r*r as x | ||
from range(1, 10) r | ||
) | ||
|
||
select t, x, dt, dx, int(v) as v, int(a) as a | ||
from ds1 | ||
let dt = t - lag(t) over (order by t), | ||
dx = x - lag(x) over (order by t), | ||
v = dx/dt, | ||
a = v - lag(v) over (order by t) | ||
order by t; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ "t": 1, "x": 1, "dt": null, "dx": null, "v": null, "a": null } | ||
{ "t": 2, "x": 4, "dt": 1, "dx": 3, "v": 3, "a": null } | ||
{ "t": 3, "x": 9, "dt": 1, "dx": 5, "v": 5, "a": 2 } | ||
{ "t": 4, "x": 16, "dt": 1, "dx": 7, "v": 7, "a": 2 } | ||
{ "t": 5, "x": 25, "dt": 1, "dx": 9, "v": 9, "a": 2 } | ||
{ "t": 6, "x": 36, "dt": 1, "dx": 11, "v": 11, "a": 2 } | ||
{ "t": 7, "x": 49, "dt": 1, "dx": 13, "v": 13, "a": 2 } | ||
{ "t": 8, "x": 64, "dt": 1, "dx": 15, "v": 15, "a": 2 } | ||
{ "t": 9, "x": 81, "dt": 1, "dx": 17, "v": 17, "a": 2 } | ||
{ "t": 10, "x": 100, "dt": 1, "dx": 19, "v": 19, "a": 2 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters