[04/12] asterixdb git commit: [NO ISSUE][COMP][RT] Rename index-only test case files

2018-03-10 Thread wangsaeu
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/06cec01b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-join/btree-secondary-indexonly-plan-to-secondary-indexonly-plan-equi-join_01/btree-sidx-idxonly-to-sidx-idxonly-equi-join_01.2.update.sqlpp
--
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-join/btree-secondary-indexonly-plan-to-secondary-indexonly-plan-equi-join_01/btree-sidx-idxonly-to-sidx-idxonly-equi-join_01.2.update.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-join/btree-secondary-indexonly-plan-to-secondary-indexonly-plan-equi-join_01/btree-sidx-idxonly-to-sidx-idxonly-equi-join_01.2.update.sqlpp
new file mode 100644
index 000..dc5951f
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-join/btree-secondary-indexonly-plan-to-secondary-indexonly-plan-equi-join_01/btree-sidx-idxonly-to-sidx-idxonly-equi-join_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 Customers
+using localfs
+(("path"="asterix_nc1://data/nontagged/customerData2.json"),("format"="adm"));
+
+load dataset Orders
+using localfs
+(("path"="asterix_nc1://data/nontagged/orderData.json"),("format"="adm"));
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/06cec01b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-join/btree-secondary-indexonly-plan-to-secondary-indexonly-plan-equi-join_01/btree-sidx-idxonly-to-sidx-idxonly-equi-join_01.3.query.sqlpp
--
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-join/btree-secondary-indexonly-plan-to-secondary-indexonly-plan-equi-join_01/btree-sidx-idxonly-to-sidx-idxonly-equi-join_01.3.query.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-join/btree-secondary-indexonly-plan-to-secondary-indexonly-plan-equi-join_01/btree-sidx-idxonly-to-sidx-idxonly-equi-join_01.3.query.sqlpp
new file mode 100644
index 000..8e9417a
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-join/btree-secondary-indexonly-plan-to-secondary-indexonly-plan-equi-join_01/btree-sidx-idxonly-to-sidx-idxonly-equi-join_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 o.oid as oid, c.cid as cid
+from Orders o, Customers c
+where o.cid < 10 and o.cid /*+ indexnl */ = c.cashBack
+) a;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/06cec01b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-join/btree-secondary-non-indexonly-plan-to-primary-equi-join_01/btree-secondary-non-indexonly-plan-to-primary-equi-join_01.1.ddl.sqlpp
--
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-join/btree-secondary-non-indexonly-plan-to-primary-equi-join_01/btree-secondary-non-indexonly-plan-to-primary-equi-join_01.1.ddl.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-join/btree-secondary-non-indexonly-plan-to-primary-equi-join_01/btree-secondary-non-indexonly-plan-to-primary-equi-join_01.1.ddl.sqlpp

[11/12] asterixdb git commit: [NO ISSUE][COMP][RT] Rename index-only test case files

2018-03-10 Thread wangsaeu
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/06cec01b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-sidx-idxonly-01-disable-idxonly.sqlpp
--
diff --git 
a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-sidx-idxonly-01-disable-idxonly.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-sidx-idxonly-01-disable-idxonly.sqlpp
new file mode 100644
index 000..0be684e
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-sidx-idxonly-01-disable-idxonly.sqlpp
@@ -0,0 +1,67 @@
+/*
+ * 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 -> ...
+ *  : However, we set the "noindexonly" option to true. So, 
the index-only plan should not be triggered.
+ *  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;
+
+set noindexonly 'true';
+
+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/06cec01b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-sidx-idxonly-01.sqlpp
--
diff --git 
a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-sidx-idxonly-01.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-sidx-idxonly-01.sqlpp
new file mode 100644
index 000..af1a099
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-sidx-idxonly-01.sqlpp
@@ -0,0 +1,64 @@
+/*
+ * 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

[10/12] asterixdb git commit: [NO ISSUE][COMP][RT] Rename index-only test case files

2018-03-10 Thread wangsaeu
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/06cec01b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/rtree-index/rtree-sidx-idxonly-04.aql
--
diff --git 
a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/rtree-index/rtree-sidx-idxonly-04.aql
 
b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/rtree-index/rtree-sidx-idxonly-04.aql
new file mode 100644
index 000..27e9509
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/rtree-index/rtree-sidx-idxonly-04.aql
@@ -0,0 +1,114 @@
+/*
+ * 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 dataverse 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;
+
+count(
+let $area:=create-rectangle(point("0.0,0.0"), point("4.0,4.0"))
+for $o in dataset('MyData')
+where spatial-intersect($o.point, $area)
+order by $o.id
+return {"id":$o.id, "point":$o.point}
+);
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/06cec01b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/rtree-index/rtree-sidx-idxonly-05.aql
--
diff --git 
a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/rtree-index/rtree-sidx-idxonly-05.aql
 
b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/rtree-index/rtree-sidx-idxonly-05.aql
new file mode 100644
index 000..ad94c18
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/rtree-index/rtree-sidx-idxonly-05.aql
@@ -0,0 +1,114 @@
+/*
+ * 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 ownersh

[12/12] asterixdb git commit: [NO ISSUE][COMP][RT] Rename index-only test case files

2018-03-10 Thread wangsaeu
[NO ISSUE][COMP][RT] Rename index-only test case files

- user model changes: no
- storage format changes: no
- interface changes: no

Details:
- Rename index-only test case files to a shorter version
  not to cause issues on Windows environment.

Change-Id: I4a4bb7b045a430bd446aed756f58af7b4c2a6eaa
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2468
Sonar-Qube: Jenkins 
Tested-by: Jenkins 
Contrib: Jenkins 
Integration-Tests: Jenkins 
Reviewed-by: Till Westmann 


Project: http://git-wip-us.apache.org/repos/asf/asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/asterixdb/commit/06cec01b
Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/06cec01b
Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/06cec01b

Branch: refs/heads/master
Commit: 06cec01bb29b39e055a6bf5cc9434623cf6dbb8b
Parents: af9ee51
Author: Taewoo Kim 
Authored: Fri Mar 9 17:29:49 2018 -0800
Committer: Taewoo Kim 
Committed: Sat Mar 10 09:26:20 2018 -0800

--
 .../pidx-to-sidx-idxonly-equi-join_01.aql   |  69 +++
 ...to-secondary-indexonly-plan-equi-join_01.aql |  69 ---
 ...y-indexonly-plan-to-primary-equi-join_01.aql |  71 
 ...to-secondary-indexonly-plan-equi-join_01.aql |  72 
 ...to-secondary-indexonly-plan-equi-join_01.aql |  74 
 .../sidx-idxonly-to-pidx-equi-join_01.aql   |  71 
 ...idx-idxonly-to-sidx-idxonly-equi-join_01.aql |  72 
 ...non-idxonly-to-sidx-idxonly-equi-join_01.aql |  74 
 ...ondary-composite-index-indexonly-plan-01.aql |  64 ---
 ...dexonly-plan-01-disable-indexonly-plan.sqlpp |  67 ---
 ...tree-secondary-index-indexonly-plan-01.sqlpp |  64 ---
 .../btree-secondary-index-indexonly-plan-02.aql |  65 ---
 .../btree-secondary-index-indexonly-plan-03.aql |  65 ---
 .../btree-secondary-index-indexonly-plan-04.aql |  67 ---
 .../btree-secondary-index-indexonly-plan-05.aql |  67 ---
 .../btree-secondary-index-indexonly-plan-06.aql |  67 ---
 .../btree-secondary-index-indexonly-plan-07.aql |  67 ---
 .../btree-secondary-index-indexonly-plan-08.aql |  67 ---
 .../btree-secondary-index-indexonly-plan-09.aql |  50 
 .../btree-sidx-composite-idxonly-01.aql |  64 +++
 .../btree-sidx-idxonly-01-disable-idxonly.sqlpp |  67 +++
 .../btree-index/btree-sidx-idxonly-01.sqlpp |  64 +++
 .../btree-index/btree-sidx-idxonly-02.aql   |  65 +++
 .../btree-index/btree-sidx-idxonly-03.aql   |  65 +++
 .../btree-index/btree-sidx-idxonly-04.aql   |  67 +++
 .../btree-index/btree-sidx-idxonly-05.aql   |  67 +++
 .../btree-index/btree-sidx-idxonly-06.aql   |  67 +++
 .../btree-index/btree-sidx-idxonly-07.aql   |  67 +++
 .../btree-index/btree-sidx-idxonly-08.aql   |  67 +++
 .../btree-index/btree-sidx-idxonly-09.aql   |  50 
 ...dexonly-plan-01-disable-indexonly-plan.sqlpp | 114 ---
 ...tree-secondary-index-indexonly-plan-01.sqlpp | 111 --
 .../rtree-secondary-index-indexonly-plan-02.aql | 111 --
 .../rtree-secondary-index-indexonly-plan-03.aql | 111 --
 .../rtree-secondary-index-indexonly-plan-04.aql | 114 ---
 .../rtree-secondary-index-indexonly-plan-05.aql | 114 ---
 .../rtree-secondary-index-indexonly-plan-06.aql | 114 ---
 .../rtree-secondary-index-indexonly-plan-07.aql | 114 ---
 .../rtree-secondary-index-indexonly-plan-08.aql | 114 ---
 .../rtree-secondary-index-indexonly-plan-09.aql | 112 --
 .../rtree-sidx-idxonly-01-disable-idxonly.sqlpp | 114 +++
 .../rtree-index/rtree-sidx-idxonly-01.sqlpp | 111 ++
 .../rtree-index/rtree-sidx-idxonly-02.aql   | 111 ++
 .../rtree-index/rtree-sidx-idxonly-03.aql   | 111 ++
 .../rtree-index/rtree-sidx-idxonly-04.aql   | 114 +++
 .../rtree-index/rtree-sidx-idxonly-05.aql   | 114 +++
 .../rtree-index/rtree-sidx-idxonly-06.aql   | 114 +++
 .../rtree-index/rtree-sidx-idxonly-07.aql   | 114 +++
 .../rtree-index/rtree-sidx-idxonly-08.aql   | 114 +++
 .../rtree-index/rtree-sidx-idxonly-09.aql   | 112 ++
 .../pidx-to-sidx-idxonly-equi-join_01.plan  |  45 
 ...o-secondary-indexonly-plan-equi-join_01.plan |  45 
 ...-indexonly-plan-to-primary-equi-join_01.plan |  36 --
 ...o-secondary-indexonly-plan-equi-join_01.plan |  81 -
 ...o-secondary-indexonly-plan-equi-join_01.plan |  65 ---
 .../sidx-idxonly-to-pidx-equi-join_01.plan  |  36 ++
 ...dx-idxonly-to-sidx-idxonly-equi-join_01.plan |  81 +
 ...o

[07/12] asterixdb git commit: [NO ISSUE][COMP][RT] Rename index-only test case files

2018-03-10 Thread wangsaeu
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/06cec01b/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-leftouterjoin/probe-sidx-btree-indexonly-plan-with-join-btree-pidx1/probe-sidx-btree-idxonly-join-btree-pidx1.2.update.aql
--
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-leftouterjoin/probe-sidx-btree-indexonly-plan-with-join-btree-pidx1/probe-sidx-btree-idxonly-join-btree-pidx1.2.update.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-leftouterjoin/probe-sidx-btree-indexonly-plan-with-join-btree-pidx1/probe-sidx-btree-idxonly-join-btree-pidx1.2.update.aql
new file mode 100644
index 000..a045bf9
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-leftouterjoin/probe-sidx-btree-indexonly-plan-with-join-btree-pidx1/probe-sidx-btree-idxonly-join-btree-pidx1.2.update.aql
@@ -0,0 +1,24 @@
+/*
+ * 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 dataverse test;
+
+load dataset TweetMessages
+using localfs
+(("path"="asterix_nc1://data/twitter/tw_for_indexleftouterjoin.adm"),("format"="adm"));

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/06cec01b/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-leftouterjoin/probe-sidx-btree-indexonly-plan-with-join-btree-pidx1/probe-sidx-btree-idxonly-join-btree-pidx1.3.query.aql
--
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-leftouterjoin/probe-sidx-btree-indexonly-plan-with-join-btree-pidx1/probe-sidx-btree-idxonly-join-btree-pidx1.3.query.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-leftouterjoin/probe-sidx-btree-indexonly-plan-with-join-btree-pidx1/probe-sidx-btree-idxonly-join-btree-pidx1.3.query.aql
new file mode 100644
index 000..87d68f6
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-leftouterjoin/probe-sidx-btree-indexonly-plan-with-join-btree-pidx1/probe-sidx-btree-idxonly-join-btree-pidx1.3.query.aql
@@ -0,0 +1,32 @@
+/*
+ * 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 dataverse test;
+
+count(
+for $t1 in dataset('TweetMessages')
+where $t1.countA > 0
+return {
+"tweetid1": $t1.tweetid,
+"count1":$t1.countA,
+"t2info": for $t2 in dataset('TweetMessages')
+where $t1.countA /* +indexnl */= $t2.tweetid
+return {"tweetid2": $t2.tweetid,
+"count2": $t2.countB}
+});

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/06cec01b/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-leftouterjoin/probe-sidx-btree-indexonly-plan-with-join-btree-pidx1/probe-sidx-btree-indexonly-plan-with-join-btree-pidx1.1.ddl.aql
--
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-leftouterjoin/probe-sidx-btree-indexonly-plan-with-join-btree-pidx1/probe-sidx-btree-indexonly-plan-with-join-btree-pidx1.1.ddl.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-leftouterjoin/probe-sidx-btree-indexonly-plan-with-join-btree-pidx1/probe-sidx-btree-indexonly-plan-with-join-btree-pidx1.1.ddl.aql
deleted file mode 100644
index 8c56ff4..000
--- 
a/asterixdb/asterix-app/src/test/resour

[08/12] asterixdb git commit: [NO ISSUE][COMP][RT] Rename index-only test case files

2018-03-10 Thread wangsaeu
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/06cec01b/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-join/btree-primary-to-secondary-indexonly-plan-equi-join_01/btree-pidx-to-sidx-idxonly-equi-join_01.1.ddl.aql
--
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-join/btree-primary-to-secondary-indexonly-plan-equi-join_01/btree-pidx-to-sidx-idxonly-equi-join_01.1.ddl.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-join/btree-primary-to-secondary-indexonly-plan-equi-join_01/btree-pidx-to-sidx-idxonly-equi-join_01.1.ddl.aql
new file mode 100644
index 000..efa4aee
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-join/btree-primary-to-secondary-indexonly-plan-equi-join_01/btree-pidx-to-sidx-idxonly-equi-join_01.1.ddl.aql
@@ -0,0 +1,64 @@
+/*
+ * 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: Equi joins two datasets, Customers and Orders, based on 
the customer id.
+ *  Given the 'indexnl' hint we expect the join to be 
transformed
+ *  into an indexed nested-loop join using Orders' secondary 
index.
+ * Success: Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type AddressType as open {
+  number: int64,
+  street: string,
+  city: string
+}
+
+create type CustomerType as closed {
+  cid: int64,
+  name: string,
+  cashBack: int64,
+  age: int64?,
+  address: AddressType?,
+  lastorder: {
+oid: int64,
+total: float
+  }
+}
+
+create type OrderType as open {
+  oid: int64,
+  cid: int64,
+  orderstatus: string,
+  orderpriority: string,
+  clerk: string,
+  total: float,
+  items: [int64]
+}
+
+create dataset Customers(CustomerType) primary key cid;
+create dataset Orders(OrderType) primary key oid;
+
+create index CustomerID_idx on Orders(cid);
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/06cec01b/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-join/btree-primary-to-secondary-indexonly-plan-equi-join_01/btree-pidx-to-sidx-idxonly-equi-join_01.2.update.aql
--
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-join/btree-primary-to-secondary-indexonly-plan-equi-join_01/btree-pidx-to-sidx-idxonly-equi-join_01.2.update.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-join/btree-primary-to-secondary-indexonly-plan-equi-join_01/btree-pidx-to-sidx-idxonly-equi-join_01.2.update.aql
new file mode 100644
index 000..3bee139
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-join/btree-primary-to-secondary-indexonly-plan-equi-join_01/btree-pidx-to-sidx-idxonly-equi-join_01.2.update.aql
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/*
+ * Description: Equi joins two datasets, Customers and Orders, based on 
the customer id.
+ *  Given the 'indexnl' hint we expect the join to be 
transformed
+ *  into an indexed nested-loop join using Orders' secondary 
index.
+ * Success: Yes
+ */
+
+use dataverse test;
+
+load dataset Customers
+using localfs
+(("path"="asterix_nc1://data/nontagged/customerData.json"),("format"="adm"));
+
+load dataset Orders
+

[03/12] asterixdb git commit: [NO ISSUE][COMP][RT] Rename index-only test case files

2018-03-10 Thread wangsaeu
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/06cec01b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-leftouterjoin/probe-sidx-btree-non-indexonly-plan-with-join-btree-pidx1/probe-sidx-btree-non-indexonly-plan-with-join-btree-pidx1.2.update.sqlpp
--
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-leftouterjoin/probe-sidx-btree-non-indexonly-plan-with-join-btree-pidx1/probe-sidx-btree-non-indexonly-plan-with-join-btree-pidx1.2.update.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-leftouterjoin/probe-sidx-btree-non-indexonly-plan-with-join-btree-pidx1/probe-sidx-btree-non-indexonly-plan-with-join-btree-pidx1.2.update.sqlpp
deleted file mode 100644
index cb2a156..000
--- 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-leftouterjoin/probe-sidx-btree-non-indexonly-plan-with-join-btree-pidx1/probe-sidx-btree-non-indexonly-plan-with-join-btree-pidx1.2.update.sqlpp
+++ /dev/null
@@ -1,24 +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 TweetMessages
-using localfs
-(("path"="asterix_nc1://data/twitter/tw_for_indexleftouterjoin.adm"),("format"="adm"));

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/06cec01b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-leftouterjoin/probe-sidx-btree-non-indexonly-plan-with-join-btree-pidx1/probe-sidx-btree-non-indexonly-plan-with-join-btree-pidx1.3.query.sqlpp
--
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-leftouterjoin/probe-sidx-btree-non-indexonly-plan-with-join-btree-pidx1/probe-sidx-btree-non-indexonly-plan-with-join-btree-pidx1.3.query.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-leftouterjoin/probe-sidx-btree-non-indexonly-plan-with-join-btree-pidx1/probe-sidx-btree-non-indexonly-plan-with-join-btree-pidx1.3.query.sqlpp
deleted file mode 100644
index 312b329..000
--- 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-leftouterjoin/probe-sidx-btree-non-indexonly-plan-with-join-btree-pidx1/probe-sidx-btree-non-indexonly-plan-with-join-btree-pidx1.3.query.sqlpp
+++ /dev/null
@@ -1,30 +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 element {'tweetid1':t1.tweetid,'count1':t1.countA,'t2info':(
-select element {'tweetid2':t2.tweetid,'count2':t2.countB}
-from  TweetMessages as t2
-where t1.countA /*+ indexnl */ = t2.tweetid
-)}
-from  TweetMessages as t1
-where t1.countA > 0 and t1.countB < 1) a;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/06cec01b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-leftouterjoin/probe-sidx-btree-non-indexonly-plan-with-join-btree-sidx1-indexonly-plan/probe-sidx-btree-non-idxonly-join-btree-sidx1-idxonly.1.ddl.sqlpp
--
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-leftouterjoin/probe-sidx-btree-non-indexonly-plan-with-join-btree-sidx1-indexonly-plan/probe-sidx-btree-non-idxonly-join-btree-sidx1-idxonly.1.ddl.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runt

[01/12] asterixdb git commit: [NO ISSUE][COMP][RT] Rename index-only test case files

2018-03-10 Thread wangsaeu
Repository: asterixdb
Updated Branches:
  refs/heads/master af9ee51b7 -> 06cec01bb


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/06cec01b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-02/rtree-secondary-index-non-indexonly-plan-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-secondary-index-non-indexonly-plan-02.2.update.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-02/rtree-secondary-index-non-indexonly-plan-02.2.update.sqlpp
deleted file mode 100644
index bc705b2..000
--- 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-02/rtree-secondary-index-non-indexonly-plan-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/06cec01b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-02/rtree-secondary-index-non-indexonly-plan-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-secondary-index-non-indexonly-plan-02.3.query.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-02/rtree-secondary-index-non-indexonly-plan-02.3.query.sqlpp
deleted file mode 100644
index 35c4850..000
--- 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-secondary-index-non-indexonly-plan-02/rtree-secondary-index-non-indexonly-plan-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/06cec01b/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
new file mode 100644
index 000..f8a0b48
--- /dev/null
+++ 
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
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ *

[06/12] asterixdb git commit: [NO ISSUE][COMP][RT] Rename index-only test case files

2018-03-10 Thread wangsaeu
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/06cec01b/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-secondary-composite-index-indexonly-plan-03/btree-secondary-composite-index-indexonly-plan-03.2.update.aql
--
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-secondary-composite-index-indexonly-plan-03/btree-secondary-composite-index-indexonly-plan-03.2.update.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-secondary-composite-index-indexonly-plan-03/btree-secondary-composite-index-indexonly-plan-03.2.update.aql
deleted file mode 100644
index 4f5e20d..000
--- 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-secondary-composite-index-indexonly-plan-03/btree-secondary-composite-index-indexonly-plan-03.2.update.aql
+++ /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 dataverse 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/06cec01b/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-secondary-composite-index-indexonly-plan-03/btree-secondary-composite-index-indexonly-plan-03.3.query.aql
--
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-secondary-composite-index-indexonly-plan-03/btree-secondary-composite-index-indexonly-plan-03.3.query.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-secondary-composite-index-indexonly-plan-03/btree-secondary-composite-index-indexonly-plan-03.3.query.aql
deleted file mode 100644
index 256baa8..000
--- 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-secondary-composite-index-indexonly-plan-03/btree-secondary-composite-index-indexonly-plan-03.3.query.aql
+++ /dev/null
@@ -1,24 +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 dataverse test;
-
-for $o in dataset('MyData')
-where $o.docid < 3 and $o.val1 >= 3
-return {"pk":$o.id, "sk":$o.docid, "sk2":$o.val1}

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/06cec01b/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-secondary-composite-index-indexonly-plan-03/btree-sidx-composite-idxonly-03.1.ddl.aql
--
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-secondary-composite-index-indexonly-plan-03/btree-sidx-composite-idxonly-03.1.ddl.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-secondary-composite-index-indexonly-plan-03/btree-sidx-composite-idxonly-03.1.ddl.aql
new file mode 100644
index 000..7b436d2
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-secondary-composite-index-indexonly-plan-03/btree-sidx-composite-idxonly-03.1.ddl.aql
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional informa

[09/12] asterixdb git commit: [NO ISSUE][COMP][RT] Rename index-only test case files

2018-03-10 Thread wangsaeu
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/06cec01b/asterixdb/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-index-indexonly-plan-09.plan
--
diff --git 
a/asterixdb/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-index-indexonly-plan-09.plan
 
b/asterixdb/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-index-indexonly-plan-09.plan
deleted file mode 100644
index cd96f94..000
--- 
a/asterixdb/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-secondary-index-indexonly-plan-09.plan
+++ /dev/null
@@ -1,53 +0,0 @@
--- DISTRIBUTE_RESULT  |PARTITIONED|
-  -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
--- STREAM_PROJECT  |PARTITIONED|
-  -- ASSIGN  |PARTITIONED|
--- STREAM_PROJECT  |PARTITIONED|
-  -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
--- SORT_GROUP_BY[$$17]  |PARTITIONED|
-{
-  -- AGGREGATE  |LOCAL|
--- NESTED_TUPLE_SOURCE  |LOCAL|
-}
-  -- HASH_PARTITION_EXCHANGE [$$17]  |PARTITIONED|
--- PRE_CLUSTERED_GROUP_BY[$$32]  |PARTITIONED|
-{
-  -- AGGREGATE  |LOCAL|
--- STREAM_SELECT  |LOCAL|
-  -- NESTED_TUPLE_SOURCE  |LOCAL|
-}
-  -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
--- STABLE_SORT [$$32(ASC)]  |PARTITIONED|
-  -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
--- UNION_ALL  |PARTITIONED|
-  -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
--- STREAM_PROJECT  |PARTITIONED|
-  -- STREAM_SELECT  |PARTITIONED|
--- STREAM_PROJECT  |PARTITIONED|
-  -- ASSIGN  |PARTITIONED|
--- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-  -- BTREE_SEARCH  |PARTITIONED|
--- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-  -- STREAM_PROJECT  |PARTITIONED|
--- ONE_TO_ONE_EXCHANGE  
|PARTITIONED|
-  -- SPLIT  |PARTITIONED|
--- ONE_TO_ONE_EXCHANGE  
|PARTITIONED|
-  -- STREAM_PROJECT  
|PARTITIONED|
--- ONE_TO_ONE_EXCHANGE  
|PARTITIONED|
-  -- BTREE_SEARCH  
|PARTITIONED|
--- BROADCAST_EXCHANGE  
|PARTITIONED|
-  -- ASSIGN  
|UNPARTITIONED|
--- UNNEST  
|UNPARTITIONED|
-  -- 
EMPTY_TUPLE_SOURCE  |UNPARTITIONED|
-  -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
--- STREAM_PROJECT  |PARTITIONED|
-  -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
--- SPLIT  |PARTITIONED|
-  -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
--- STREAM_PROJECT  |PARTITIONED|
-  -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
--- BTREE_SEARCH  |PARTITIONED|
-  -- BROADCAST_EXCHANGE  |PARTITIONED|
--- ASSIGN  |UNPARTITIONED|
-  -- UNNEST  |UNPARTITIONED|
--- EMPTY_TUPLE_SOURCE  
|UNPARTITIONED|

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/06cec01b/asterixdb/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-sidx-composite-idxonly-01.plan
--
diff --git 
a/asterixdb/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-sidx-composite-idxonly-01.plan
 
b/asterixdb/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-sidx-composite-idxonly-01.plan
new file mode 100644
index 000..1b65e5f
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/optimizerts/results/btree-index/btree-sidx-composite-idxonly-01.plan
@@ -0,0 +1,31 @@
+-- DISTRIBUTE_RESULT  |PARTITIONED|
+  -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+-- UNION_ALL  |PARTITIONED|
+  -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+-- STREAM_PROJECT  |PARTITIONED|
+  -- ASSIGN  |PARTITIONED|
+ 

[05/12] asterixdb git commit: [NO ISSUE][COMP][RT] Rename index-only test case files

2018-03-10 Thread wangsaeu
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/06cec01b/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.1.ddl.aql
--
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.1.ddl.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.1.ddl.aql
new file mode 100644
index 000..462122a
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.1.ddl.aql
@@ -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 dataverse 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/06cec01b/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.10.query.aql
--
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.10.query.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.10.query.aql
new file mode 100644
index 000..98d86bd
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.10.query.aql
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apach

[02/12] asterixdb git commit: [NO ISSUE][COMP][RT] Rename index-only test case files

2018-03-10 Thread wangsaeu
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/06cec01b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-secondary-index-indexonly-plan-01/btree-sidx-idxonly-01.3.query.sqlpp
--
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-secondary-index-indexonly-plan-01/btree-sidx-idxonly-01.3.query.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-secondary-index-indexonly-plan-01/btree-sidx-idxonly-01.3.query.sqlpp
new file mode 100644
index 000..a4311fe
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-secondary-index-indexonly-plan-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/06cec01b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-secondary-index-indexonly-plan-01/btree-sidx-idxonly-01.4.query.sqlpp
--
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-secondary-index-indexonly-plan-01/btree-sidx-idxonly-01.4.query.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-secondary-index-indexonly-plan-01/btree-sidx-idxonly-01.4.query.sqlpp
new file mode 100644
index 000..37c1d49
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-secondary-index-indexonly-plan-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/06cec01b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-secondary-index-indexonly-plan-01/btree-sidx-idxonly-01.5.query.sqlpp
--
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-secondary-index-indexonly-plan-01/btree-sidx-idxonly-01.5.query.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-secondary-index-indexonly-plan-01/btree-sidx-idxonly-01.5.query.sqlpp
new file mode 100644
index 000..46aca8b
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/btree-secondary-index-indexonly-plan-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,
+ * so

asterixdb git commit: [NO ISSUE][TXN] Fix txnid leak (off by one)

2018-03-10 Thread mblow
Repository: asterixdb
Updated Branches:
  refs/heads/master 06cec01bb -> bd4107ffc


[NO ISSUE][TXN] Fix txnid leak (off by one)

- user model changes: no
- storage format changes: no
- interface changes: no

Details:
- Fix leak of one id at start of each allocated block
- Increase block size from 100 -> 512

Change-Id: Ia97d8472f30ef0f68c51830b4cbb4660184d7393
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2465
Sonar-Qube: Jenkins 
Tested-by: Jenkins 
Contrib: Jenkins 
Integration-Tests: Jenkins 
Reviewed-by: Till Westmann 


Project: http://git-wip-us.apache.org/repos/asf/asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/asterixdb/commit/bd4107ff
Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/bd4107ff
Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/bd4107ff

Branch: refs/heads/master
Commit: bd4107ffcdf6b59dd3d98f66caf4c88b028f38f9
Parents: 06cec01
Author: Michael Blow 
Authored: Fri Mar 9 10:59:44 2018 -0800
Committer: Michael Blow 
Committed: Sat Mar 10 12:09:55 2018 -0800

--
 .../main/java/org/apache/asterix/metadata/CachingTxnIdFactory.java | 2 +-
 .../java/org/apache/asterix/runtime/message/TxnIdBlockRequest.java | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/bd4107ff/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/CachingTxnIdFactory.java
--
diff --git 
a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/CachingTxnIdFactory.java
 
b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/CachingTxnIdFactory.java
index d44bb13..6b3b6a0 100644
--- 
a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/CachingTxnIdFactory.java
+++ 
b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/CachingTxnIdFactory.java
@@ -89,7 +89,7 @@ class CachingTxnIdFactory implements ITxnIdFactory {
 }
 
 private long nextId() throws BlockExhaustedException {
-long nextId = id.incrementAndGet();
+long nextId = id.getAndIncrement();
 if (nextId >= endExclusive && (endExclusive >= start || nextId < 
start)) {
 throw BLOCK_EXHAUSTED_EXCEPTION;
 }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/bd4107ff/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/message/TxnIdBlockRequest.java
--
diff --git 
a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/message/TxnIdBlockRequest.java
 
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/message/TxnIdBlockRequest.java
index b8578ec..4e1c3b1 100644
--- 
a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/message/TxnIdBlockRequest.java
+++ 
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/message/TxnIdBlockRequest.java
@@ -33,7 +33,7 @@ import org.apache.logging.log4j.Logger;
 
 public class TxnIdBlockRequest implements ICcAddressedMessage {
 private static final Logger LOGGER = LogManager.getLogger();
-private static final int BLOCK_SIZE = 100;
+private static final int BLOCK_SIZE = 512;
 private static final long serialVersionUID = 1L;
 
 private static BlockingQueue blockQueue = new 
LinkedBlockingQueue<>();



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

2018-03-10 Thread mblow
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.3.query.aql
--
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.3.query.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.3.query.aql
deleted file mode 100644
index 9f7e04a..000
--- 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.3.query.aql
+++ /dev/null
@@ -1,24 +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 dataverse test;
-
-count (for $x in dataset Fragile_raw where
-spatial-intersect($x.location, create-polygon([0.0,0.0, 2.0,2.0, 0.0,2.0, 
2.0,0.0]))
-return $x);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.4.query.aql
--
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.4.query.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.4.query.aql
deleted file mode 100644
index c293790..000
--- 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.4.query.aql
+++ /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 dataverse test;
-
-let $area:=create-rectangle(point("0.0,0.0"), point("4.0,4.0"))
-for $o in dataset('MyData')
-where spatial-intersect($o.point, $area)
-order by $o.id
-return {"id":$o.id}

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.5.query.aql
--
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.5.query.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.5.query.aql
deleted file mode 100644
index 6a20f70..000
--- 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-indexonly-plan-01/rtree-sidx-idxonly-01.5.query.aql
+++ /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:

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

2018-03-10 Thread mblow
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-leftouterjoin/probe-sidx-btree-non-idxonly-join-btree-pidx1/probe-sidx-btree-non-idxonly-join-btree-pidx1.2.update.sqlpp
--
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-leftouterjoin/probe-sidx-btree-non-idxonly-join-btree-pidx1/probe-sidx-btree-non-idxonly-join-btree-pidx1.2.update.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-leftouterjoin/probe-sidx-btree-non-idxonly-join-btree-pidx1/probe-sidx-btree-non-idxonly-join-btree-pidx1.2.update.sqlpp
new file mode 100644
index 000..cb2a156
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-leftouterjoin/probe-sidx-btree-non-idxonly-join-btree-pidx1/probe-sidx-btree-non-idxonly-join-btree-pidx1.2.update.sqlpp
@@ -0,0 +1,24 @@
+/*
+ * 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 TweetMessages
+using localfs
+(("path"="asterix_nc1://data/twitter/tw_for_indexleftouterjoin.adm"),("format"="adm"));

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-leftouterjoin/probe-sidx-btree-non-idxonly-join-btree-pidx1/probe-sidx-btree-non-idxonly-join-btree-pidx1.3.query.sqlpp
--
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-leftouterjoin/probe-sidx-btree-non-idxonly-join-btree-pidx1/probe-sidx-btree-non-idxonly-join-btree-pidx1.3.query.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-leftouterjoin/probe-sidx-btree-non-idxonly-join-btree-pidx1/probe-sidx-btree-non-idxonly-join-btree-pidx1.3.query.sqlpp
new file mode 100644
index 000..312b329
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-leftouterjoin/probe-sidx-btree-non-idxonly-join-btree-pidx1/probe-sidx-btree-non-idxonly-join-btree-pidx1.3.query.sqlpp
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+use test;
+
+
+select value count(*) from (
+select element {'tweetid1':t1.tweetid,'count1':t1.countA,'t2info':(
+select element {'tweetid2':t2.tweetid,'count2':t2.countB}
+from  TweetMessages as t2
+where t1.countA /*+ indexnl */ = t2.tweetid
+)}
+from  TweetMessages as t1
+where t1.countA > 0 and t1.countB < 1) a;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-leftouterjoin/probe-sidx-btree-non-idxonly-join-btree-sidx1-idxonly/probe-sidx-btree-non-idxonly-join-btree-sidx1-idxonly.1.ddl.sqlpp
--
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-leftouterjoin/probe-sidx-btree-non-idxonly-join-btree-sidx1-idxonly/probe-sidx-btree-non-idxonly-join-btree-sidx1-idxonly.1.ddl.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-leftouterjoin/probe-sidx-btree-non-idxonly-join-btree-sidx1-idxonly/probe-sidx-btree-non-idxonly-join-btree-sidx1-idxonly.1.ddl.sqlpp
new file mode 100644
index 000..3d8f3e3
--- /dev/null
+++ 
b/asterixdb/ast

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

2018-03-10 Thread mblow
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-secondary-composite-index-indexonly-plan-02/btree-sidx-composite-idxonly-03.3.query.aql
--
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-secondary-composite-index-indexonly-plan-02/btree-sidx-composite-idxonly-03.3.query.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-secondary-composite-index-indexonly-plan-02/btree-sidx-composite-idxonly-03.3.query.aql
deleted file mode 100644
index 6993c15..000
--- 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-secondary-composite-index-indexonly-plan-02/btree-sidx-composite-idxonly-03.3.query.aql
+++ /dev/null
@@ -1,24 +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 dataverse test;
-
-for $o in dataset('MyData')
-where $o.docid < 3
-order by $o.id
-return {"pk":$o.id, "sk":$o.docid}

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-secondary-composite-index-indexonly-plan-03/btree-sidx-composite-idxonly-03.1.ddl.aql
--
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-secondary-composite-index-indexonly-plan-03/btree-sidx-composite-idxonly-03.1.ddl.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-secondary-composite-index-indexonly-plan-03/btree-sidx-composite-idxonly-03.1.ddl.aql
deleted file mode 100644
index 7b436d2..000
--- 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-secondary-composite-index-indexonly-plan-03/btree-sidx-composite-idxonly-03.1.ddl.aql
+++ /dev/null
@@ -1,62 +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 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 dataverse 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 btree_index_docid_val1 on MyData(docid,val1) type btree;
-create index rtree_index_point on MyData(p

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

2018-03-10 Thread mblow
[NO ISSUE][COMP][RT] Rename index-only test case directory

- user model changes: no
- storage format changes: no
- interface changes: no

Details:
- Rename index-only test case directories to a shorter version
  not to cause issues on Windows environment.

Change-Id: I360bd650391586a0101cb2eb639c330534753112
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2472
Sonar-Qube: Jenkins 
Tested-by: Jenkins 
Contrib: Jenkins 
Integration-Tests: Jenkins 
Reviewed-by: Ian Maxon 


Project: http://git-wip-us.apache.org/repos/asf/asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/asterixdb/commit/211cbe1b
Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/211cbe1b
Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/211cbe1b

Branch: refs/heads/master
Commit: 211cbe1b74baf593c85a3c206e2a62f5e05743b6
Parents: bd4107f
Author: Taewoo Kim 
Authored: Sat Mar 10 09:59:18 2018 -0800
Committer: Michael Blow 
Committed: Sat Mar 10 13:50:26 2018 -0800

--
 ...-pidx-to-sidx-idxonly-equi-join_01.1.ddl.aql |  64 +++
 ...dx-to-sidx-idxonly-equi-join_01.2.update.aql |  36 +++
 ...idx-to-sidx-idxonly-equi-join_01.3.query.aql |  34 ++
 ...-pidx-to-sidx-idxonly-equi-join_01.1.ddl.aql |  64 ---
 ...dx-to-sidx-idxonly-equi-join_01.2.update.aql |  36 ---
 ...idx-to-sidx-idxonly-equi-join_01.3.query.aql |  34 --
 ...-sidx-idxonly-to-pidx-equi-join_01.1.ddl.aql |  63 ---
 ...dx-idxonly-to-pidx-equi-join_01.2.update.aql |  29 -
 ...idx-idxonly-to-pidx-equi-join_01.3.query.aql |  27 -
 ...xonly-to-sidx-idxonly-equi-join_01.1.ddl.aql |  65 ---
 ...ly-to-sidx-idxonly-equi-join_01.2.update.aql |  29 -
 ...nly-to-sidx-idxonly-equi-join_01.3.query.aql |  27 -
 ...x-non-idxonly-to-pidx-equi-join_01.1.ddl.aql |  66 
 ...on-idxonly-to-pidx-equi-join_01.2.update.aql |  29 -
 ...non-idxonly-to-pidx-equi-join_01.3.query.aql |  27 -
 ...xonly-to-sidx-idxonly-equi-join_01.1.ddl.aql |  67 
 ...ly-to-sidx-idxonly-equi-join_01.2.update.aql |  29 -
 ...nly-to-sidx-idxonly-equi-join_01.3.query.aql |  27 -
 ...-sidx-idxonly-to-pidx-equi-join_01.1.ddl.aql |  63 +++
 ...dx-idxonly-to-pidx-equi-join_01.2.update.aql |  29 +
 ...idx-idxonly-to-pidx-equi-join_01.3.query.aql |  27 +
 ...xonly-to-sidx-idxonly-equi-join_01.1.ddl.aql |  65 +++
 ...ly-to-sidx-idxonly-equi-join_01.2.update.aql |  29 +
 ...nly-to-sidx-idxonly-equi-join_01.3.query.aql |  27 +
 ...x-non-idxonly-to-pidx-equi-join_01.1.ddl.aql |  66 
 ...on-idxonly-to-pidx-equi-join_01.2.update.aql |  29 +
 ...non-idxonly-to-pidx-equi-join_01.3.query.aql |  27 +
 ...xonly-to-sidx-idxonly-equi-join_01.1.ddl.aql |  67 
 ...ly-to-sidx-idxonly-equi-join_01.2.update.aql |  29 +
 ...nly-to-sidx-idxonly-equi-join_01.3.query.aql |  27 +
 ...robe-pidx-join-btree-sidx3-idxonly.1.ddl.aql |  56 ++
 ...e-pidx-join-btree-sidx3-idxonly.2.update.aql |  24 +
 ...be-pidx-join-btree-sidx3-idxonly.3.query.aql |  32 ++
 ...robe-pidx-join-btree-sidx3-idxonly.1.ddl.aql |  56 --
 ...e-pidx-join-btree-sidx3-idxonly.2.update.aql |  24 -
 ...be-pidx-join-btree-sidx3-idxonly.3.query.aql |  32 --
 ...idx-btree-idxonly-join-btree-pidx1.1.ddl.aql |  57 ++
 ...-btree-idxonly-join-btree-pidx1.2.update.aql |  24 +
 ...x-btree-idxonly-join-btree-pidx1.3.query.aql |  32 ++
 ...e-idxonly-join-btree-sidx1-idxonly.1.ddl.aql |  60 +++
 ...dxonly-join-btree-sidx1-idxonly.2.update.aql |  24 +
 ...idxonly-join-btree-sidx1-idxonly.3.query.aql |  32 ++
 ...idx-btree-idxonly-join-btree-pidx1.1.ddl.aql |  57 --
 ...-btree-idxonly-join-btree-pidx1.2.update.aql |  24 -
 ...x-btree-idxonly-join-btree-pidx1.3.query.aql |  32 --
 ...e-idxonly-join-btree-sidx1-idxonly.1.ddl.aql |  60 ---
 ...dxonly-join-btree-sidx1-idxonly.2.update.aql |  24 -
 ...idxonly-join-btree-sidx1-idxonly.3.query.aql |  32 --
 ...btree-non-idxonly-join-btree-pidx1.1.ddl.aql |  57 ++
 ...ee-non-idxonly-join-btree-pidx1.2.update.aql |  24 +
 ...ree-non-idxonly-join-btree-pidx1.3.query.aql |  32 ++
 ...n-idxonly-join-btree-sidx1-idxonly.1.ddl.aql |  59 ++
 ...dxonly-join-btree-sidx1-idxonly.2.update.aql |  24 +
 ...idxonly-join-btree-sidx1-idxonly.3.query.aql |  32 ++
 ...btree-non-idxonly-join-btree-pidx1.1.ddl.aql |  57 --
 ...ee-non-idxonly-join-btree-pidx1.2.update.aql |  24 -
 ...ree-non-idxonly-join-btree-pidx1.3.query.aql |  32 --
 ...n-idxonly-join-btree-sidx1-idxonly.1.ddl.aql |  59 --
 ...dxonly-join-btree-sidx1-idxonly.2.update.aql |  24 -
 ...idxonly-join-btree-sidx1-idxonly.3.query.aql |  32 --
 .../btree-sidx-composite-idxonly-01.1.ddl.aql   |  62 ---
 ...btree-sidx-composite-idxonly-01.2.update.aql |  25 -
 .../btree-sidx-composite-idxonly-0

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

2018-03-10 Thread mblow
Repository: asterixdb
Updated Branches:
  refs/heads/master bd4107ffc -> 211cbe1b7


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.9.query.sqlpp
--
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-sidx-idxonly-01/rtree-sidx-idxonly-01.9.query.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-sidx-idxonly-01/rtree-sidx-idxonly-01.9.query.sqlpp
new file mode 100644
index 000..da070e6
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-sidx-idxonly-01/rtree-sidx-idxonly-01.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 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-sidx-non-idxonly-01/rtree-sidx-non-idxonly-01.1.ddl.sqlpp
--
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-sidx-non-idxonly-01/rtree-sidx-non-idxonly-01.1.ddl.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-sidx-non-idxonly-01/rtree-sidx-non-idxonly-01.1.ddl.sqlpp
new file mode 100644
index 000..f5230ab
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-selection/rtree-sidx-non-idxonly-01/rtree-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 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-sidx-non-idxonly-01/rtree-sidx-non-idxonly-01.2.update.sqlpp
-

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

2018-03-10 Thread mblow
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 000..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 000..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:/

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

2018-03-10 Thread mblow
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-join/btree-sidx-non-idxonly-to-sidx-idxonly-equi-join_01/btree-sidx-non-idxonly-to-sidx-idxonly-equi-join_01.2.update.aql
--
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-join/btree-sidx-non-idxonly-to-sidx-idxonly-equi-join_01/btree-sidx-non-idxonly-to-sidx-idxonly-equi-join_01.2.update.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-join/btree-sidx-non-idxonly-to-sidx-idxonly-equi-join_01/btree-sidx-non-idxonly-to-sidx-idxonly-equi-join_01.2.update.aql
new file mode 100644
index 000..461f5c2
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-join/btree-sidx-non-idxonly-to-sidx-idxonly-equi-join_01/btree-sidx-non-idxonly-to-sidx-idxonly-equi-join_01.2.update.aql
@@ -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 dataverse test;
+
+load dataset Customers
+using localfs
+(("path"="asterix_nc1://data/nontagged/customerData2.json"),("format"="adm"));
+
+load dataset Orders
+using localfs
+(("path"="asterix_nc1://data/nontagged/orderData.json"),("format"="adm"));
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-join/btree-sidx-non-idxonly-to-sidx-idxonly-equi-join_01/btree-sidx-non-idxonly-to-sidx-idxonly-equi-join_01.3.query.aql
--
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-join/btree-sidx-non-idxonly-to-sidx-idxonly-equi-join_01/btree-sidx-non-idxonly-to-sidx-idxonly-equi-join_01.3.query.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-join/btree-sidx-non-idxonly-to-sidx-idxonly-equi-join_01/btree-sidx-non-idxonly-to-sidx-idxonly-equi-join_01.3.query.aql
new file mode 100644
index 000..510f439
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-join/btree-sidx-non-idxonly-to-sidx-idxonly-equi-join_01/btree-sidx-non-idxonly-to-sidx-idxonly-equi-join_01.3.query.aql
@@ -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 dataverse test;
+
+count(
+for $o in dataset('Orders')
+for $c in dataset('Customers')
+where $o.cid < 10 and $o.total >= 0 and $o.cid /*+ indexnl */ = $c.cashBack
+return {"oid": $o.oid, "cid":$c.cid}
+);

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-leftouterjoin/probe-pidx-join-btree-sidx3-idxonly/probe-pidx-join-btree-sidx3-idxonly.1.ddl.aql
--
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-leftouterjoin/probe-pidx-join-btree-sidx3-idxonly/probe-pidx-join-btree-sidx3-idxonly.1.ddl.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-leftouterjoin/probe-pidx-join-btree-sidx3-idxonly/probe-pidx-join-btree-sidx3-idxonly.1.ddl.aql
new file mode 100644
index 000..a8a8ce6
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/index-leftouterjoin/probe-pidx-join-btree-sidx3-idxonly/probe-pidx-join-btree-sidx3-idxonly.1.ddl.aql
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache

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

2018-03-10 Thread mblow
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-join/btree-secondary-non-indexonly-plan-to-primary-equi-join_01/btree-sidx-non-idxonly-to-pidx-equi-join_01.1.ddl.sqlpp
--
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-join/btree-secondary-non-indexonly-plan-to-primary-equi-join_01/btree-sidx-non-idxonly-to-pidx-equi-join_01.1.ddl.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-join/btree-secondary-non-indexonly-plan-to-primary-equi-join_01/btree-sidx-non-idxonly-to-pidx-equi-join_01.1.ddl.sqlpp
deleted file mode 100644
index fdc6a6c..000
--- 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-join/btree-secondary-non-indexonly-plan-to-primary-equi-join_01/btree-sidx-non-idxonly-to-pidx-equi-join_01.1.ddl.sqlpp
+++ /dev/null
@@ -1,66 +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: Equi joins two datasets, Customers and Orders, based on 
the customer id.
- *  Given the 'indexnl' hint we expect the join to be 
transformed
- *  into an indexed nested-loop join using Customers' primary 
index.
- *  This is not an index-only plan since a single secondary 
index can't
- *  cover the whole search predicate for the outer relation 
even when we exclude the join condition.
- * Success: Yes
- */
-
-drop dataverse test if exists;
-create dataverse test;
-
-use test;
-
-create type AddressType as open {
-  number: int64,
-  street: string,
-  city: string
-};
-
-create type CustomerType as closed {
-  cid: int64,
-  name: string,
-  cashBack: int64,
-  age: int64?,
-  address: AddressType?,
-  lastorder: {
-oid: int64,
-total: float
-  }
-};
-
-create type OrderType as open {
-  oid: int64,
-  cid: int64,
-  orderstatus: string,
-  orderpriority: string,
-  clerk: string,
-  total: float,
-  items: [int64]
-};
-
-create dataset Customers(CustomerType) primary key cid;
-create dataset Orders(OrderType) primary key oid;
-
-create index CustomerID_idx on Orders(cid);
-

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/211cbe1b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-join/btree-secondary-non-indexonly-plan-to-primary-equi-join_01/btree-sidx-non-idxonly-to-pidx-equi-join_01.2.update.sqlpp
--
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-join/btree-secondary-non-indexonly-plan-to-primary-equi-join_01/btree-sidx-non-idxonly-to-pidx-equi-join_01.2.update.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-join/btree-secondary-non-indexonly-plan-to-primary-equi-join_01/btree-sidx-non-idxonly-to-pidx-equi-join_01.2.update.sqlpp
deleted file mode 100644
index 89bc827..000
--- 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/index-join/btree-secondary-non-indexonly-plan-to-primary-equi-join_01/btree-sidx-non-idxonly-to-pidx-equi-join_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 Customers
-using localfs
-(("path"="asterix_nc1://data/nontagged/customerData.json"),("format"="adm"

asterixdb git commit: [ASTERIXDB-2213] Guard against concurrent config updates

2018-03-10 Thread mblow
Repository: asterixdb
Updated Branches:
  refs/heads/master 211cbe1b7 -> 0c722db39


[ASTERIXDB-2213] Guard against concurrent config updates

Change-Id: If7dffb1b502b9331118ad344e6f4ef0d625f4c8f
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2467
Reviewed-by: Murtadha Hubail 
Tested-by: Michael Blow 


Project: http://git-wip-us.apache.org/repos/asf/asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/asterixdb/commit/0c722db3
Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/0c722db3
Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/0c722db3

Branch: refs/heads/master
Commit: 0c722db393c166d77dc8d87a11efc6fa6fb2508d
Parents: 211cbe1
Author: Michael Blow 
Authored: Sat Mar 10 13:52:29 2018 -0800
Committer: Michael Blow 
Committed: Sat Mar 10 14:35:15 2018 -0800

--
 .../org/apache/hyracks/api/util/InvokeUtil.java |  18 +--
 .../hyracks-control-common/pom.xml  |   5 +
 .../control/common/config/ConfigManager.java|  80 -
 .../common/config/ConfigManagerTest.java| 111 +++
 .../apache/hyracks/control/nc/io/IoRequest.java |   2 +-
 .../hyracks/util/IOInterruptibleAction.java |  26 +
 .../hyracks/util/InterruptibleAction.java   |  24 
 .../main/java/org/apache/hyracks/util/Span.java |  61 ++
 .../org/apache/hyracks/util/ThrowingAction.java |  24 
 9 files changed, 307 insertions(+), 44 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/0c722db3/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/util/InvokeUtil.java
--
diff --git 
a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/util/InvokeUtil.java
 
b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/util/InvokeUtil.java
index ba4f82d..c60e673 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/util/InvokeUtil.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/util/InvokeUtil.java
@@ -24,6 +24,9 @@ import java.util.concurrent.Callable;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.hyracks.api.exceptions.HyracksDataException;
+import org.apache.hyracks.util.IOInterruptibleAction;
+import org.apache.hyracks.util.InterruptibleAction;
+import org.apache.hyracks.util.ThrowingAction;
 import org.apache.logging.log4j.Level;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
@@ -231,19 +234,4 @@ public class InvokeUtil {
 }
 }
 }
-
-@FunctionalInterface
-public interface InterruptibleAction {
-void run() throws InterruptedException;
-}
-
-@FunctionalInterface
-public interface ThrowingAction {
-void run() throws Exception; // NOSONAR
-}
-
-@FunctionalInterface
-public interface IOInterruptibleAction {
-void run() throws IOException, InterruptedException;
-}
 }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/0c722db3/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/pom.xml
--
diff --git 
a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/pom.xml 
b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/pom.xml
index e13e23b..2f9903a 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/pom.xml
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/pom.xml
@@ -83,5 +83,10 @@
   org.apache.commons
   commons-lang3
 
+
+  junit
+  junit
+  test
+
   
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/0c722db3/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/config/ConfigManager.java
--
diff --git 
a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/config/ConfigManager.java
 
b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/config/ConfigManager.java
index 9564922..8dd95e1 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/config/ConfigManager.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/config/ConfigManager.java
@@ -31,6 +31,7 @@ import java.util.EnumMap;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
+import java.util.ListIterator;
 import java.util.Map;
 import java.util.Set;
 import java.util.SortedMap;
@@ -69,27 +70,32 @@ public cl

asterixdb git commit: [ASTERIXDB-2316][STO] Fix Merging Components For Full Merge

2018-03-10 Thread mhubail
Repository: asterixdb
Updated Branches:
  refs/heads/master 0c722db39 -> 0af313c33


[ASTERIXDB-2316][STO] Fix Merging Components For Full Merge

- user model changes: no
- storage format changes: no
- interface changes: no

Details:
- Pass correct merging components in case of
  full merge.
- Add full merge test case.

Change-Id: I17890a1f85f569e0d3dc5eba046f61c91571c9c1
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2471
Sonar-Qube: Jenkins 
Tested-by: Jenkins 
Contrib: Jenkins 
Integration-Tests: Jenkins 
Reviewed-by: Luo Chen 


Project: http://git-wip-us.apache.org/repos/asf/asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/asterixdb/commit/0af313c3
Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/0af313c3
Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/0af313c3

Branch: refs/heads/master
Commit: 0af313c33d52d5b734515525c43b97d65fa1f834
Parents: 0c722db
Author: Murtadha Hubail 
Authored: Sat Mar 10 15:01:52 2018 +0300
Committer: Murtadha Hubail 
Committed: Sat Mar 10 14:43:01 2018 -0800

--
 .../test/storage/LsmIndexLifecycleTest.java | 73 
 .../am/lsm/common/impls/AbstractLSMIndex.java   |  2 +-
 2 files changed, 74 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/0af313c3/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/storage/LsmIndexLifecycleTest.java
--
diff --git 
a/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/storage/LsmIndexLifecycleTest.java
 
b/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/storage/LsmIndexLifecycleTest.java
new file mode 100644
index 000..15f1730
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/storage/LsmIndexLifecycleTest.java
@@ -0,0 +1,73 @@
+/*
+ * 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.
+ */
+package org.apache.asterix.test.storage;
+
+import org.apache.asterix.api.common.AsterixHyracksIntegrationUtil;
+import org.apache.asterix.common.TestDataUtil;
+import org.apache.asterix.common.api.IDatasetLifecycleManager;
+import org.apache.asterix.common.api.INcApplicationContext;
+import org.apache.asterix.common.config.GlobalConfig;
+import org.apache.asterix.common.context.DatasetInfo;
+import org.apache.asterix.metadata.api.IMetadataIndex;
+import org.apache.asterix.metadata.bootstrap.MetadataPrimaryIndexes;
+import org.apache.asterix.test.common.TestExecutor;
+import org.apache.asterix.testframework.context.TestCaseContext;
+import org.apache.hyracks.storage.am.lsm.common.impls.AbstractLSMIndex;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+public class LsmIndexLifecycleTest {
+
+protected static final String TEST_CONFIG_FILE_NAME = 
"src/main/resources/cc.conf";
+private static final TestExecutor testExecutor = new TestExecutor();
+private static final AsterixHyracksIntegrationUtil integrationUtil = new 
AsterixHyracksIntegrationUtil();
+
+@Before
+public void setUp() throws Exception {
+System.setProperty(GlobalConfig.CONFIG_FILE_PROPERTY, 
TEST_CONFIG_FILE_NAME);
+integrationUtil.init(true, TEST_CONFIG_FILE_NAME);
+}
+
+@After
+public void tearDown() throws Exception {
+integrationUtil.deinit(true);
+}
+
+@Test
+public void fullMergeTest() throws Exception {
+String datasetName = "ds";
+TestDataUtil.createIdOnlyDataset(datasetName);
+INcApplicationContext appCtx = (INcApplicationContext) 
(integrationUtil.ncs[0].getApplicationContext());
+IDatasetLifecycleManager dlcm = appCtx.getDatasetLifecycleManager();
+IMetadataIndex dsIdx = MetadataPrimaryIndexes.DATASET_DATASET;
+DatasetInfo datasetInfo = 
dlcm.getDatasetInfo(dsIdx.getDatasetId().getId());
+// flush to ensure multiple disk components
+dlcm.flushAllDatasets();
+datasetInfo.waitForIO();
+AbstractLSMIndex index = (AbstractLSMIndex) 
dlcm.getIndex(dsIdx.getDatasetId().getId(), dsIdx.g

asterixdb git commit: [NO ISSUE] Change the working directory of UDF

2018-03-10 Thread mblow
Repository: asterixdb
Updated Branches:
  refs/heads/master 0af313c33 -> c49e25e28


[NO ISSUE] Change the working directory of UDF

- user model changes: no
- storage format changes: no
- interface changes: no

Details:
Currently, there are two places for hosting UDFs. One is
"user.home/library", and the other is "app.home/lib/udfs". The former
one was used by Managix and is no longer supported. It also causes
problem for OSX users since it's collided with the system folder. From
now on, all udfs are placed under "app.home/lib/udfs". In the case where
"app.home" is not defined, "user.home/lib/udfs" will be used.

Change-Id: I409039d0ca054069853653b312b9f6187365a73b
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2448
Sonar-Qube: Jenkins 
Tested-by: Jenkins 
Integration-Tests: Jenkins 
Contrib: Jenkins 
Reviewed-by: Till Westmann 


Project: http://git-wip-us.apache.org/repos/asf/asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/asterixdb/commit/c49e25e2
Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/c49e25e2
Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/c49e25e2

Branch: refs/heads/master
Commit: c49e25e285c34311b50221c4d3f07bf677a1296f
Parents: 0af313c
Author: Xikui Wang 
Authored: Tue Mar 6 22:37:11 2018 -0800
Committer: Michael Blow 
Committed: Sat Mar 10 14:47:49 2018 -0800

--
 .../app/external/ExternalLibraryUtils.java  | 22 ++--
 1 file changed, 6 insertions(+), 16 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c49e25e2/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/external/ExternalLibraryUtils.java
--
diff --git 
a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/external/ExternalLibraryUtils.java
 
b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/external/ExternalLibraryUtils.java
index c125a40..0af1b9d 100755
--- 
a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/external/ExternalLibraryUtils.java
+++ 
b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/external/ExternalLibraryUtils.java
@@ -400,29 +400,19 @@ public class ExternalLibraryUtils {
 }
 
 /**
- * @return the directory "$(ControllerConfig.defaultDir)/library": This 
needs to be improved
+ * @return the directory "System.getProperty("app.home", 
System.getProperty("user.home")/lib/udfs"
  */
 protected static File getLibraryInstallDir() {
-// Check managix directory first. If not exists, check app home.
-File installDir = new File(System.getProperty("user.dir"), "library");
-if (!installDir.exists()) {
-installDir = new File(System.getProperty("app.home", 
System.getProperty("user.home")) + File.separator
-+ "lib" + File.separator + "udfs");
-}
-return installDir;
+return new File(System.getProperty("app.home", 
System.getProperty("user.home")) + File.separator + "lib"
++ File.separator + "udfs");
 }
 
 /**
- * @return the directory "$(ControllerConfig.defaultDir)/uninstall": This 
needs to be improved
+ * @return the directory "System.getProperty("app.home", 
System.getProperty("user.home")/lib/udfs/uninstall"
  */
 protected static File getLibraryUninstallDir() {
-// Check managix directory first. If not exists, check app home.
-File uninstallDir = new File(System.getProperty("user.dir"), 
"uninstall");
-if (!uninstallDir.exists()) {
-uninstallDir = new File(System.getProperty("app.home", 
System.getProperty("user.home")) + File.separator
-+ "lib" + File.separator + "udfs" + File.separator + 
"uninstall");
-}
-return uninstallDir;
+return new File(System.getProperty("app.home", 
System.getProperty("user.home")) + File.separator + "lib"
++ File.separator + "udfs" + File.separator + "uninstall");
 }
 
 public static String getExternalFunctionFullName(String libraryName, 
String functionName) {



[3/3] asterixdb git commit: [NO ISSUE][EXT] Java UDF framework refactoring

2018-03-10 Thread tillw
[NO ISSUE][EXT] Java UDF framework refactoring

- user model changes: no
- storage format changes: no
- interface changes: no

Details:
1. Separated the JObjects and its subtypes.
2. Add JBuiltinTypes so we don't have to create an object to get JType.
3. Dead code removal.
4. Memory usage optimization in JRecord Serialization.
5. Several fixes about incomplete type implementations in Java UDF and
getting JObjects in UDF examples.

Change-Id: I3b648191b73fe4aad4f2a6ba1c2066c872fa16a9
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2405
Tested-by: Jenkins 
Contrib: Jenkins 
Integration-Tests: Jenkins 
Reviewed-by: Till Westmann 


Project: http://git-wip-us.apache.org/repos/asf/asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/asterixdb/commit/bb49e5e3
Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/bb49e5e3
Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/bb49e5e3

Branch: refs/heads/master
Commit: bb49e5e391cf9dc3e9d3a081bf238277fe748a17
Parents: c49e25e
Author: Xikui Wang 
Authored: Fri Mar 9 10:25:48 2018 -0800
Committer: Till Westmann 
Committed: Sat Mar 10 16:21:00 2018 -0800

--
 .../apache/asterix/external/api/IJObject.java   |   10 +-
 .../asterix/external/api/IJRecordAccessor.java  |4 +-
 .../org/apache/asterix/external/api/IJType.java |7 +-
 .../external/library/ExternalFunction.java  |   10 -
 .../external/library/JTypeObjectFactory.java|   53 +-
 .../external/library/JavaFunctionHelper.java|9 +-
 .../external/library/ResultCollector.java   |  135 --
 .../external/library/java/JBuiltinType.java |  165 +++
 .../external/library/java/JObjectAccessors.java |   75 +-
 .../library/java/JObjectPointableVisitor.java   |1 -
 .../external/library/java/JObjectUtil.java  |  427 ---
 .../asterix/external/library/java/JObjects.java | 1202 --
 .../asterix/external/library/java/JTypeTag.java |1 -
 .../ByteArrayAccessibleDataInputStream.java |   33 +
 .../base/ByteArrayAccessibleInputStream.java|   48 +
 .../external/library/java/base/JBoolean.java|   68 +
 .../external/library/java/base/JByte.java   |   60 +
 .../external/library/java/base/JCircle.java |   65 +
 .../external/library/java/base/JDate.java   |   59 +
 .../external/library/java/base/JDateTime.java   |   59 +
 .../external/library/java/base/JDouble.java |   60 +
 .../external/library/java/base/JDuration.java   |   60 +
 .../external/library/java/base/JFloat.java  |   60 +
 .../external/library/java/base/JInt.java|   60 +
 .../external/library/java/base/JInterval.java   |   67 +
 .../external/library/java/base/JLine.java   |   69 +
 .../external/library/java/base/JList.java   |   62 +
 .../external/library/java/base/JLong.java   |   60 +
 .../external/library/java/base/JMissing.java|   53 +
 .../external/library/java/base/JNull.java   |   59 +
 .../external/library/java/base/JObject.java |   56 +
 .../library/java/base/JOrderedList.java |   85 ++
 .../external/library/java/base/JPoint.java  |   74 ++
 .../external/library/java/base/JPoint3D.java|   67 +
 .../external/library/java/base/JPolygon.java|   73 ++
 .../external/library/java/base/JRecord.java |  198 +++
 .../external/library/java/base/JRectangle.java  |   64 +
 .../external/library/java/base/JShort.java  |   60 +
 .../external/library/java/base/JString.java |   60 +
 .../external/library/java/base/JTime.java   |   59 +
 .../library/java/base/JUnorderedList.java   |   90 ++
 .../external/library/AddHashTagsFunction.java   |   15 +-
 .../library/AddHashTagsInPlaceFunction.java |   11 +-
 .../external/library/AllTypesFunction.java  |   37 +-
 .../external/library/CapitalFinderFunction.java |7 +-
 .../external/library/EchoDelayFunction.java |2 +-
 .../library/KeywordsDetectorFunction.java   |   12 +-
 .../external/library/ParseTweetFunction.java|   12 +-
 .../asterix/external/library/SumFunction.java   |2 +-
 .../external/library/UpperCaseFunction.java |6 +-
 .../serde/ARecordSerializerDeserializer.java|4 +-
 51 files changed, 2185 insertions(+), 1910 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/bb49e5e3/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/api/IJObject.java
--
diff --git 
a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/api/IJObject.java
 
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/api/IJObject.java
index 250e4fa..9ea400e 100644
--- 
a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/api/IJObject.java
+++ 
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/api/IJObject.java
@@ 

[1/3] asterixdb git commit: [NO ISSUE][EXT] Java UDF framework refactoring

2018-03-10 Thread tillw
Repository: asterixdb
Updated Branches:
  refs/heads/master c49e25e28 -> bb49e5e39


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/bb49e5e3/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/library/java/base/JObject.java
--
diff --git 
a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/library/java/base/JObject.java
 
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/library/java/base/JObject.java
new file mode 100644
index 000..7338b31
--- /dev/null
+++ 
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/library/java/base/JObject.java
@@ -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.
+ */
+package org.apache.asterix.external.library.java.base;
+
+import org.apache.asterix.external.api.IJObject;
+import org.apache.asterix.om.base.IAObject;
+import org.apache.asterix.om.types.ATypeTag;
+import org.apache.hyracks.api.exceptions.HyracksDataException;
+
+import java.io.DataOutput;
+import java.io.IOException;
+
+public abstract class JObject implements IJObject {
+
+protected IAObject value;
+protected byte[] bytes;
+
+protected JObject() {
+}
+
+protected JObject(IAObject value) {
+this.value = value;
+}
+
+@Override
+public IAObject getIAObject() {
+return value;
+}
+
+public void serializeTypeTag(boolean writeTypeTag, DataOutput dataOutput, 
ATypeTag typeTag)
+throws HyracksDataException {
+if (writeTypeTag) {
+try {
+dataOutput.writeByte(typeTag.serialize());
+} catch (IOException e) {
+throw new HyracksDataException(e);
+}
+}
+}
+}

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/bb49e5e3/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/library/java/base/JOrderedList.java
--
diff --git 
a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/library/java/base/JOrderedList.java
 
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/library/java/base/JOrderedList.java
new file mode 100644
index 000..017fc53
--- /dev/null
+++ 
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/library/java/base/JOrderedList.java
@@ -0,0 +1,85 @@
+/*
+ * 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.
+ */
+package org.apache.asterix.external.library.java.base;
+
+import org.apache.asterix.builders.IAsterixListBuilder;
+import org.apache.asterix.builders.OrderedListBuilder;
+import org.apache.asterix.external.api.IJObject;
+import org.apache.asterix.external.api.IJType;
+import org.apache.asterix.om.base.AMutableOrderedList;
+import org.apache.asterix.om.base.IAObject;
+import org.apache.asterix.om.types.AOrderedListType;
+import org.apache.asterix.om.types.IAType;
+import org.apache.hyracks.api.exceptions.HyracksDataException;
+import org.apache.hyracks.data.std.util.ArrayBackedValueStorage;
+
+import java.io.DataOutput;
+import java.util.List;
+
+public final class JOrderedList extends JList {
+
+private AOrderedListType listType;
+
+public JOrderedList(IJType listItemType) {
+super();
+this.listType = new AOrderedListType(listItemType.getIAType(), null);
+}
+
+public JOrd

[2/3] asterixdb git commit: [NO ISSUE][EXT] Java UDF framework refactoring

2018-03-10 Thread tillw
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/bb49e5e3/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/library/java/JObjects.java
--
diff --git 
a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/library/java/JObjects.java
 
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/library/java/JObjects.java
deleted file mode 100644
index 819d523..000
--- 
a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/library/java/JObjects.java
+++ /dev/null
@@ -1,1202 +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.
- */
-package org.apache.asterix.external.library.java;
-
-import java.io.ByteArrayInputStream;
-import java.io.DataInputStream;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.apache.asterix.builders.IAsterixListBuilder;
-import org.apache.asterix.builders.RecordBuilder;
-import org.apache.asterix.builders.UnorderedListBuilder;
-import org.apache.asterix.common.exceptions.ErrorCode;
-import org.apache.asterix.common.exceptions.RuntimeDataException;
-import 
org.apache.asterix.dataflow.data.nontagged.serde.ABooleanSerializerDeserializer;
-import 
org.apache.asterix.dataflow.data.nontagged.serde.ACircleSerializerDeserializer;
-import 
org.apache.asterix.dataflow.data.nontagged.serde.ADateSerializerDeserializer;
-import 
org.apache.asterix.dataflow.data.nontagged.serde.ADateTimeSerializerDeserializer;
-import 
org.apache.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
-import 
org.apache.asterix.dataflow.data.nontagged.serde.ADurationSerializerDeserializer;
-import 
org.apache.asterix.dataflow.data.nontagged.serde.AFloatSerializerDeserializer;
-import 
org.apache.asterix.dataflow.data.nontagged.serde.AInt16SerializerDeserializer;
-import 
org.apache.asterix.dataflow.data.nontagged.serde.AInt32SerializerDeserializer;
-import 
org.apache.asterix.dataflow.data.nontagged.serde.AInt64SerializerDeserializer;
-import 
org.apache.asterix.dataflow.data.nontagged.serde.AInt8SerializerDeserializer;
-import 
org.apache.asterix.dataflow.data.nontagged.serde.AIntervalSerializerDeserializer;
-import 
org.apache.asterix.dataflow.data.nontagged.serde.ALineSerializerDeserializer;
-import 
org.apache.asterix.dataflow.data.nontagged.serde.APoint3DSerializerDeserializer;
-import 
org.apache.asterix.dataflow.data.nontagged.serde.APointSerializerDeserializer;
-import 
org.apache.asterix.dataflow.data.nontagged.serde.APolygonSerializerDeserializer;
-import 
org.apache.asterix.dataflow.data.nontagged.serde.ARectangleSerializerDeserializer;
-import 
org.apache.asterix.dataflow.data.nontagged.serde.AStringSerializerDeserializer;
-import 
org.apache.asterix.dataflow.data.nontagged.serde.ATimeSerializerDeserializer;
-import org.apache.asterix.external.api.IJObject;
-import org.apache.asterix.om.base.ABoolean;
-import org.apache.asterix.om.base.ADouble;
-import org.apache.asterix.om.base.AFloat;
-import org.apache.asterix.om.base.AInt32;
-import org.apache.asterix.om.base.AInt64;
-import org.apache.asterix.om.base.AInt8;
-import org.apache.asterix.om.base.AMissing;
-import org.apache.asterix.om.base.AMutableCircle;
-import org.apache.asterix.om.base.AMutableDate;
-import org.apache.asterix.om.base.AMutableDateTime;
-import org.apache.asterix.om.base.AMutableDouble;
-import org.apache.asterix.om.base.AMutableDuration;
-import org.apache.asterix.om.base.AMutableFloat;
-import org.apache.asterix.om.base.AMutableInt16;
-import org.apache.asterix.om.base.AMutableInt32;
-import org.apache.asterix.om.base.AMutableInt64;
-import org.apache.asterix.om.base.AMutableInt8;
-import org.apache.asterix.om.base.AMutableInterval;
-import org.apache.asterix.om.base.AMutableLine;
-import org.apache.asterix.om.base.AMutableOrderedList;
-import org.apache.asterix.om.base.AMutablePoint;
-import org.apache.asterix.om.base.AMutablePoint3D;
-import org.apache.asterix.om.base.AMutablePolygon