You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@asterixdb.apache.org by mb...@apache.org on 2018/03/10 21:50:55 UTC

[2/8] asterixdb git commit: [NO ISSUE][COMP][RT] Rename index-only test case directory

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-composite-idxonly-03/btree-sidx-composite-idxonly-03.1.ddl.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-composite-idxonly-03/btree-sidx-composite-idxonly-03.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-composite-idxonly-03/btree-sidx-composite-idxonly-03.1.ddl.sqlpp
new file mode 100644
index 0000000..4530d8d
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-composite-idxonly-03/btree-sidx-composite-idxonly-03.1.ddl.sqlpp
@@ -0,0 +1,60 @@
+/*
+ * 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     : Secondary BTree Index index-only selection plan verification test
+ *                  : This test is intended to verify that the secondary BTree index is
+ *                  : used in the optimized query plan.
+ *                  : In this plan, we fetch PK and SK based on a select condition that utilizes a secondary index.
+ *                  : The plan should have two paths after the secondary index-lookup.
+ *                  : The left path:
+ *                      ... -> unnest-map (sidx) -> split -> unnest-map (pidx) -> select   -> union -> ...
+ *                  : The right path:
+ *                      ... -> unnest-map (sidx) -> split -> select (the second condition) -> union -> ...
+ *  Expected Result : Success
+ *
+*/
+
+drop dataverse test if exists;
+create dataverse test;
+use test;
+
+create type MyRecord as closed {
+  id: int64,
+  docid: int64,
+  val1: int64,
+  title: string,
+  point: point,
+  kwds: string,
+  line1: line,
+  line2: line,
+  poly1: polygon,
+  poly2: polygon,
+  rec: rectangle,
+  circle: circle
+};
+
+create dataset MyData(MyRecord)
+  primary key id;
+
+create index btree_index_docid_val1 on MyData(docid,val1) type btree;
+create index rtree_index_point on MyData(point) type rtree;
+create index rtree_index_rec on MyData(rec) type rtree;
+create index ngram_index_title on MyData(title) type ngram(3);
+create index keyword_index_title on MyData(title) type keyword;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-composite-idxonly-03/btree-sidx-composite-idxonly-03.2.update.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-composite-idxonly-03/btree-sidx-composite-idxonly-03.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-composite-idxonly-03/btree-sidx-composite-idxonly-03.2.update.sqlpp
new file mode 100644
index 0000000..bc705b2
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-composite-idxonly-03/btree-sidx-composite-idxonly-03.2.update.sqlpp
@@ -0,0 +1,25 @@
+/*
+ * 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 test;
+
+load dataset MyData
+using localfs
+(("path"="asterix_nc1://data/spatial/spatialData2.json"),("format"="adm"));
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-composite-idxonly-03/btree-sidx-composite-idxonly-03.3.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-composite-idxonly-03/btree-sidx-composite-idxonly-03.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-composite-idxonly-03/btree-sidx-composite-idxonly-03.3.query.sqlpp
new file mode 100644
index 0000000..73c7632
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-composite-idxonly-03/btree-sidx-composite-idxonly-03.3.query.sqlpp
@@ -0,0 +1,25 @@
+/*
+ * 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 test;
+
+select element {"pk":o.id, "sk":o.docid, "sk2":o.val1}
+from MyData o
+where o.docid < 3 and o.val1 >= 3
+order by o.id;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-idxonly-01/btree-sidx-idxonly-01.1.ddl.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-idxonly-01/btree-sidx-idxonly-01.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-idxonly-01/btree-sidx-idxonly-01.1.ddl.sqlpp
new file mode 100644
index 0000000..c0e76e7
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-idxonly-01/btree-sidx-idxonly-01.1.ddl.sqlpp
@@ -0,0 +1,60 @@
+/*
+ * 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     : Secondary BTree Index index-only selection plan verification test
+ *                  : The test is intended to verify that the secondary BTree index is used in the optimized query plan.
+ *                  : In this plan, we fetch PK and SK based on a select condition that utilizes a secondary index.
+ *                  : The plan should have two paths after the secondary index-lookup.
+ *                  : The left path:
+ *                      ... -> unnest-map (sidx) -> split -> unnest-map (pidx) -> select -> union -> ...
+ *                  : The right path:
+ *                      ... -> unnest-map (sidx) -> split ->                             -> union -> ...
+ *  Expected Result : Success
+ *
+*/
+
+drop dataverse test if exists;
+create dataverse test;
+use test;
+
+create type MyRecord as closed {
+  id: int64,
+  docid: int64,
+  val1: int64,
+  title: string,
+  point: point,
+  kwds: string,
+  line1: line,
+  line2: line,
+  poly1: polygon,
+  poly2: polygon,
+  rec: rectangle,
+  circle: circle
+};
+
+create dataset MyData(MyRecord)
+  primary key id;
+
+create index btree_index_docid on MyData(docid) type btree;
+create index btree_index_val1 on MyData(val1) type btree;
+create index rtree_index_point on MyData(point) type rtree;
+create index rtree_index_rec on MyData(rec) type rtree;
+create index ngram_index_title on MyData(title) type ngram(3);
+create index keyword_index_title on MyData(title) type keyword;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-idxonly-01/btree-sidx-idxonly-01.10.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-idxonly-01/btree-sidx-idxonly-01.10.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-idxonly-01/btree-sidx-idxonly-01.10.query.sqlpp
new file mode 100644
index 0000000..1094ca1
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-idxonly-01/btree-sidx-idxonly-01.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 test;
+
+select value count(*) from (
+select o
+from MyData o
+where o.docid < 3
+order by o.id) a;
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-idxonly-01/btree-sidx-idxonly-01.2.update.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-idxonly-01/btree-sidx-idxonly-01.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-idxonly-01/btree-sidx-idxonly-01.2.update.sqlpp
new file mode 100644
index 0000000..bc705b2
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-idxonly-01/btree-sidx-idxonly-01.2.update.sqlpp
@@ -0,0 +1,25 @@
+/*
+ * 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 test;
+
+load dataset MyData
+using localfs
+(("path"="asterix_nc1://data/spatial/spatialData2.json"),("format"="adm"));
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-idxonly-01/btree-sidx-idxonly-01.3.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-idxonly-01/btree-sidx-idxonly-01.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-idxonly-01/btree-sidx-idxonly-01.3.query.sqlpp
new file mode 100644
index 0000000..a4311fe
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-idxonly-01/btree-sidx-idxonly-01.3.query.sqlpp
@@ -0,0 +1,25 @@
+/*
+ * 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 test;
+
+select element {"pk":o.id, "sk":o.docid}
+from MyData o
+where o.docid < 3
+order by o.id;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-idxonly-01/btree-sidx-idxonly-01.4.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-idxonly-01/btree-sidx-idxonly-01.4.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-idxonly-01/btree-sidx-idxonly-01.4.query.sqlpp
new file mode 100644
index 0000000..37c1d49
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-idxonly-01/btree-sidx-idxonly-01.4.query.sqlpp
@@ -0,0 +1,25 @@
+/*
+ * 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 test;
+
+select element {"pk":o.id}
+from MyData o
+where o.docid < 3
+order by o.id;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-idxonly-01/btree-sidx-idxonly-01.5.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-idxonly-01/btree-sidx-idxonly-01.5.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-idxonly-01/btree-sidx-idxonly-01.5.query.sqlpp
new file mode 100644
index 0000000..46aca8b
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-idxonly-01/btree-sidx-idxonly-01.5.query.sqlpp
@@ -0,0 +1,25 @@
+/*
+ * 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 test;
+
+select element {"sk":o.docid}
+from MyData o
+where o.docid < 3
+order by o.id;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-idxonly-01/btree-sidx-idxonly-01.6.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-idxonly-01/btree-sidx-idxonly-01.6.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-idxonly-01/btree-sidx-idxonly-01.6.query.sqlpp
new file mode 100644
index 0000000..226d9d9
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-idxonly-01/btree-sidx-idxonly-01.6.query.sqlpp
@@ -0,0 +1,26 @@
+/*
+ * 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 test;
+
+select value count(*) from (
+select element {"pk":o.id, "sk":o.docid}
+from MyData o
+where o.docid < 3
+order by o.id) a;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-idxonly-01/btree-sidx-idxonly-01.7.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-idxonly-01/btree-sidx-idxonly-01.7.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-idxonly-01/btree-sidx-idxonly-01.7.query.sqlpp
new file mode 100644
index 0000000..c97dc08
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-idxonly-01/btree-sidx-idxonly-01.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 test;
+
+select value count(*) from (
+select element {"pk":o.id}
+from MyData o
+where o.docid < 3
+order by o.id) a;
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-idxonly-01/btree-sidx-idxonly-01.8.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-idxonly-01/btree-sidx-idxonly-01.8.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-idxonly-01/btree-sidx-idxonly-01.8.query.sqlpp
new file mode 100644
index 0000000..b7676d8
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-idxonly-01/btree-sidx-idxonly-01.8.query.sqlpp
@@ -0,0 +1,26 @@
+/*
+ * 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 test;
+
+select value count(*) from (
+select element {"sk":o.docid}
+from MyData o
+where o.docid < 3
+order by o.id) a;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-idxonly-01/btree-sidx-idxonly-01.9.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-idxonly-01/btree-sidx-idxonly-01.9.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-idxonly-01/btree-sidx-idxonly-01.9.query.sqlpp
new file mode 100644
index 0000000..2db329a
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-idxonly-01/btree-sidx-idxonly-01.9.query.sqlpp
@@ -0,0 +1,26 @@
+/*
+ * 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 test;
+
+select value count(*) from (
+select element {"rec":o, "pk":o.id}
+from MyData o
+where o.docid < 3
+order by o.id) a;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-non-idxonly-01/btree-sidx-non-idxonly-01.1.ddl.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-non-idxonly-01/btree-sidx-non-idxonly-01.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-non-idxonly-01/btree-sidx-non-idxonly-01.1.ddl.sqlpp
new file mode 100644
index 0000000..c2251fd
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-non-idxonly-01/btree-sidx-non-idxonly-01.1.ddl.sqlpp
@@ -0,0 +1,56 @@
+/*
+ * 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     : Secondary BTree Index index-only selection plan verification test
+ *                  : The test is intended to verify that the secondary BTree index is used in the optimized query plan.
+ *                  : In this plan, we have multiple conditions that one index can cover.
+ *                  : Thus, index-only plan is not possible.
+ *  Expected Result : Success
+ *
+*/
+
+drop dataverse test if exists;
+create dataverse test;
+use test;
+
+create type MyRecord as closed {
+  id: int64,
+  docid: int64,
+  val1: int64,
+  title: string,
+  point: point,
+  kwds: string,
+  line1: line,
+  line2: line,
+  poly1: polygon,
+  poly2: polygon,
+  rec: rectangle,
+  circle: circle
+};
+
+create dataset MyData(MyRecord)
+  primary key id;
+
+create index btree_index_docid on MyData(docid) type btree;
+create index btree_index_val1 on MyData(val1) type btree;
+create index rtree_index_point on MyData(point) type rtree;
+create index rtree_index_rec on MyData(rec) type rtree;
+create index ngram_index_title on MyData(title) type ngram(3);
+create index keyword_index_title on MyData(title) type keyword;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-non-idxonly-01/btree-sidx-non-idxonly-01.2.update.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-non-idxonly-01/btree-sidx-non-idxonly-01.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-non-idxonly-01/btree-sidx-non-idxonly-01.2.update.sqlpp
new file mode 100644
index 0000000..37358b5
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-non-idxonly-01/btree-sidx-non-idxonly-01.2.update.sqlpp
@@ -0,0 +1,25 @@
+/*
+ * 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 test;
+
+load dataset MyData
+using localfs
+(("path"="asterix_nc1://data/spatial/spatialData2.json"),("format"="adm"));
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-non-idxonly-01/btree-sidx-non-idxonly-01.3.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-non-idxonly-01/btree-sidx-non-idxonly-01.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-non-idxonly-01/btree-sidx-non-idxonly-01.3.query.sqlpp
new file mode 100644
index 0000000..33888ee
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-sidx-non-idxonly-01/btree-sidx-non-idxonly-01.3.query.sqlpp
@@ -0,0 +1,25 @@
+/*
+ * 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 test;
+
+select value count(*) from (
+select element {"pk":o.id, "sk":o.point}
+from MyData o
+where o.docid < 10 and o.val1 < 3) a;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.1.ddl.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.1.ddl.sqlpp
deleted file mode 100644
index fe845b8..0000000
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.1.ddl.sqlpp
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * 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     : Secondary RTree Index index-only selection plan verification test
- *                  : The test is intended to verify that the secondary RTree index is used in the optimized query plan.
- *                  : In this plan, we fetch PK and SK based on a select condition that utilizes a secondary index.
- *                  : The plan should have two paths after the secondary index-lookup.
- *                  : The left path:
- *                      ... -> unnest-map (sidx) -> split -> unnest-map (pidx) -> select -> union -> ...
- *                  : The right path:
- *                      ... -> unnest-map (sidx) -> split ->                                union -> ...
- *  Expected Result : Success
- *
-*/
-
-drop dataverse test if exists;
-create dataverse test;
-use test;
-
-/* For raw Fragile data */
-create type FragileTypeRaw as closed {
-  row_id: int32,
-  sid: int32,
-  date: string,
-  day: int32,
-  time: string,
-  bpm: int32,
-  RR: float,
-  /* new string field and location field*/
-  text: string,
-  location: point,
-  text2: string
-
-};
-
-/* For cleaned Fragile data */
-create type FragileType as closed {
-  row_id: int32,
-  sid: int32,
-  date: date,
-  day: int32,
-  time: time,
-  bpm: int32,
-  RR: float,
-
-  /* new string field and location field*/
-  text: string,
-  location: point,
-  text2: string
-};
-
-/* Create dataset for loading raw Fragile data */
-create dataset Fragile_raw (FragileTypeRaw)
-primary key row_id;
-
-/* Create dataset for cleaned Fragile data */
-create dataset Fragile (FragileType)
-primary key row_id;
-
-
-/* Create rtree secondary index on dataset clean Fragile */
-create index cfLocation on Fragile(location) type rtree;
-create index cfLocation on Fragile_raw(location) type rtree;
-
-create type MyRecord as closed {
-  id: int64,
-  docid: int64,
-  val1: int64,
-  title: string,
-  point: point,
-  kwds: string,
-  line1: line,
-  line2: line,
-  poly1: polygon,
-  poly2: polygon,
-  rec: rectangle,
-  circle: circle
-};
-
-create dataset MyData(MyRecord)
-  primary key id;
-
-create index btree_index_docid on MyData(docid) type btree;
-create index btree_index_val1 on MyData(val1) type btree;
-create index rtree_index_point on MyData(point) type rtree;
-create index rtree_index_rec on MyData(rec) type rtree;
-create index ngram_index_title on MyData(title) type ngram(3);
-create index keyword_index_title on MyData(title) type keyword;
-
-

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.10.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.10.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.10.query.sqlpp
deleted file mode 100644
index 234ec09..0000000
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.10.query.sqlpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * 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 test;
-
-with area as (test.`create-rectangle`(point("0.0,0.0"), point("4.0,4.0")))
-select value count(*) from (
-select o
-from MyData as o
-where test.`spatial-intersect`(o.point, area)
-order by o.id) a;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.11.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.11.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.11.query.sqlpp
deleted file mode 100644
index d83edac..0000000
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.11.query.sqlpp
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * 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 test;
-
-with area as (test.`create-circle`(test.`create-point`(4.0,3.0), 5.0))
-select element {"id":o.id}
-from MyData as o
-where test.`spatial-intersect`(o.point, area)
-order by o.id;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.2.update.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.2.update.sqlpp
deleted file mode 100644
index aad34ef..0000000
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.2.update.sqlpp
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * 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 test;
-
-
-load dataset Fragile_raw using localfs
-(("path"="asterix_nc1://data/csv/fragile_02.adm"),("format"="adm")) pre-sorted;
-
-load dataset MyData
-using localfs
-(("path"="asterix_nc1://data/spatial/spatialData2.json"),("format"="adm"));
-

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.3.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.3.query.sqlpp
deleted file mode 100644
index 437adc8..0000000
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.3.query.sqlpp
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * 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 test;
-
-select value count(*) from (
-select x
-from  Fragile_raw as x
-where test.`spatial-intersect`(x.location, test.`create-polygon`([0.0,0.0, 2.0,2.0, 0.0,2.0, 2.0,0.0]))
-) a;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.4.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.4.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.4.query.sqlpp
deleted file mode 100644
index b01f08f..0000000
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.4.query.sqlpp
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * 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 test;
-
-with area as (test.`create-rectangle`(point("0.0,0.0"), point("4.0,4.0")))
-select element {"id":o.id}
-from MyData as o
-where test.`spatial-intersect`(o.point, area)
-order by o.id;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.5.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.5.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.5.query.sqlpp
deleted file mode 100644
index c6bc5ae..0000000
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.5.query.sqlpp
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * 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 test;
-
-with area as (test.`create-rectangle`(point("0.0,0.0"), point("4.0,4.0")))
-select element {"point":o.point}
-from MyData as o
-where test.`spatial-intersect`(o.point, area)
-order by o.id;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.6.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.6.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.6.query.sqlpp
deleted file mode 100644
index 2e38a96..0000000
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.6.query.sqlpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * 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 test;
-
-with area as (test.`create-rectangle`(point("0.0,0.0"), point("4.0,4.0")))
-select value count(*) from (
-select element {"id":o.id, "point":o.point}
-from MyData as o
-where test.`spatial-intersect`(o.point, area)
-order by o.id) a;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.7.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.7.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.7.query.sqlpp
deleted file mode 100644
index fa5d2e0..0000000
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.7.query.sqlpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * 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 test;
-
-with area as (test.`create-rectangle`(point("0.0,0.0"), point("4.0,4.0")))
-select value count(*) from (
-select element {"id":o.id}
-from MyData as o
-where test.`spatial-intersect`(o.point, area)
-order by o.id) a;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.8.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.8.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.8.query.sqlpp
deleted file mode 100644
index 6bee297..0000000
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.8.query.sqlpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * 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 test;
-
-with area as (test.`create-rectangle`(point("0.0,0.0"), point("4.0,4.0")))
-select value count(*) from (
-select element {"point":o.point}
-from MyData as o
-where test.`spatial-intersect`(o.point, area)
-order by o.id) a;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.9.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.9.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.9.query.sqlpp
deleted file mode 100644
index da070e6..0000000
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.9.query.sqlpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * 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 test;
-
-with area as (test.`create-rectangle`(point("0.0,0.0"), point("4.0,4.0")))
-select value count(*) from (
-select element {"rec":o, "id":o.id}
-from MyData as o
-where test.`spatial-intersect`(o.point, area)
-order by o.id) a;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-01/rtree-sidx-non-idxonly-01.1.ddl.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-01/rtree-sidx-non-idxonly-01.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-01/rtree-sidx-non-idxonly-01.1.ddl.sqlpp
deleted file mode 100644
index f5230ab..0000000
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-01/rtree-sidx-non-idxonly-01.1.ddl.sqlpp
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * 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     : Secondary full-text index index-only selection plan verification test
- *                  : The test is intended to verify that the secondary RTree index is used in the optimized query plan.
- *                  : In this plan, we have multiple conditions that one index can cover.
- *                  : Thus, index-only plan is not possible.
- *  Expected Result : Success
- *
-*/
-
-drop dataverse test if exists;
-create dataverse test;
-use test;
-
-create type MyRecord as closed {
-  id: int64,
-  docid: int64,
-  val1: int64,
-  title: string,
-  point: point,
-  kwds: string,
-  line1: line,
-  line2: line,
-  poly1: polygon,
-  poly2: polygon,
-  rec: rectangle,
-  circle: circle
-};
-
-create dataset MyData(MyRecord)
-  primary key id;
-
-create index btree_index_docid on MyData(docid) type btree;
-create index btree_index_val1 on MyData(val1) type btree;
-create index rtree_index_point on MyData(point) type rtree;
-create index rtree_index_rec on MyData(rec) type rtree;
-create index ngram_index_title on MyData(title) type ngram(3);
-create index keyword_index_title on MyData(title) type keyword;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-01/rtree-sidx-non-idxonly-01.2.update.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-01/rtree-sidx-non-idxonly-01.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-01/rtree-sidx-non-idxonly-01.2.update.sqlpp
deleted file mode 100644
index bc705b2..0000000
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-01/rtree-sidx-non-idxonly-01.2.update.sqlpp
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * 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 test;
-
-load dataset MyData
-using localfs
-(("path"="asterix_nc1://data/spatial/spatialData2.json"),("format"="adm"));
-

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-01/rtree-sidx-non-idxonly-01.3.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-01/rtree-sidx-non-idxonly-01.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-01/rtree-sidx-non-idxonly-01.3.query.sqlpp
deleted file mode 100644
index 8c1b943..0000000
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-01/rtree-sidx-non-idxonly-01.3.query.sqlpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * 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 test;
-
-with area as (test.`create-rectangle`(point("0.0,0.0"), point("4.0,4.0")))
-select value count(*) from (
-select element {"id":o.id, "point":o.point}
-from MyData as o
-where test.`spatial-intersect`(o.point, area) and o.val1 < 30
-) a;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-02/rtree-sidx-non-idxonly-02.1.ddl.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-02/rtree-sidx-non-idxonly-02.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-02/rtree-sidx-non-idxonly-02.1.ddl.sqlpp
deleted file mode 100644
index f8a0b48..0000000
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-02/rtree-sidx-non-idxonly-02.1.ddl.sqlpp
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * 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     : Secondary full-text index index-only selection plan verification test
- *                  : The test is intended to verify that the secondary RTree index is used in the optimized query plan.
- *                  : In this plan, we have a condition that uses a R-Tree index on polygon fields.
- *                  : Thus, index-only plan is not possible.
- *  Expected Result : Success
- *
-*/
-
-drop dataverse test if exists;
-create dataverse test;
-use test;
-
-create type MyRecord as closed {
-  id: int64,
-  docid: int64,
-  val1: int64,
-  title: string,
-  point: point,
-  kwds: string,
-  line1: line,
-  line2: line,
-  poly1: polygon,
-  poly2: polygon,
-  rec: rectangle,
-  circle: circle
-};
-
-create dataset MyData(MyRecord)
-  primary key id;
-
-create index btree_index_docid on MyData(docid) type btree;
-create index btree_index_val1 on MyData(val1) type btree;
-create index rtree_index_point on MyData(point) type rtree;
-create index rtree_index_rec on MyData(rec) type rtree;
-create index rtree_index_polygon on MyData(poly1) type rtree;
-create index ngram_index_title on MyData(title) type ngram(3);
-create index keyword_index_title on MyData(title) type keyword;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-02/rtree-sidx-non-idxonly-02.2.update.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-02/rtree-sidx-non-idxonly-02.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-02/rtree-sidx-non-idxonly-02.2.update.sqlpp
deleted file mode 100644
index bc705b2..0000000
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-02/rtree-sidx-non-idxonly-02.2.update.sqlpp
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * 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 test;
-
-load dataset MyData
-using localfs
-(("path"="asterix_nc1://data/spatial/spatialData2.json"),("format"="adm"));
-

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-02/rtree-sidx-non-idxonly-02.3.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-02/rtree-sidx-non-idxonly-02.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-02/rtree-sidx-non-idxonly-02.3.query.sqlpp
deleted file mode 100644
index 35c4850..0000000
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-02/rtree-sidx-non-idxonly-02.3.query.sqlpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * 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 test;
-
-with ps as [test.`point`("1.0,1.0"), test.`point`("3.0,3.0")]
-select value count(*) from (
-select element {"id":o.id, "point":o.point}
-from ps as p, MyData as o
-where test.`spatial-intersect`(p, o.poly1)
-) a;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-sidx-idxonly-01/rtree-sidx-idxonly-01.1.ddl.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-sidx-idxonly-01/rtree-sidx-idxonly-01.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-sidx-idxonly-01/rtree-sidx-idxonly-01.1.ddl.sqlpp
new file mode 100644
index 0000000..fe845b8
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-sidx-idxonly-01/rtree-sidx-idxonly-01.1.ddl.sqlpp
@@ -0,0 +1,107 @@
+/*
+ * 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     : Secondary RTree Index index-only selection plan verification test
+ *                  : The test is intended to verify that the secondary RTree index is used in the optimized query plan.
+ *                  : In this plan, we fetch PK and SK based on a select condition that utilizes a secondary index.
+ *                  : The plan should have two paths after the secondary index-lookup.
+ *                  : The left path:
+ *                      ... -> unnest-map (sidx) -> split -> unnest-map (pidx) -> select -> union -> ...
+ *                  : The right path:
+ *                      ... -> unnest-map (sidx) -> split ->                                union -> ...
+ *  Expected Result : Success
+ *
+*/
+
+drop dataverse test if exists;
+create dataverse test;
+use test;
+
+/* For raw Fragile data */
+create type FragileTypeRaw as closed {
+  row_id: int32,
+  sid: int32,
+  date: string,
+  day: int32,
+  time: string,
+  bpm: int32,
+  RR: float,
+  /* new string field and location field*/
+  text: string,
+  location: point,
+  text2: string
+
+};
+
+/* For cleaned Fragile data */
+create type FragileType as closed {
+  row_id: int32,
+  sid: int32,
+  date: date,
+  day: int32,
+  time: time,
+  bpm: int32,
+  RR: float,
+
+  /* new string field and location field*/
+  text: string,
+  location: point,
+  text2: string
+};
+
+/* Create dataset for loading raw Fragile data */
+create dataset Fragile_raw (FragileTypeRaw)
+primary key row_id;
+
+/* Create dataset for cleaned Fragile data */
+create dataset Fragile (FragileType)
+primary key row_id;
+
+
+/* Create rtree secondary index on dataset clean Fragile */
+create index cfLocation on Fragile(location) type rtree;
+create index cfLocation on Fragile_raw(location) type rtree;
+
+create type MyRecord as closed {
+  id: int64,
+  docid: int64,
+  val1: int64,
+  title: string,
+  point: point,
+  kwds: string,
+  line1: line,
+  line2: line,
+  poly1: polygon,
+  poly2: polygon,
+  rec: rectangle,
+  circle: circle
+};
+
+create dataset MyData(MyRecord)
+  primary key id;
+
+create index btree_index_docid on MyData(docid) type btree;
+create index btree_index_val1 on MyData(val1) type btree;
+create index rtree_index_point on MyData(point) type rtree;
+create index rtree_index_rec on MyData(rec) type rtree;
+create index ngram_index_title on MyData(title) type ngram(3);
+create index keyword_index_title on MyData(title) type keyword;
+
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-sidx-idxonly-01/rtree-sidx-idxonly-01.10.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-sidx-idxonly-01/rtree-sidx-idxonly-01.10.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-sidx-idxonly-01/rtree-sidx-idxonly-01.10.query.sqlpp
new file mode 100644
index 0000000..234ec09
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-sidx-idxonly-01/rtree-sidx-idxonly-01.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 test;
+
+with area as (test.`create-rectangle`(point("0.0,0.0"), point("4.0,4.0")))
+select value count(*) from (
+select o
+from MyData as o
+where test.`spatial-intersect`(o.point, area)
+order by o.id) a;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-sidx-idxonly-01/rtree-sidx-idxonly-01.11.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-sidx-idxonly-01/rtree-sidx-idxonly-01.11.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-sidx-idxonly-01/rtree-sidx-idxonly-01.11.query.sqlpp
new file mode 100644
index 0000000..d83edac
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-sidx-idxonly-01/rtree-sidx-idxonly-01.11.query.sqlpp
@@ -0,0 +1,26 @@
+/*
+ * 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 test;
+
+with area as (test.`create-circle`(test.`create-point`(4.0,3.0), 5.0))
+select element {"id":o.id}
+from MyData as o
+where test.`spatial-intersect`(o.point, area)
+order by o.id;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-sidx-idxonly-01/rtree-sidx-idxonly-01.2.update.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-sidx-idxonly-01/rtree-sidx-idxonly-01.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-sidx-idxonly-01/rtree-sidx-idxonly-01.2.update.sqlpp
new file mode 100644
index 0000000..aad34ef
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-sidx-idxonly-01/rtree-sidx-idxonly-01.2.update.sqlpp
@@ -0,0 +1,29 @@
+/*
+ * 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 test;
+
+
+load dataset Fragile_raw using localfs
+(("path"="asterix_nc1://data/csv/fragile_02.adm"),("format"="adm")) pre-sorted;
+
+load dataset MyData
+using localfs
+(("path"="asterix_nc1://data/spatial/spatialData2.json"),("format"="adm"));
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-sidx-idxonly-01/rtree-sidx-idxonly-01.3.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-sidx-idxonly-01/rtree-sidx-idxonly-01.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-sidx-idxonly-01/rtree-sidx-idxonly-01.3.query.sqlpp
new file mode 100644
index 0000000..437adc8
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-sidx-idxonly-01/rtree-sidx-idxonly-01.3.query.sqlpp
@@ -0,0 +1,26 @@
+/*
+ * 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 test;
+
+select value count(*) from (
+select x
+from  Fragile_raw as x
+where test.`spatial-intersect`(x.location, test.`create-polygon`([0.0,0.0, 2.0,2.0, 0.0,2.0, 2.0,0.0]))
+) a;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-sidx-idxonly-01/rtree-sidx-idxonly-01.4.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-sidx-idxonly-01/rtree-sidx-idxonly-01.4.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-sidx-idxonly-01/rtree-sidx-idxonly-01.4.query.sqlpp
new file mode 100644
index 0000000..b01f08f
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-sidx-idxonly-01/rtree-sidx-idxonly-01.4.query.sqlpp
@@ -0,0 +1,26 @@
+/*
+ * 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 test;
+
+with area as (test.`create-rectangle`(point("0.0,0.0"), point("4.0,4.0")))
+select element {"id":o.id}
+from MyData as o
+where test.`spatial-intersect`(o.point, area)
+order by o.id;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-sidx-idxonly-01/rtree-sidx-idxonly-01.5.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-sidx-idxonly-01/rtree-sidx-idxonly-01.5.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-sidx-idxonly-01/rtree-sidx-idxonly-01.5.query.sqlpp
new file mode 100644
index 0000000..c6bc5ae
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-sidx-idxonly-01/rtree-sidx-idxonly-01.5.query.sqlpp
@@ -0,0 +1,26 @@
+/*
+ * 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 test;
+
+with area as (test.`create-rectangle`(point("0.0,0.0"), point("4.0,4.0")))
+select element {"point":o.point}
+from MyData as o
+where test.`spatial-intersect`(o.point, area)
+order by o.id;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-sidx-idxonly-01/rtree-sidx-idxonly-01.6.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-sidx-idxonly-01/rtree-sidx-idxonly-01.6.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-sidx-idxonly-01/rtree-sidx-idxonly-01.6.query.sqlpp
new file mode 100644
index 0000000..2e38a96
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-sidx-idxonly-01/rtree-sidx-idxonly-01.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 test;
+
+with area as (test.`create-rectangle`(point("0.0,0.0"), point("4.0,4.0")))
+select value count(*) from (
+select element {"id":o.id, "point":o.point}
+from MyData as o
+where test.`spatial-intersect`(o.point, area)
+order by o.id) a;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-sidx-idxonly-01/rtree-sidx-idxonly-01.7.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-sidx-idxonly-01/rtree-sidx-idxonly-01.7.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-sidx-idxonly-01/rtree-sidx-idxonly-01.7.query.sqlpp
new file mode 100644
index 0000000..fa5d2e0
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-sidx-idxonly-01/rtree-sidx-idxonly-01.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 test;
+
+with area as (test.`create-rectangle`(point("0.0,0.0"), point("4.0,4.0")))
+select value count(*) from (
+select element {"id":o.id}
+from MyData as o
+where test.`spatial-intersect`(o.point, area)
+order by o.id) a;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-sidx-idxonly-01/rtree-sidx-idxonly-01.8.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-sidx-idxonly-01/rtree-sidx-idxonly-01.8.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-sidx-idxonly-01/rtree-sidx-idxonly-01.8.query.sqlpp
new file mode 100644
index 0000000..6bee297
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-sidx-idxonly-01/rtree-sidx-idxonly-01.8.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 test;
+
+with area as (test.`create-rectangle`(point("0.0,0.0"), point("4.0,4.0")))
+select value count(*) from (
+select element {"point":o.point}
+from MyData as o
+where test.`spatial-intersect`(o.point, area)
+order by o.id) a;