>From Preetham Poluparthi <[email protected]>: Preetham Poluparthi has submitted this change. ( https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20772?usp=email )
( 3 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: [ASTERIXDB-3683][COMP] Fix isomorphic window joins ...................................................................... [ASTERIXDB-3683][COMP] Fix isomorphic window joins - user model changes: no - storage format changes: no - interface changes: no Details: When comparing subplans, use the original operator instead of the copy. The copy is shallow and does not contain the source operator feeding the subplan. Ext-ref: MB-69788 Change-Id: I69f56d136621591de915628cd1e308e8743f946a Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20772 Tested-by: Jenkins <[email protected]> Reviewed-by: Preetham Poluparthi <[email protected]> Reviewed-by: Ali Alsuliman <[email protected]> --- M asterixdb/NOTICE A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/window/isomorphic/isomorphic.1.ddl.sqlpp A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/window/isomorphic/isomorphic.2.update.sqlpp A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/window/isomorphic/isomorphic.3.query.sqlpp A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/window/isomorphic/isomorphic.4.query.sqlpp A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/window/isomorphic/isomorphic.5.query.sqlpp A asterixdb/asterix-app/src/test/resources/runtimets/results/window/isomorphic/isomorphic.3.adm A asterixdb/asterix-app/src/test/resources/runtimets/results/window/isomorphic/isomorphic.4.adm A asterixdb/asterix-app/src/test/resources/runtimets/results/window/isomorphic/isomorphic.5.adm M asterixdb/asterix-app/src/test/resources/runtimets/sqlpp_queries.xml M hyracks-fullstack/NOTICE M hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/operators/logical/visitors/IsomorphismOperatorVisitor.java 12 files changed, 427 insertions(+), 37 deletions(-) Approvals: Preetham Poluparthi: Looks good to me, but someone else must approve Ali Alsuliman: Looks good to me, approved Jenkins: Verified diff --git a/asterixdb/NOTICE b/asterixdb/NOTICE index 5118782..a44569b 100644 --- a/asterixdb/NOTICE +++ b/asterixdb/NOTICE @@ -1,5 +1,5 @@ Apache AsterixDB -Copyright 2015-2025 The Apache Software Foundation +Copyright 2015-2026 The Apache Software Foundation This product includes software developed at The Apache Software Foundation (http://www.apache.org/). diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/window/isomorphic/isomorphic.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/window/isomorphic/isomorphic.1.ddl.sqlpp new file mode 100644 index 0000000..47a6a97 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/window/isomorphic/isomorphic.1.ddl.sqlpp @@ -0,0 +1,36 @@ +/* + * 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 : Isomorphic Window functions Test + * Expected Res : SUCCESS + */ + +drop dataverse test if exists; +create dataverse test; + +use test; + +create type prim as open { + `timestamp` : bigint + }; + +create dataset stock_market_price_usd(prim) +primary key `timestamp`; + + diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/window/isomorphic/isomorphic.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/window/isomorphic/isomorphic.2.update.sqlpp new file mode 100644 index 0000000..749d69b --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/window/isomorphic/isomorphic.2.update.sqlpp @@ -0,0 +1,30 @@ +/* + * 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 : Isomorphic Window functions Test + * Expected Res : SUCCESS + */ + +use test; + +INSERT INTO stock_market_price_usd( + SELECT VALUE {"timestamp": intVal + 1764530820000, "value" : 100 + intVal * 0.05 , "arr" : [ intVal%2 ] } + FROM range(1, 100) intVal +); + diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/window/isomorphic/isomorphic.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/window/isomorphic/isomorphic.3.query.sqlpp new file mode 100644 index 0000000..f9b48b7 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/window/isomorphic/isomorphic.3.query.sqlpp @@ -0,0 +1,33 @@ +/* + * 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 : Isomorphic Window functions Test + * Expected Res : SUCCESS + */ +use test; + +SELECT l.timestamp, (l.`value` + r.`value`) as `value` +FROM + ( SELECT timestamp, avg(`value`) OVER (ORDER BY timestamp RANGE BETWEEN 30 PRECEDING AND CURRENT ROW) AS `value` FROM stock_market_price_usd sub ) l + JOIN + ( SELECT timestamp, sum(`value`) OVER (ORDER BY timestamp RANGE BETWEEN 30 PRECEDING AND CURRENT ROW) AS `value` FROM stock_market_price_usd sub ) r + ON l.timestamp = r.timestamp +order by timestamp; + + diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/window/isomorphic/isomorphic.4.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/window/isomorphic/isomorphic.4.query.sqlpp new file mode 100644 index 0000000..a23aed6 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/window/isomorphic/isomorphic.4.query.sqlpp @@ -0,0 +1,33 @@ +/* + * 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 : Isomorphic Group-By functions Test + * Expected Res : SUCCESS + */ +use test; + +SELECT l.timestamp, (l.`value` + r.`value`) as `value` +FROM + ( SELECT timestamp, sum(`value`) AS `value` FROM stock_market_price_usd sub GROUP BY timestamp ) l + JOIN + ( SELECT timestamp, sum(`value`) AS `value` FROM stock_market_price_usd sub GROUP BY timestamp ) r + ON l.timestamp = r.timestamp +order by timestamp; + + diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/window/isomorphic/isomorphic.5.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/window/isomorphic/isomorphic.5.query.sqlpp new file mode 100644 index 0000000..085b21d --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/window/isomorphic/isomorphic.5.query.sqlpp @@ -0,0 +1,33 @@ +/* + * 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 : Isomorphic Subplan functions Test + * Expected Res : SUCCESS + */ +use test; + + +SELECT l.timestamp, (l.`value` + r.`value`) as `value` +FROM + ( SELECT timestamp, `value` FROM stock_market_price_usd sub WHERE ANY x in sub.arr satisfies x = 0 ) l + JOIN + ( SELECT timestamp, `value` FROM stock_market_price_usd sub WHERE ANY x in sub.arr satisfies x = 0 ) r + ON l.timestamp = r.timestamp +order by timestamp; + diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/window/isomorphic/isomorphic.3.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/window/isomorphic/isomorphic.3.adm new file mode 100644 index 0000000..9fda828 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/window/isomorphic/isomorphic.3.adm @@ -0,0 +1,100 @@ +{ "timestamp": 1764530820001, "value": 200.1 } +{ "timestamp": 1764530820002, "value": 300.22499999999997 } +{ "timestamp": 1764530820003, "value": 400.3999999999999 } +{ "timestamp": 1764530820004, "value": 500.62499999999994 } +{ "timestamp": 1764530820005, "value": 600.9 } +{ "timestamp": 1764530820006, "value": 701.2249999999999 } +{ "timestamp": 1764530820007, "value": 801.6 } +{ "timestamp": 1764530820008, "value": 902.025 } +{ "timestamp": 1764530820009, "value": 1002.5 } +{ "timestamp": 1764530820010, "value": 1103.025 } +{ "timestamp": 1764530820011, "value": 1203.6 } +{ "timestamp": 1764530820012, "value": 1304.225 } +{ "timestamp": 1764530820013, "value": 1404.8999999999999 } +{ "timestamp": 1764530820014, "value": 1505.625 } +{ "timestamp": 1764530820015, "value": 1606.4 } +{ "timestamp": 1764530820016, "value": 1707.225 } +{ "timestamp": 1764530820017, "value": 1808.1 } +{ "timestamp": 1764530820018, "value": 1909.0249999999999 } +{ "timestamp": 1764530820019, "value": 2010.0 } +{ "timestamp": 1764530820020, "value": 2111.025 } +{ "timestamp": 1764530820021, "value": 2212.1000000000004 } +{ "timestamp": 1764530820022, "value": 2313.225 } +{ "timestamp": 1764530820023, "value": 2414.4 } +{ "timestamp": 1764530820024, "value": 2515.625 } +{ "timestamp": 1764530820025, "value": 2616.9 } +{ "timestamp": 1764530820026, "value": 2718.2250000000004 } +{ "timestamp": 1764530820027, "value": 2819.6 } +{ "timestamp": 1764530820028, "value": 2921.025 } +{ "timestamp": 1764530820029, "value": 3022.5 } +{ "timestamp": 1764530820030, "value": 3124.025 } +{ "timestamp": 1764530820031, "value": 3225.6000000000004 } +{ "timestamp": 1764530820032, "value": 3227.2 } +{ "timestamp": 1764530820033, "value": 3228.8 } +{ "timestamp": 1764530820034, "value": 3230.3999999999996 } +{ "timestamp": 1764530820035, "value": 3232.0 } +{ "timestamp": 1764530820036, "value": 3233.6000000000004 } +{ "timestamp": 1764530820037, "value": 3235.2 } +{ "timestamp": 1764530820038, "value": 3236.8 } +{ "timestamp": 1764530820039, "value": 3238.3999999999996 } +{ "timestamp": 1764530820040, "value": 3240.0 } +{ "timestamp": 1764530820041, "value": 3241.6000000000004 } +{ "timestamp": 1764530820042, "value": 3243.2 } +{ "timestamp": 1764530820043, "value": 3244.8 } +{ "timestamp": 1764530820044, "value": 3246.3999999999996 } +{ "timestamp": 1764530820045, "value": 3248.0 } +{ "timestamp": 1764530820046, "value": 3249.6000000000004 } +{ "timestamp": 1764530820047, "value": 3251.2 } +{ "timestamp": 1764530820048, "value": 3252.8 } +{ "timestamp": 1764530820049, "value": 3254.3999999999996 } +{ "timestamp": 1764530820050, "value": 3256.0 } +{ "timestamp": 1764530820051, "value": 3257.6000000000004 } +{ "timestamp": 1764530820052, "value": 3259.2 } +{ "timestamp": 1764530820053, "value": 3260.8 } +{ "timestamp": 1764530820054, "value": 3262.3999999999996 } +{ "timestamp": 1764530820055, "value": 3264.0 } +{ "timestamp": 1764530820056, "value": 3265.6000000000004 } +{ "timestamp": 1764530820057, "value": 3267.2 } +{ "timestamp": 1764530820058, "value": 3268.8 } +{ "timestamp": 1764530820059, "value": 3270.3999999999996 } +{ "timestamp": 1764530820060, "value": 3272.0 } +{ "timestamp": 1764530820061, "value": 3273.6000000000004 } +{ "timestamp": 1764530820062, "value": 3275.2 } +{ "timestamp": 1764530820063, "value": 3276.8 } +{ "timestamp": 1764530820064, "value": 3278.3999999999996 } +{ "timestamp": 1764530820065, "value": 3280.0 } +{ "timestamp": 1764530820066, "value": 3281.6000000000004 } +{ "timestamp": 1764530820067, "value": 3283.2 } +{ "timestamp": 1764530820068, "value": 3284.8 } +{ "timestamp": 1764530820069, "value": 3286.3999999999996 } +{ "timestamp": 1764530820070, "value": 3288.0 } +{ "timestamp": 1764530820071, "value": 3289.6000000000004 } +{ "timestamp": 1764530820072, "value": 3291.2 } +{ "timestamp": 1764530820073, "value": 3292.8 } +{ "timestamp": 1764530820074, "value": 3294.3999999999996 } +{ "timestamp": 1764530820075, "value": 3296.0 } +{ "timestamp": 1764530820076, "value": 3297.6000000000004 } +{ "timestamp": 1764530820077, "value": 3299.2 } +{ "timestamp": 1764530820078, "value": 3300.8 } +{ "timestamp": 1764530820079, "value": 3302.3999999999996 } +{ "timestamp": 1764530820080, "value": 3304.0 } +{ "timestamp": 1764530820081, "value": 3305.6000000000004 } +{ "timestamp": 1764530820082, "value": 3307.2 } +{ "timestamp": 1764530820083, "value": 3308.8 } +{ "timestamp": 1764530820084, "value": 3310.3999999999996 } +{ "timestamp": 1764530820085, "value": 3312.0 } +{ "timestamp": 1764530820086, "value": 3313.6000000000004 } +{ "timestamp": 1764530820087, "value": 3315.2 } +{ "timestamp": 1764530820088, "value": 3316.8 } +{ "timestamp": 1764530820089, "value": 3318.3999999999996 } +{ "timestamp": 1764530820090, "value": 3320.0 } +{ "timestamp": 1764530820091, "value": 3321.6000000000004 } +{ "timestamp": 1764530820092, "value": 3323.2 } +{ "timestamp": 1764530820093, "value": 3324.8 } +{ "timestamp": 1764530820094, "value": 3326.3999999999996 } +{ "timestamp": 1764530820095, "value": 3328.0 } +{ "timestamp": 1764530820096, "value": 3329.6000000000004 } +{ "timestamp": 1764530820097, "value": 3331.2 } +{ "timestamp": 1764530820098, "value": 3332.8 } +{ "timestamp": 1764530820099, "value": 3334.3999999999996 } +{ "timestamp": 1764530820100, "value": 3336.0 } diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/window/isomorphic/isomorphic.4.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/window/isomorphic/isomorphic.4.adm new file mode 100644 index 0000000..c7d4b34 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/window/isomorphic/isomorphic.4.adm @@ -0,0 +1,100 @@ +{ "timestamp": 1764530820001, "value": 200.1 } +{ "timestamp": 1764530820002, "value": 200.2 } +{ "timestamp": 1764530820003, "value": 200.3 } +{ "timestamp": 1764530820004, "value": 200.4 } +{ "timestamp": 1764530820005, "value": 200.5 } +{ "timestamp": 1764530820006, "value": 200.6 } +{ "timestamp": 1764530820007, "value": 200.7 } +{ "timestamp": 1764530820008, "value": 200.8 } +{ "timestamp": 1764530820009, "value": 200.9 } +{ "timestamp": 1764530820010, "value": 201.0 } +{ "timestamp": 1764530820011, "value": 201.1 } +{ "timestamp": 1764530820012, "value": 201.2 } +{ "timestamp": 1764530820013, "value": 201.3 } +{ "timestamp": 1764530820014, "value": 201.4 } +{ "timestamp": 1764530820015, "value": 201.5 } +{ "timestamp": 1764530820016, "value": 201.6 } +{ "timestamp": 1764530820017, "value": 201.7 } +{ "timestamp": 1764530820018, "value": 201.8 } +{ "timestamp": 1764530820019, "value": 201.9 } +{ "timestamp": 1764530820020, "value": 202.0 } +{ "timestamp": 1764530820021, "value": 202.1 } +{ "timestamp": 1764530820022, "value": 202.2 } +{ "timestamp": 1764530820023, "value": 202.3 } +{ "timestamp": 1764530820024, "value": 202.4 } +{ "timestamp": 1764530820025, "value": 202.5 } +{ "timestamp": 1764530820026, "value": 202.6 } +{ "timestamp": 1764530820027, "value": 202.7 } +{ "timestamp": 1764530820028, "value": 202.8 } +{ "timestamp": 1764530820029, "value": 202.9 } +{ "timestamp": 1764530820030, "value": 203.0 } +{ "timestamp": 1764530820031, "value": 203.1 } +{ "timestamp": 1764530820032, "value": 203.2 } +{ "timestamp": 1764530820033, "value": 203.3 } +{ "timestamp": 1764530820034, "value": 203.4 } +{ "timestamp": 1764530820035, "value": 203.5 } +{ "timestamp": 1764530820036, "value": 203.6 } +{ "timestamp": 1764530820037, "value": 203.7 } +{ "timestamp": 1764530820038, "value": 203.8 } +{ "timestamp": 1764530820039, "value": 203.9 } +{ "timestamp": 1764530820040, "value": 204.0 } +{ "timestamp": 1764530820041, "value": 204.1 } +{ "timestamp": 1764530820042, "value": 204.2 } +{ "timestamp": 1764530820043, "value": 204.3 } +{ "timestamp": 1764530820044, "value": 204.4 } +{ "timestamp": 1764530820045, "value": 204.5 } +{ "timestamp": 1764530820046, "value": 204.6 } +{ "timestamp": 1764530820047, "value": 204.7 } +{ "timestamp": 1764530820048, "value": 204.8 } +{ "timestamp": 1764530820049, "value": 204.9 } +{ "timestamp": 1764530820050, "value": 205.0 } +{ "timestamp": 1764530820051, "value": 205.1 } +{ "timestamp": 1764530820052, "value": 205.2 } +{ "timestamp": 1764530820053, "value": 205.3 } +{ "timestamp": 1764530820054, "value": 205.4 } +{ "timestamp": 1764530820055, "value": 205.5 } +{ "timestamp": 1764530820056, "value": 205.6 } +{ "timestamp": 1764530820057, "value": 205.7 } +{ "timestamp": 1764530820058, "value": 205.8 } +{ "timestamp": 1764530820059, "value": 205.9 } +{ "timestamp": 1764530820060, "value": 206.0 } +{ "timestamp": 1764530820061, "value": 206.1 } +{ "timestamp": 1764530820062, "value": 206.2 } +{ "timestamp": 1764530820063, "value": 206.3 } +{ "timestamp": 1764530820064, "value": 206.4 } +{ "timestamp": 1764530820065, "value": 206.5 } +{ "timestamp": 1764530820066, "value": 206.6 } +{ "timestamp": 1764530820067, "value": 206.7 } +{ "timestamp": 1764530820068, "value": 206.8 } +{ "timestamp": 1764530820069, "value": 206.9 } +{ "timestamp": 1764530820070, "value": 207.0 } +{ "timestamp": 1764530820071, "value": 207.1 } +{ "timestamp": 1764530820072, "value": 207.2 } +{ "timestamp": 1764530820073, "value": 207.3 } +{ "timestamp": 1764530820074, "value": 207.4 } +{ "timestamp": 1764530820075, "value": 207.5 } +{ "timestamp": 1764530820076, "value": 207.6 } +{ "timestamp": 1764530820077, "value": 207.7 } +{ "timestamp": 1764530820078, "value": 207.8 } +{ "timestamp": 1764530820079, "value": 207.9 } +{ "timestamp": 1764530820080, "value": 208.0 } +{ "timestamp": 1764530820081, "value": 208.1 } +{ "timestamp": 1764530820082, "value": 208.2 } +{ "timestamp": 1764530820083, "value": 208.3 } +{ "timestamp": 1764530820084, "value": 208.4 } +{ "timestamp": 1764530820085, "value": 208.5 } +{ "timestamp": 1764530820086, "value": 208.6 } +{ "timestamp": 1764530820087, "value": 208.7 } +{ "timestamp": 1764530820088, "value": 208.8 } +{ "timestamp": 1764530820089, "value": 208.9 } +{ "timestamp": 1764530820090, "value": 209.0 } +{ "timestamp": 1764530820091, "value": 209.1 } +{ "timestamp": 1764530820092, "value": 209.2 } +{ "timestamp": 1764530820093, "value": 209.3 } +{ "timestamp": 1764530820094, "value": 209.4 } +{ "timestamp": 1764530820095, "value": 209.5 } +{ "timestamp": 1764530820096, "value": 209.6 } +{ "timestamp": 1764530820097, "value": 209.7 } +{ "timestamp": 1764530820098, "value": 209.8 } +{ "timestamp": 1764530820099, "value": 209.9 } +{ "timestamp": 1764530820100, "value": 210.0 } diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/window/isomorphic/isomorphic.5.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/window/isomorphic/isomorphic.5.adm new file mode 100644 index 0000000..bbc6466 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/window/isomorphic/isomorphic.5.adm @@ -0,0 +1,50 @@ +{ "timestamp": 1764530820002, "value": 200.2 } +{ "timestamp": 1764530820004, "value": 200.4 } +{ "timestamp": 1764530820006, "value": 200.6 } +{ "timestamp": 1764530820008, "value": 200.8 } +{ "timestamp": 1764530820010, "value": 201.0 } +{ "timestamp": 1764530820012, "value": 201.2 } +{ "timestamp": 1764530820014, "value": 201.4 } +{ "timestamp": 1764530820016, "value": 201.6 } +{ "timestamp": 1764530820018, "value": 201.8 } +{ "timestamp": 1764530820020, "value": 202.0 } +{ "timestamp": 1764530820022, "value": 202.2 } +{ "timestamp": 1764530820024, "value": 202.4 } +{ "timestamp": 1764530820026, "value": 202.6 } +{ "timestamp": 1764530820028, "value": 202.8 } +{ "timestamp": 1764530820030, "value": 203.0 } +{ "timestamp": 1764530820032, "value": 203.2 } +{ "timestamp": 1764530820034, "value": 203.4 } +{ "timestamp": 1764530820036, "value": 203.6 } +{ "timestamp": 1764530820038, "value": 203.8 } +{ "timestamp": 1764530820040, "value": 204.0 } +{ "timestamp": 1764530820042, "value": 204.2 } +{ "timestamp": 1764530820044, "value": 204.4 } +{ "timestamp": 1764530820046, "value": 204.6 } +{ "timestamp": 1764530820048, "value": 204.8 } +{ "timestamp": 1764530820050, "value": 205.0 } +{ "timestamp": 1764530820052, "value": 205.2 } +{ "timestamp": 1764530820054, "value": 205.4 } +{ "timestamp": 1764530820056, "value": 205.6 } +{ "timestamp": 1764530820058, "value": 205.8 } +{ "timestamp": 1764530820060, "value": 206.0 } +{ "timestamp": 1764530820062, "value": 206.2 } +{ "timestamp": 1764530820064, "value": 206.4 } +{ "timestamp": 1764530820066, "value": 206.6 } +{ "timestamp": 1764530820068, "value": 206.8 } +{ "timestamp": 1764530820070, "value": 207.0 } +{ "timestamp": 1764530820072, "value": 207.2 } +{ "timestamp": 1764530820074, "value": 207.4 } +{ "timestamp": 1764530820076, "value": 207.6 } +{ "timestamp": 1764530820078, "value": 207.8 } +{ "timestamp": 1764530820080, "value": 208.0 } +{ "timestamp": 1764530820082, "value": 208.2 } +{ "timestamp": 1764530820084, "value": 208.4 } +{ "timestamp": 1764530820086, "value": 208.6 } +{ "timestamp": 1764530820088, "value": 208.8 } +{ "timestamp": 1764530820090, "value": 209.0 } +{ "timestamp": 1764530820092, "value": 209.2 } +{ "timestamp": 1764530820094, "value": 209.4 } +{ "timestamp": 1764530820096, "value": 209.6 } +{ "timestamp": 1764530820098, "value": 209.8 } +{ "timestamp": 1764530820100, "value": 210.0 } diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/sqlpp_queries.xml b/asterixdb/asterix-app/src/test/resources/runtimets/sqlpp_queries.xml index edba9c2..af63f0b 100644 --- a/asterixdb/asterix-app/src/test/resources/runtimets/sqlpp_queries.xml +++ b/asterixdb/asterix-app/src/test/resources/runtimets/sqlpp_queries.xml @@ -16096,6 +16096,11 @@ </compilation-unit> </test-case> <test-case FilePath="window"> + <compilation-unit name="isomorphic"> + <output-dir compare="Text">isomorphic</output-dir> + </compilation-unit> + </test-case> + <test-case FilePath="window"> <compilation-unit name="lag_01"> <output-dir compare="Text">lag_01</output-dir> </compilation-unit> diff --git a/hyracks-fullstack/NOTICE b/hyracks-fullstack/NOTICE index 722db88..9050c82 100644 --- a/hyracks-fullstack/NOTICE +++ b/hyracks-fullstack/NOTICE @@ -1,5 +1,5 @@ Apache Hyracks and Algebricks -Copyright 2015-2025 The Apache Software Foundation +Copyright 2015-2026 The Apache Software Foundation This product includes software developed at The Apache Software Foundation (http://www.apache.org/). diff --git a/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/operators/logical/visitors/IsomorphismOperatorVisitor.java b/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/operators/logical/visitors/IsomorphismOperatorVisitor.java index 7ee3c53..c4264c4 100644 --- a/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/operators/logical/visitors/IsomorphismOperatorVisitor.java +++ b/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/operators/logical/visitors/IsomorphismOperatorVisitor.java @@ -175,21 +175,7 @@ GroupByOperator argOp = (GroupByOperator) arg; List<ILogicalPlan> plans = op.getNestedPlans(); List<ILogicalPlan> plansArg = argOp.getNestedPlans(); - for (int i = 0; i < plans.size(); i++) { - List<Mutable<ILogicalOperator>> roots = plans.get(i).getRoots(); - List<Mutable<ILogicalOperator>> rootsArg = plansArg.get(i).getRoots(); - if (roots.size() != rootsArg.size()) { - return Boolean.FALSE; - } - for (int j = 0; j < roots.size(); j++) { - ILogicalOperator topOp1 = roots.get(j).getValue(); - ILogicalOperator topOp2 = rootsArg.get(j).getValue(); - isomorphic = IsomorphismUtilities.isOperatorIsomorphicPlanSegment(topOp1, topOp2); - if (!isomorphic) { - return Boolean.FALSE; - } - } - } + isomorphic = compareSubplans(plans, plansArg); return isomorphic; } @@ -343,25 +329,9 @@ if (aop.getOperatorTag() != LogicalOperatorTag.SUBPLAN) { return Boolean.FALSE; } - SubplanOperator subplanOpArg = (SubplanOperator) copyAndSubstituteVar(op, arg); List<ILogicalPlan> plans = op.getNestedPlans(); - List<ILogicalPlan> plansArg = subplanOpArg.getNestedPlans(); - for (int i = 0; i < plans.size(); i++) { - List<Mutable<ILogicalOperator>> roots = plans.get(i).getRoots(); - List<Mutable<ILogicalOperator>> rootsArg = plansArg.get(i).getRoots(); - if (roots.size() == rootsArg.size()) { - return Boolean.FALSE; - } - for (int j = 0; j < roots.size(); j++) { - ILogicalOperator topOp1 = roots.get(j).getValue(); - ILogicalOperator topOp2 = rootsArg.get(j).getValue(); - boolean isomorphic = IsomorphismUtilities.isOperatorIsomorphicPlanSegment(topOp1, topOp2); - if (!isomorphic) { - return Boolean.FALSE; - } - } - } - return Boolean.TRUE; + List<ILogicalPlan> plansArg = ((SubplanOperator) arg).getNestedPlans(); + return compareSubplans(plans, plansArg); } @Override @@ -651,7 +621,7 @@ } // Check our nested plans as well. - return compareSubplans(op.getNestedPlans(), insertOpArg.getNestedPlans()); + return compareSubplans(op.getNestedPlans(), ((IndexInsertDeleteUpsertOperator) arg).getNestedPlans()); } @Override @@ -707,7 +677,7 @@ return false; } List<ILogicalPlan> plans = op.getNestedPlans(); - List<ILogicalPlan> plansArg = windowOpArg.getNestedPlans(); + List<ILogicalPlan> plansArg = ((WindowOperator) arg).getNestedPlans(); boolean isomorphic = compareSubplans(plans, plansArg); return isomorphic; } -- To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20772?usp=email To unsubscribe, or for help writing mail filters, visit https://asterix-gerrit.ics.uci.edu/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: asterixdb Gerrit-Branch: trinity Gerrit-Change-Id: I69f56d136621591de915628cd1e308e8743f946a Gerrit-Change-Number: 20772 Gerrit-PatchSet: 5 Gerrit-Owner: Preetham Poluparthi <[email protected]> Gerrit-Reviewer: Ali Alsuliman <[email protected]> Gerrit-Reviewer: Anon. E. Moose #1000171 Gerrit-Reviewer: Jenkins <[email protected]> Gerrit-Reviewer: Peeyush Gupta <[email protected]> Gerrit-Reviewer: Preetham Poluparthi <[email protected]>
