>From Shahrzad Shirazi <[email protected]>: Shahrzad Shirazi has uploaded this change for review. ( https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20991?usp=email )
Change subject: WIP: tests for hash-based-or ...................................................................... WIP: tests for hash-based-or Change-Id: I424bbe98fcf2b47c350f312ecf64c1ba025d0e71 --- M asterixdb/asterix-app/src/test/resources/runtimets/only_sqlpp.xml A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.1.ddl.sqlpp A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.10.query.sqlpp A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.11.query.sqlpp A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.12.query.sqlpp A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.13.query.sqlpp A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.14.query.sqlpp A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.2.update.sqlpp A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.3.query.sqlpp A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.4.query.sqlpp A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.5.query.sqlpp A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.6.query.sqlpp A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.7.query.sqlpp A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.8.update.sqlpp A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.9.query.sqlpp A asterixdb/asterix-app/src/test/resources/runtimets/results/hash-based-or/hash-based-or/hash-based-or.10.adm A asterixdb/asterix-app/src/test/resources/runtimets/results/hash-based-or/hash-based-or/hash-based-or.11.adm A asterixdb/asterix-app/src/test/resources/runtimets/results/hash-based-or/hash-based-or/hash-based-or.12.adm A asterixdb/asterix-app/src/test/resources/runtimets/results/hash-based-or/hash-based-or/hash-based-or.13.adm A asterixdb/asterix-app/src/test/resources/runtimets/results/hash-based-or/hash-based-or/hash-based-or.14.adm A asterixdb/asterix-app/src/test/resources/runtimets/results/hash-based-or/hash-based-or/hash-based-or.3.adm A asterixdb/asterix-app/src/test/resources/runtimets/results/hash-based-or/hash-based-or/hash-based-or.4.adm A asterixdb/asterix-app/src/test/resources/runtimets/results/hash-based-or/hash-based-or/hash-based-or.5.adm A asterixdb/asterix-app/src/test/resources/runtimets/results/hash-based-or/hash-based-or/hash-based-or.6.adm A asterixdb/asterix-app/src/test/resources/runtimets/results/hash-based-or/hash-based-or/hash-based-or.7.adm A asterixdb/asterix-app/src/test/resources/runtimets/results/hash-based-or/hash-based-or/hash-based-or.9.adm M asterixdb/asterix-app/src/test/resources/runtimets/sqlpp_queries.xml 27 files changed, 579 insertions(+), 0 deletions(-) git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/91/20991/1 diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/only_sqlpp.xml b/asterixdb/asterix-app/src/test/resources/runtimets/only_sqlpp.xml index 334dd52..8b66e37 100644 --- a/asterixdb/asterix-app/src/test/resources/runtimets/only_sqlpp.xml +++ b/asterixdb/asterix-app/src/test/resources/runtimets/only_sqlpp.xml @@ -19,5 +19,10 @@ !--> <test-suite xmlns="urn:xml.testframework.asterix.apache.org" ResultOffsetPath="results" QueryOffsetPath="queries_sqlpp" QueryFileExtension=".sqlpp"> <test-group name="failed"> + <test-case FilePath="hash-based-or"> + <compilation-unit name="hash-based-or"> + <output-dir compare="Text">hash-based-or</output-dir> + </compilation-unit> + </test-case> </test-group> </test-suite> diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.1.ddl.sqlpp new file mode 100644 index 0000000..f8798fa --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.1.ddl.sqlpp @@ -0,0 +1,31 @@ +/* + * 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. + */ + +DROP DATAVERSE gby IF EXISTS; +CREATE DATAVERSE gby; + +USE gby; + +CREATE TYPE EmpType AS { + age : int, + id : int + +}; + +CREATE DATASET Employee(EmpType) PRIMARY KEY id; diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.10.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.10.query.sqlpp new file mode 100644 index 0000000..919d89d --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.10.query.sqlpp @@ -0,0 +1,27 @@ +/* + * 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. + */ + +USE gby; + +SET `rewrite_or_as_join` "false"; +SET `hash_based_or` "true"; + +Explain Select * +FROM Employee e +WHERE age in [20.0,42.0,44] ; diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.11.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.11.query.sqlpp new file mode 100644 index 0000000..83afaee --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.11.query.sqlpp @@ -0,0 +1,27 @@ +/* + * 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. + */ + +USE gby; + +SET `rewrite_or_as_join` "false"; +SET `hash_based_or` "true"; + +Select * +FROM Employee e +WHERE age in [20.0,42.0,44] ; diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.12.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.12.query.sqlpp new file mode 100644 index 0000000..76629e1 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.12.query.sqlpp @@ -0,0 +1,27 @@ +/* + * 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. + */ + +USE gby; + +SET `rewrite_or_as_join` "false"; +SET `hash_based_or` "true"; + +Explain Select * +FROM Employee e +WHERE name in ["Fred1",42.0,44] ; diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.13.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.13.query.sqlpp new file mode 100644 index 0000000..87d4ca3 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.13.query.sqlpp @@ -0,0 +1,27 @@ +/* + * 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. + */ + +USE gby; + +SET `rewrite_or_as_join` "false"; +SET `hash_based_or` "true"; + +Explain Select * +FROM Employee e +WHERE name="Fred1" or age =22 or name="Fred"; diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.14.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.14.query.sqlpp new file mode 100644 index 0000000..a43627b --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.14.query.sqlpp @@ -0,0 +1,27 @@ +/* + * 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. + */ + +USE gby; + +SET `rewrite_or_as_join` "false"; +SET `hash_based_or` "true"; + +Explain Select * +FROM Employee e +WHERE age =22 or age=33 or age=2; diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.2.update.sqlpp new file mode 100644 index 0000000..b219461 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.2.update.sqlpp @@ -0,0 +1,54 @@ +/* + * 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. + */ + +USE gby; + +INSERT INTO Employee ( + [ + { 'name': 'Bill', + 'id' : 2, + 'deptno': 'K55', + 'salary': 2000, + 'age':20, + 'level':2, + 'salary':234 }, + + { 'name': 'Fred', + 'deptno': 'K55', + 'id' : 12, + 'salary': 3000, + 'age':42, + 'level':"2" }, + + { 'name': 'Fred2', + 'deptno': 'K15', + 'id' : 13, + 'salary': 2500, + 'age':23, + 'level':"2" }, + + { 'name': 'Fred1', + 'deptno': null, + 'id' : 31, + 'salary': 2500, + 'age':42, + 'level':"2" } + + ] +); \ No newline at end of file diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.3.query.sqlpp new file mode 100644 index 0000000..556ac5a --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.3.query.sqlpp @@ -0,0 +1,27 @@ +/* + * 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. + */ + +USE gby; + +SET `rewrite_or_as_join` "false"; +SET `hash_based_or` "true"; + +Select * +FROM Employee e +WHERE name in ["Fred", "Bill"]; diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.4.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.4.query.sqlpp new file mode 100644 index 0000000..ea2ecaa --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.4.query.sqlpp @@ -0,0 +1,27 @@ +/* + * 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. + */ + +USE gby; + +SET `rewrite_or_as_join` "false"; +SET `hash_based_or` "true"; + +Select * +FROM Employee e +WHERE name="Fred" or name="Bill" or name="Jack"; diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.5.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.5.query.sqlpp new file mode 100644 index 0000000..556ac5a --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.5.query.sqlpp @@ -0,0 +1,27 @@ +/* + * 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. + */ + +USE gby; + +SET `rewrite_or_as_join` "false"; +SET `hash_based_or` "true"; + +Select * +FROM Employee e +WHERE name in ["Fred", "Bill"]; diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.6.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.6.query.sqlpp new file mode 100644 index 0000000..ed1e025 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.6.query.sqlpp @@ -0,0 +1,27 @@ +/* + * 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. + */ + +USE gby; + +SET `rewrite_or_as_join` "false"; +SET `hash_based_or` "true"; + +Explain Select * +FROM Employee e +WHERE name="Fred" or name="Bill" or name="jack" ; diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.7.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.7.query.sqlpp new file mode 100644 index 0000000..ed1e025 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.7.query.sqlpp @@ -0,0 +1,27 @@ +/* + * 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. + */ + +USE gby; + +SET `rewrite_or_as_join` "false"; +SET `hash_based_or` "true"; + +Explain Select * +FROM Employee e +WHERE name="Fred" or name="Bill" or name="jack" ; diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.8.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.8.update.sqlpp new file mode 100644 index 0000000..0235bcc --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.8.update.sqlpp @@ -0,0 +1,22 @@ +/* + * 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. + */ + +USE gby; + +Create index againdx on Employee(age); \ No newline at end of file diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.9.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.9.query.sqlpp new file mode 100644 index 0000000..ad934a9 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/hash-based-or/hash-based-or/hash-based-or.9.query.sqlpp @@ -0,0 +1,27 @@ +/* + * 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. + */ + +USE gby; + +SET `rewrite_or_as_join` "false"; +SET `hash_based_or` "true"; + +Explain Select * +FROM Employee e +WHERE age=3 or name=3.3 or name=200 ; diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/hash-based-or/hash-based-or/hash-based-or.10.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/hash-based-or/hash-based-or/hash-based-or.10.adm new file mode 100644 index 0000000..eda0f70 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/hash-based-or/hash-based-or/hash-based-or.10.adm @@ -0,0 +1,20 @@ +distribute result [$$19] [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] +-- DISTRIBUTE_RESULT |PARTITIONED| + exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ONE_TO_ONE_EXCHANGE |PARTITIONED| + assign [$$19] <- [{"e": $$e}] project: [$$19] [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ASSIGN |PARTITIONED| + select (hash-based-or($$16, 20.0, 42.0, 44)) project: [$$e] [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- STREAM_SELECT |PARTITIONED| + assign [$$16] <- [$$e.getField(0)] [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ASSIGN |PARTITIONED| + project ([$$e]) [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- STREAM_PROJECT |PARTITIONED| + exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ONE_TO_ONE_EXCHANGE |PARTITIONED| + data-scan []<-[$$20, $$e] <- gby.Employee [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- DATASOURCE_SCAN |PARTITIONED| + exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ONE_TO_ONE_EXCHANGE |PARTITIONED| + empty-tuple-source [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- EMPTY_TUPLE_SOURCE |PARTITIONED| diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/hash-based-or/hash-based-or/hash-based-or.11.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/hash-based-or/hash-based-or/hash-based-or.11.adm new file mode 100644 index 0000000..8667ee0 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/hash-based-or/hash-based-or/hash-based-or.11.adm @@ -0,0 +1,3 @@ +{ "e": { "age": 42, "id": 12, "name": "Fred", "deptno": "K55", "salary": 3000, "level": "2" } } +{ "e": { "age": 20, "id": 2, "name": "Bill", "deptno": "K55", "salary": 2000, "level": 2 } } +{ "e": { "age": 42, "id": 31, "name": "Fred1", "deptno": null, "salary": 2500, "level": "2" } } diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/hash-based-or/hash-based-or/hash-based-or.12.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/hash-based-or/hash-based-or/hash-based-or.12.adm new file mode 100644 index 0000000..b30bfcf --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/hash-based-or/hash-based-or/hash-based-or.12.adm @@ -0,0 +1,20 @@ +distribute result [$$19] [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] +-- DISTRIBUTE_RESULT |PARTITIONED| + exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ONE_TO_ONE_EXCHANGE |PARTITIONED| + assign [$$19] <- [{"e": $$e}] project: [$$19] [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ASSIGN |PARTITIONED| + select (or(eq($$16, "Fred1"), eq($$16, 42.0), eq($$16, 44))) project: [$$e] [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- STREAM_SELECT |PARTITIONED| + assign [$$16] <- [$$e.getField("name")] [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ASSIGN |PARTITIONED| + project ([$$e]) [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- STREAM_PROJECT |PARTITIONED| + exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ONE_TO_ONE_EXCHANGE |PARTITIONED| + data-scan []<-[$$20, $$e] <- gby.Employee [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- DATASOURCE_SCAN |PARTITIONED| + exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ONE_TO_ONE_EXCHANGE |PARTITIONED| + empty-tuple-source [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- EMPTY_TUPLE_SOURCE |PARTITIONED| diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/hash-based-or/hash-based-or/hash-based-or.13.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/hash-based-or/hash-based-or/hash-based-or.13.adm new file mode 100644 index 0000000..45bdaf6 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/hash-based-or/hash-based-or/hash-based-or.13.adm @@ -0,0 +1,20 @@ +distribute result [$$21] [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] +-- DISTRIBUTE_RESULT |PARTITIONED| + exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ONE_TO_ONE_EXCHANGE |PARTITIONED| + assign [$$21] <- [{"e": $$e}] project: [$$21] [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ASSIGN |PARTITIONED| + select (or(eq($$22, "Fred1"), eq($$e.getField(0), 22), eq($$22, "Fred"))) project: [$$e] [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- STREAM_SELECT |PARTITIONED| + assign [$$22] <- [$$e.getField("name")] [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ASSIGN |PARTITIONED| + project ([$$e]) [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- STREAM_PROJECT |PARTITIONED| + exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ONE_TO_ONE_EXCHANGE |PARTITIONED| + data-scan []<-[$$23, $$e] <- gby.Employee [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- DATASOURCE_SCAN |PARTITIONED| + exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ONE_TO_ONE_EXCHANGE |PARTITIONED| + empty-tuple-source [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- EMPTY_TUPLE_SOURCE |PARTITIONED| diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/hash-based-or/hash-based-or/hash-based-or.14.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/hash-based-or/hash-based-or/hash-based-or.14.adm new file mode 100644 index 0000000..6aece57 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/hash-based-or/hash-based-or/hash-based-or.14.adm @@ -0,0 +1,34 @@ +distribute result [$$21] [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] +-- DISTRIBUTE_RESULT |PARTITIONED| + exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ONE_TO_ONE_EXCHANGE |PARTITIONED| + assign [$$21] <- [{"e": $$e}] project: [$$21] [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ASSIGN |PARTITIONED| + select (hash-based-or($$22, 22, 33, 2)) project: [$$e] [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- STREAM_SELECT |PARTITIONED| + assign [$$22] <- [$$e.getField(0)] [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ASSIGN |PARTITIONED| + project ([$$e]) [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- STREAM_PROJECT |PARTITIONED| + exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ONE_TO_ONE_EXCHANGE |PARTITIONED| + unnest-map [$$23, $$e] <- index-search("Employee", 0, "Default", "gby", "Employee", false, false, 1, $$27, 1, $$27, true, true, true) [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- BTREE_SEARCH |PARTITIONED| + exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ONE_TO_ONE_EXCHANGE |PARTITIONED| + order (ASC, $$27) [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- STABLE_SORT [$$27(ASC)] |PARTITIONED| + exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ONE_TO_ONE_EXCHANGE |PARTITIONED| + project ([$$27]) [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- STREAM_PROJECT |PARTITIONED| + exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ONE_TO_ONE_EXCHANGE |PARTITIONED| + unnest-map [$$26, $$27] <- index-search("againdx", 0, "Default", "gby", "Employee", false, false, 1, $$24, 1, $$24, true, true, true) [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- BTREE_SEARCH |PARTITIONED| + exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ONE_TO_ONE_EXCHANGE |PARTITIONED| + unnest $$24 <- scan-collection(array: [ 22, 33, 2 ]) [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- UNNEST |PARTITIONED| + empty-tuple-source [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- EMPTY_TUPLE_SOURCE |PARTITIONED| diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/hash-based-or/hash-based-or/hash-based-or.3.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/hash-based-or/hash-based-or/hash-based-or.3.adm new file mode 100644 index 0000000..8bbb55e --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/hash-based-or/hash-based-or/hash-based-or.3.adm @@ -0,0 +1,2 @@ +{ "e": { "age": 42, "id": 12, "name": "Fred", "deptno": "K55", "salary": 3000, "level": "2" } } +{ "e": { "age": 20, "id": 2, "name": "Bill", "deptno": "K55", "salary": 2000, "level": 2 } } diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/hash-based-or/hash-based-or/hash-based-or.4.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/hash-based-or/hash-based-or/hash-based-or.4.adm new file mode 100644 index 0000000..8bbb55e --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/hash-based-or/hash-based-or/hash-based-or.4.adm @@ -0,0 +1,2 @@ +{ "e": { "age": 42, "id": 12, "name": "Fred", "deptno": "K55", "salary": 3000, "level": "2" } } +{ "e": { "age": 20, "id": 2, "name": "Bill", "deptno": "K55", "salary": 2000, "level": 2 } } diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/hash-based-or/hash-based-or/hash-based-or.5.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/hash-based-or/hash-based-or/hash-based-or.5.adm new file mode 100644 index 0000000..8bbb55e --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/hash-based-or/hash-based-or/hash-based-or.5.adm @@ -0,0 +1,2 @@ +{ "e": { "age": 42, "id": 12, "name": "Fred", "deptno": "K55", "salary": 3000, "level": "2" } } +{ "e": { "age": 20, "id": 2, "name": "Bill", "deptno": "K55", "salary": 2000, "level": 2 } } diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/hash-based-or/hash-based-or/hash-based-or.6.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/hash-based-or/hash-based-or/hash-based-or.6.adm new file mode 100644 index 0000000..8a3573f --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/hash-based-or/hash-based-or/hash-based-or.6.adm @@ -0,0 +1,20 @@ +distribute result [$$21] [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] +-- DISTRIBUTE_RESULT |PARTITIONED| + exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ONE_TO_ONE_EXCHANGE |PARTITIONED| + assign [$$21] <- [{"e": $$e}] project: [$$21] [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ASSIGN |PARTITIONED| + select (hash-based-or($$22, "Fred", "Bill", "jack")) project: [$$e] [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- STREAM_SELECT |PARTITIONED| + assign [$$22] <- [$$e.getField("name")] [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ASSIGN |PARTITIONED| + project ([$$e]) [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- STREAM_PROJECT |PARTITIONED| + exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ONE_TO_ONE_EXCHANGE |PARTITIONED| + data-scan []<-[$$23, $$e] <- gby.Employee [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- DATASOURCE_SCAN |PARTITIONED| + exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ONE_TO_ONE_EXCHANGE |PARTITIONED| + empty-tuple-source [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- EMPTY_TUPLE_SOURCE |PARTITIONED| diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/hash-based-or/hash-based-or/hash-based-or.7.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/hash-based-or/hash-based-or/hash-based-or.7.adm new file mode 100644 index 0000000..8a3573f --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/hash-based-or/hash-based-or/hash-based-or.7.adm @@ -0,0 +1,20 @@ +distribute result [$$21] [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] +-- DISTRIBUTE_RESULT |PARTITIONED| + exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ONE_TO_ONE_EXCHANGE |PARTITIONED| + assign [$$21] <- [{"e": $$e}] project: [$$21] [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ASSIGN |PARTITIONED| + select (hash-based-or($$22, "Fred", "Bill", "jack")) project: [$$e] [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- STREAM_SELECT |PARTITIONED| + assign [$$22] <- [$$e.getField("name")] [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ASSIGN |PARTITIONED| + project ([$$e]) [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- STREAM_PROJECT |PARTITIONED| + exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ONE_TO_ONE_EXCHANGE |PARTITIONED| + data-scan []<-[$$23, $$e] <- gby.Employee [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- DATASOURCE_SCAN |PARTITIONED| + exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ONE_TO_ONE_EXCHANGE |PARTITIONED| + empty-tuple-source [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- EMPTY_TUPLE_SOURCE |PARTITIONED| diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/hash-based-or/hash-based-or/hash-based-or.9.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/hash-based-or/hash-based-or/hash-based-or.9.adm new file mode 100644 index 0000000..cf4538a --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/hash-based-or/hash-based-or/hash-based-or.9.adm @@ -0,0 +1,20 @@ +distribute result [$$21] [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] +-- DISTRIBUTE_RESULT |PARTITIONED| + exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ONE_TO_ONE_EXCHANGE |PARTITIONED| + assign [$$21] <- [{"e": $$e}] project: [$$21] [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ASSIGN |PARTITIONED| + select (or(eq($$e.getField(0), 3), eq($$22, 3.3), eq($$22, 200))) project: [$$e] [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- STREAM_SELECT |PARTITIONED| + assign [$$22] <- [$$e.getField("name")] [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ASSIGN |PARTITIONED| + project ([$$e]) [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- STREAM_PROJECT |PARTITIONED| + exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ONE_TO_ONE_EXCHANGE |PARTITIONED| + data-scan []<-[$$23, $$e] <- gby.Employee [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- DATASOURCE_SCAN |PARTITIONED| + exchange [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- ONE_TO_ONE_EXCHANGE |PARTITIONED| + empty-tuple-source [cardinality: 0.0, doc-size: 0.0, op-cost: 0.0, total-cost: 0.0] + -- EMPTY_TUPLE_SOURCE |PARTITIONED| 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 8cc6a21..083d22c 100644 --- a/asterixdb/asterix-app/src/test/resources/runtimets/sqlpp_queries.xml +++ b/asterixdb/asterix-app/src/test/resources/runtimets/sqlpp_queries.xml @@ -6051,6 +6051,13 @@ </compilation-unit> </test-case> </test-group> + <test-group name="hash-based-or"> + <test-case FilePath="hash-based-or"> + <compilation-unit name="hash-based-or"> + <output-dir compare="Text">hash-based-or</output-dir> + </compilation-unit> + </test-case> + </test-group> <test-group name="group-by"> <test-case FilePath="group-by"> <compilation-unit name="gby-array"> -- To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20991?usp=email To unsubscribe, or for help writing mail filters, visit https://asterix-gerrit.ics.uci.edu/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: asterixdb Gerrit-Branch: phoenix Gerrit-Change-Id: I424bbe98fcf2b47c350f312ecf64c1ba025d0e71 Gerrit-Change-Number: 20991 Gerrit-PatchSet: 1 Gerrit-Owner: Shahrzad Shirazi <[email protected]>
