Multiple fixes for columnar datasets
- user model changes: no
- storage format changes: no
- interface changes: no
Details:
This patch fixes multiple issues for columnar datasets, namely:
- ASTERIXDB-3149: upsert failure due to projecting
unassembled records.
- ASTERIXDB-3150: rebalance failure also due to projecting
unassembled records.
- ASTERIXDB-3151: ColumnManagerFactory fails to instatiate
when composite PKs are declared.
Change-Id: I48195086802efe931b1ebb79f59a072807118cbc
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/17441
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Wail Alkowaileet <wael.y.k@gmail.com>
Reviewed-by: Murtadha Hubail <mhubail@apache.org>
diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/utils/RebalanceUtil.java b/asterixdb/asterix-app/src/main/java/org/apache/asterix/utils/RebalanceUtil.java
index ba6c602..da72d2c 100644
--- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/utils/RebalanceUtil.java
+++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/utils/RebalanceUtil.java
@@ -47,8 +47,10 @@
import org.apache.asterix.metadata.entities.Index;
import org.apache.asterix.metadata.utils.DatasetUtil;
import org.apache.asterix.metadata.utils.IndexUtil;
+import org.apache.asterix.om.types.ARecordType;
import org.apache.asterix.rebalance.IDatasetRebalanceCallback;
import org.apache.asterix.runtime.job.listener.JobEventListenerFactory;
+import org.apache.asterix.runtime.projection.DataProjectionFiltrationInfo;
import org.apache.hyracks.algebricks.common.constraints.AlgebricksPartitionConstraint;
import org.apache.hyracks.algebricks.common.constraints.AlgebricksPartitionConstraintHelper;
import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
@@ -63,6 +65,7 @@
import org.apache.hyracks.dataflow.common.data.partition.FieldHashPartitionComputerFactory;
import org.apache.hyracks.dataflow.std.connectors.MToNPartitioningConnectorDescriptor;
import org.apache.hyracks.dataflow.std.connectors.OneToOneConnectorDescriptor;
+import org.apache.hyracks.storage.common.projection.ITupleProjectorFactory;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -80,16 +83,11 @@
/**
* Rebalances an existing dataset to a list of target nodes.
*
- * @param dataverseName,
- * the dataverse name.
- * @param datasetName,
- * the dataset name.
- * @param targetNcNames,
- * the list of target nodes.
- * @param metadataProvider,
- * the metadata provider.
- * @param hcc,
- * the reusable hyracks connection.
+ * @param dataverseName, the dataverse name.
+ * @param datasetName, the dataset name.
+ * @param targetNcNames, the list of target nodes.
+ * @param metadataProvider, the metadata provider.
+ * @param hcc, the reusable hyracks connection.
* @throws Exception
*/
public static void rebalance(DataverseName dataverseName, String datasetName, Set<String> targetNcNames,
@@ -301,8 +299,12 @@
// The pipeline starter.
IOperatorDescriptor starter = DatasetUtil.createDummyKeyProviderOp(spec, source, metadataProvider);
+ // Tuple projector
+ // TODO is there a way to avoid assembling the records for columnar datasets?
+ ITupleProjectorFactory projectorFactory = createTupleProjectorFactory(source, metadataProvider);
// Creates primary index scan op.
- IOperatorDescriptor primaryScanOp = DatasetUtil.createPrimaryIndexScanOp(spec, metadataProvider, source);
+ IOperatorDescriptor primaryScanOp =
+ DatasetUtil.createPrimaryIndexScanOp(spec, metadataProvider, source, projectorFactory);
// Creates secondary BTree upsert op.
IOperatorDescriptor upsertOp = createPrimaryIndexUpsertOp(spec, metadataProvider, source, target);
@@ -327,6 +329,20 @@
JobUtils.runJob(hcc, spec, true);
}
+ private static ITupleProjectorFactory createTupleProjectorFactory(Dataset source, MetadataProvider metadataProvider)
+ throws AlgebricksException {
+ ARecordType itemType =
+ (ARecordType) metadataProvider.findType(source.getItemTypeDataverseName(), source.getItemTypeName());
+ ARecordType metaType = DatasetUtil.getMetaType(metadataProvider, source);
+ int numberOfPrimaryKeys = source.getPrimaryKeys().size();
+
+ // This could be expensive if record structure is "complex"
+ ARecordType requestedType = DataProjectionFiltrationInfo.ALL_FIELDS_TYPE;
+
+ return IndexUtil.createPrimaryIndexScanTupleProjectorFactory(source.getDatasetFormatInfo(), requestedType,
+ itemType, metaType, numberOfPrimaryKeys);
+ }
+
// Creates the primary index upsert operator for populating the target dataset.
private static IOperatorDescriptor createPrimaryIndexUpsertOp(JobSpecification spec,
MetadataProvider metadataProvider, Dataset source, Dataset target) throws AlgebricksException {
diff --git a/asterixdb/asterix-app/src/test/java/org/apache/asterix/app/bootstrap/TestNodeController.java b/asterixdb/asterix-app/src/test/java/org/apache/asterix/app/bootstrap/TestNodeController.java
index 34696b1..f6caf5d 100644
--- a/asterixdb/asterix-app/src/test/java/org/apache/asterix/app/bootstrap/TestNodeController.java
+++ b/asterixdb/asterix-app/src/test/java/org/apache/asterix/app/bootstrap/TestNodeController.java
@@ -104,6 +104,7 @@
import org.apache.hyracks.storage.am.common.dataflow.IIndexDataflowHelperFactory;
import org.apache.hyracks.storage.am.common.dataflow.IndexDataflowHelperFactory;
import org.apache.hyracks.storage.am.common.impls.NoOpOperationCallbackFactory;
+import org.apache.hyracks.storage.am.common.impls.NoOpTupleProjectorFactory;
import org.apache.hyracks.storage.am.common.ophelpers.IndexOperation;
import org.apache.hyracks.storage.am.lsm.common.api.IFrameOperationCallbackFactory;
import org.apache.hyracks.storage.am.lsm.common.api.ILSMMergePolicyFactory;
@@ -718,7 +719,7 @@
Integer indicator = primaryKeyIndicators.get(i);
String[] fieldNames =
indicator == Index.RECORD_INDICATOR ? recordType.getFieldNames() : metaType.getFieldNames();
- keyFieldNames.add(Arrays.asList(fieldNames[primaryKeyIndexes[i]]));
+ keyFieldNames.add(Collections.singletonList(fieldNames[primaryKeyIndexes[i]]));
}
index = Index.createPrimaryIndex(dataset.getDataverseName(), dataset.getDatasetName(), keyFieldNames,
primaryKeyIndicators, keyFieldTypes, MetadataUtil.PENDING_NO_OP);
@@ -809,10 +810,10 @@
new LSMPrimaryUpsertOperatorNodePushable(ctx, ctx.getTaskAttemptId().getTaskId().getPartition(),
indexHelperFactory, primaryIndexInfo.primaryIndexInsertFieldsPermutations,
recordDescProvider.getInputRecordDescriptor(new ActivityId(new OperatorDescriptorId(0), 0), 0),
- modificationCallbackFactory, searchCallbackFactory, keyIndexes.length,
- 0, recordType, -1, frameOpCallbackFactory == null
- ? dataset.getFrameOpCallbackFactory(mdProvider) : frameOpCallbackFactory,
- MissingWriterFactory.INSTANCE, hasSecondaries);
+ modificationCallbackFactory, searchCallbackFactory, keyIndexes.length, 0, recordType, -1,
+ frameOpCallbackFactory == null ? dataset.getFrameOpCallbackFactory(mdProvider)
+ : frameOpCallbackFactory,
+ MissingWriterFactory.INSTANCE, hasSecondaries, NoOpTupleProjectorFactory.INSTANCE);
RecordDescriptor upsertOutRecDesc = getUpsertOutRecDesc(primaryIndexInfo.rDesc, dataset,
filterFields == null ? 0 : filterFields.length, recordType, metaType);
// fix pk fields
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/rebalance/rebalance.01.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/rebalance/rebalance.01.ddl.sqlpp
new file mode 100644
index 0000000..490f48f
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/rebalance/rebalance.01.ddl.sqlpp
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+DROP DATAVERSE tpch1 IF EXISTS;
+CREATE DATAVERSE tpch1;
+
+DROP DATAVERSE tpch2 IF EXISTS;
+CREATE DATAVERSE tpch2;
+
+
+CREATE TYPE tpch1.LineItemType AS
+ CLOSED {
+ l_orderkey : bigint,
+ l_partkey : bigint,
+ l_suppkey : bigint,
+ l_linenumber : bigint,
+ l_quantity : double,
+ l_extendedprice : double,
+ l_discount : double,
+ l_tax : double,
+ l_returnflag : string,
+ l_linestatus : string,
+ l_shipdate : string,
+ l_commitdate : string,
+ l_receiptdate : string,
+ l_shipinstruct : string,
+ l_shipmode : string,
+ l_comment : string
+};
+
+CREATE TYPE tpch2.OrderType AS
+ CLOSED {
+ o_orderkey : bigint,
+ o_custkey : bigint,
+ o_orderstatus : string,
+ o_totalprice : double,
+ o_orderdate : string,
+ o_orderpriority : string,
+ o_clerk : string,
+ o_shippriority : bigint,
+ o_comment : string
+};
+
+CREATE DATASET tpch1.LineItem(LineItemType)
+PRIMARY KEY l_orderkey,l_linenumber WITH {
+ "storage-format" : {"format" : "column"}
+};
+
+CREATE DATASET tpch2.Orders(OrderType)
+PRIMARY key o_orderkey WITH {
+ "storage-format" : {"format" : "column"}
+};
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/rebalance/rebalance.02.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/rebalance/rebalance.02.update.sqlpp
new file mode 100644
index 0000000..e3f9c31
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/rebalance/rebalance.02.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.
+ */
+
+LOAD DATASET tpch1.LineItem USING localfs ((`path`=`asterix_nc1://data/tpch0.001/lineitem.tbl`),
+ (`format`=`delimited-text`), (`delimiter`=`|`));
+
+LOAD DATASET tpch2.Orders USING localfs ((`path`=`asterix_nc1://data/tpch0.001/orders.tbl`),
+ (`format`=`delimited-text`), (`delimiter`=`|`));
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/rebalance/rebalance.03.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/rebalance/rebalance.03.query.sqlpp
new file mode 100644
index 0000000..a30c374
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/rebalance/rebalance.03.query.sqlpp
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
+WITH tmp AS
+(
+ SELECT DISTINCT l_orderkey
+ FROM tpch1.LineItem
+ WHERE l_commitdate < l_receiptdate
+)
+
+SELECT o.o_orderpriority AS order_priority, count(*) AS count
+FROM tpch2.Orders o
+JOIN tmp t
+ON t.l_orderkey = o.o_orderkey
+WHERE o.o_orderdate >= '1993-07-01' AND o.o_orderdate < '1993-10-01'
+GROUP BY o.o_orderpriority
+ORDER BY o.o_orderpriority
+;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/rebalance/rebalance.04.post.http b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/rebalance/rebalance.04.post.http
new file mode 100644
index 0000000..81c5e88
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/rebalance/rebalance.04.post.http
@@ -0,0 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+# param targetNode=asterix_nc1
+
+/admin/rebalance
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/rebalance/rebalance.05.get.http b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/rebalance/rebalance.05.get.http
new file mode 100644
index 0000000..e5fe873
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/rebalance/rebalance.05.get.http
@@ -0,0 +1,20 @@
+/*
+ * 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.
+ */
+
+/connector?dataverseName=tpch1&datasetName=LineItem
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/rebalance/rebalance.06.get.http b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/rebalance/rebalance.06.get.http
new file mode 100644
index 0000000..6e444ef
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/rebalance/rebalance.06.get.http
@@ -0,0 +1,20 @@
+/*
+ * 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.
+ */
+
+/connector?dataverseName=tpch2&datasetName=Orders
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/rebalance/rebalance.07.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/rebalance/rebalance.07.query.sqlpp
new file mode 100644
index 0000000..a30c374
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/rebalance/rebalance.07.query.sqlpp
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
+WITH tmp AS
+(
+ SELECT DISTINCT l_orderkey
+ FROM tpch1.LineItem
+ WHERE l_commitdate < l_receiptdate
+)
+
+SELECT o.o_orderpriority AS order_priority, count(*) AS count
+FROM tpch2.Orders o
+JOIN tmp t
+ON t.l_orderkey = o.o_orderkey
+WHERE o.o_orderdate >= '1993-07-01' AND o.o_orderdate < '1993-10-01'
+GROUP BY o.o_orderpriority
+ORDER BY o.o_orderpriority
+;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/rebalance/rebalance.08.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/rebalance/rebalance.08.query.sqlpp
new file mode 100644
index 0000000..257c273
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/rebalance/rebalance.08.query.sqlpp
@@ -0,0 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+SELECT DatasetName, GroupName, rebalanceCount
+FROM Metadata.`Dataset`
+WHERE DatasetName = "LineItem";
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/rebalance/rebalance.09.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/rebalance/rebalance.09.query.sqlpp
new file mode 100644
index 0000000..af2085e
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/rebalance/rebalance.09.query.sqlpp
@@ -0,0 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+SELECT DatasetName, GroupName, rebalanceCount
+FROM Metadata.`Dataset`
+WHERE DatasetName = "Orders";
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/rebalance/rebalance.10.post.http b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/rebalance/rebalance.10.post.http
new file mode 100644
index 0000000..1606124
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/rebalance/rebalance.10.post.http
@@ -0,0 +1,23 @@
+/*
+ * 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.
+ */
+
+# param targetNode=asterix_nc1
+# param targetNode=asterix_nc2
+
+/admin/rebalance
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/rebalance/rebalance.11.get.http b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/rebalance/rebalance.11.get.http
new file mode 100644
index 0000000..e5fe873
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/rebalance/rebalance.11.get.http
@@ -0,0 +1,20 @@
+/*
+ * 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.
+ */
+
+/connector?dataverseName=tpch1&datasetName=LineItem
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/rebalance/rebalance.12.get.http b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/rebalance/rebalance.12.get.http
new file mode 100644
index 0000000..6e444ef
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/rebalance/rebalance.12.get.http
@@ -0,0 +1,20 @@
+/*
+ * 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.
+ */
+
+/connector?dataverseName=tpch2&datasetName=Orders
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/rebalance/rebalance.13.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/rebalance/rebalance.13.query.sqlpp
new file mode 100644
index 0000000..a30c374
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/rebalance/rebalance.13.query.sqlpp
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
+WITH tmp AS
+(
+ SELECT DISTINCT l_orderkey
+ FROM tpch1.LineItem
+ WHERE l_commitdate < l_receiptdate
+)
+
+SELECT o.o_orderpriority AS order_priority, count(*) AS count
+FROM tpch2.Orders o
+JOIN tmp t
+ON t.l_orderkey = o.o_orderkey
+WHERE o.o_orderdate >= '1993-07-01' AND o.o_orderdate < '1993-10-01'
+GROUP BY o.o_orderpriority
+ORDER BY o.o_orderpriority
+;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/rebalance/rebalance.14.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/rebalance/rebalance.14.query.sqlpp
new file mode 100644
index 0000000..257c273
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/rebalance/rebalance.14.query.sqlpp
@@ -0,0 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+SELECT DatasetName, GroupName, rebalanceCount
+FROM Metadata.`Dataset`
+WHERE DatasetName = "LineItem";
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/rebalance/rebalance.15.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/rebalance/rebalance.15.query.sqlpp
new file mode 100644
index 0000000..0505471
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/rebalance/rebalance.15.query.sqlpp
@@ -0,0 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+select DatasetName, GroupName, rebalanceCount
+from Metadata.`Dataset`
+where DatasetName = "Orders";
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/rebalance/rebalance.16.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/rebalance/rebalance.16.query.sqlpp
new file mode 100644
index 0000000..2f3cc43
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/rebalance/rebalance.16.query.sqlpp
@@ -0,0 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+SELECT DatasetName, GroupName, rebalanceCount
+FROM Metadata.`Dataset`
+WHERE DatasetName = "Dataset";
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-1/use-case-1.01.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-1/use-case-1.01.ddl.sqlpp
new file mode 100644
index 0000000..25e8290
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-1/use-case-1.01.ddl.sqlpp
@@ -0,0 +1,39 @@
+/*
+ * 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: Verify the following DML actions for an array->atomic index:
+ * 1) Insert into an empty index (non bulk-load operation), additionally with two records that have no array-index qualifying entries.
+ * 2) Delete all-but-one entry from the index.
+ * 3) Upsert all *original* (all records have qualifying array-index entries now) entries into the index.
+ */
+
+DROP DATAVERSE TestYelp IF EXISTS;
+CREATE DATAVERSE TestYelp;
+USE TestYelp;
+
+CREATE TYPE CheckinType AS {
+ business_id: string
+};
+
+CREATE DATASET YelpCheckin(CheckinType) PRIMARY KEY business_id WITH {
+ "storage-format" : {"format" : "column"}
+};
+
+CREATE INDEX IdxYelpCheckinDates ON YelpCheckin (UNNEST dates : string ) EXCLUDE UNKNOWN KEY;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-1/use-case-1.02.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-1/use-case-1.02.update.sqlpp
new file mode 100644
index 0000000..ba9a31b
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-1/use-case-1.02.update.sqlpp
@@ -0,0 +1,272 @@
+/*
+ * 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 TestYelp;
+
+INSERT INTO YelpCheckin (
+ [
+ {
+ "business_id": "--1UhMGODdWsrMastO9DZw",
+ "dates": [
+ "2016-04-26 19:49:16",
+ "2016-08-30 18:36:57",
+ "2016-10-15 02:45:18",
+ "2016-11-18 01:54:50",
+ "2017-04-20 18:39:06",
+ "2017-05-03 17:58:02",
+ "2019-03-19 22:04:48"
+ ]
+ },
+ {
+ "business_id": "--EF5N7P70J_UYBTPypYlA",
+ "dates": [
+ "2018-05-25 19:52:07",
+ "2018-09-18 16:09:44",
+ "2019-10-18 21:29:09"
+ ]
+ },
+ {
+ "business_id": "--Ni3oJ4VOqfOEu7Sj2Vzg",
+ "dates": [
+ "2019-06-07 17:54:58"
+ ]
+ },
+ {
+ "business_id": "--Y1Adl1YUWfYIRSd8vkmA",
+ "dates": [
+ "2011-05-03 20:54:05",
+ "2011-08-23 20:49:45",
+ "2014-12-04 06:13:01",
+ "2016-11-16 19:25:55"
+ ]
+ },
+ {
+ "business_id": "--YPwqIlRJrhHkJcjY3eiA",
+ "dates": [
+ "2016-06-18 21:35:45",
+ "2016-10-15 18:17:51"
+ ]
+ },
+ {
+ "business_id": "--e8PjCNhEz32pprnPhCwQ",
+ "dates": [
+ "2015-04-02 21:45:17"
+ ]
+ },
+ {
+ "business_id": "--kinfHwmtdjz03g8B8z8Q",
+ "dates": [
+ "2014-08-27 17:49:18",
+ "2015-12-19 21:30:31",
+ "2018-11-27 15:53:50"
+ ]
+ },
+ {
+ "business_id": "--q6datkI-f0EoVheXNEeQ",
+ "dates": [
+ "2014-01-28 20:56:04",
+ "2014-11-16 16:11:58",
+ "2015-11-15 19:21:53",
+ "2015-11-15 19:33:39"
+ ]
+ },
+ {
+ "business_id": "--qvQS4MigHPykD2GV0-zw",
+ "dates": [
+ "2019-04-11 18:30:12"
+ ]
+ },
+ {
+ "business_id": "--wIGbLEhlpl_UeAIyDmZQ",
+ "dates": [
+ "2015-06-06 20:01:06",
+ "2019-03-14 22:01:52"
+ ]
+ },
+ {
+ "business_id": "-0FA-Qdi3SPYIoJz9UQw-A",
+ "dates": [
+ "2018-09-29 18:55:17",
+ "2018-10-20 16:48:05",
+ "2018-10-20 22:20:24"
+ ]
+ },
+ {
+ "business_id": "-0Hj1hb_XW6ybWq2M7QhGA",
+ "dates": [
+ "2011-04-23 21:11:22",
+ "2014-05-04 19:42:48",
+ "2014-05-11 19:16:08",
+ "2014-06-04 19:14:18",
+ "2015-12-05 19:22:42",
+ "2017-05-15 23:19:00"
+ ]
+ },
+ {
+ "business_id": "-0KMvRFwDWdVBeTpT11iHw",
+ "dates": [
+ "2012-07-13 21:43:57",
+ "2016-12-24 02:27:31",
+ "2017-08-31 00:35:26"
+ ]
+ },
+ {
+ "business_id": "-0LPtgJC31FWMrMv317p0Q",
+ "dates": [
+ "2013-04-13 12:35:33",
+ "2013-08-19 23:35:49",
+ "2013-10-04 19:14:56"
+ ]
+ },
+ {
+ "business_id": "-0M3o2uWBnQZwd3hmfEwuw",
+ "dates": [
+ "2016-09-10 19:26:19",
+ "2018-09-08 14:15:37",
+ "2019-09-13 22:47:25"
+ ]
+ },
+ {
+ "business_id": "-0RRiWDtfnS16AKCtfvBZg",
+ "dates": [
+ "2017-05-19 14:30:16",
+ "2017-05-19 14:30:25",
+ "2017-08-28 15:49:37",
+ "2017-09-20 20:19:51",
+ "2017-10-01 16:31:05",
+ "2017-10-01 16:56:27",
+ "2017-12-27 23:33:20"
+ ]
+ },
+ {
+ "business_id": "-0Soj75v-XoRcf2ERr8Bmg",
+ "dates": [
+ "2019-06-05 18:22:49"
+ ]
+ },
+ {
+ "business_id": "-0ZumLlFjMh4ZW1z2nXGug",
+ "dates": [
+ "2011-09-24 21:37:32",
+ "2014-03-10 20:20:07",
+ "2015-05-27 00:40:24",
+ "2015-08-29 17:58:15",
+ "2018-03-16 15:03:26"
+ ]
+ },
+ {
+ "business_id": "-0aOudcaAyac0VJbMX-L1g",
+ "dates": [
+ "2015-03-16 23:51:16",
+ "2015-12-21 04:48:01",
+ "2016-10-28 20:22:42",
+ "2016-10-28 20:23:00"
+ ]
+ },
+ {
+ "business_id": "-0b86isaXMY0v4g-V8GZ9Q",
+ "dates": [
+ "2013-10-22 16:49:21",
+ "2014-11-21 17:39:24"
+ ]
+ },
+ {
+ "business_id": "-0d-BfFSU0bwLcnMaGRxYw",
+ "dates": [
+ "2014-08-07 18:30:48",
+ "2014-09-16 20:41:45",
+ "2014-10-12 23:22:27",
+ "2015-07-21 20:43:56",
+ "2015-07-21 20:45:07"
+ ]
+ },
+ {
+ "business_id": "-0jz6c3C6i7RG7Ag22K-Pg",
+ "dates": [
+ "2015-05-02 19:49:05",
+ "2015-05-06 03:52:18",
+ "2015-09-26 01:13:19"
+ ]
+ },
+ {
+ "business_id": "-0y3MZU2oYP8r1ruDP1bfQ",
+ "dates": [
+ "2015-04-11 13:14:14",
+ "2015-11-21 16:05:56",
+ "2016-05-06 14:10:04",
+ "2017-08-09 15:15:10",
+ "2017-10-21 15:12:56"
+ ]
+ },
+ {
+ "business_id": "-1BPe8UjF2_l3nVk-DFUjA",
+ "dates": [
+ "2015-12-03 18:44:00",
+ "2016-03-17 18:19:21",
+ "2016-11-02 15:58:38"
+ ]
+ },
+ {
+ "business_id": "-1E2CQu_38mkghvmZgCCRw",
+ "dates": []
+ },
+ {
+ "business_id": "-1wzk43IZ5D9Ysu6kzb5xA",
+ "dates": []
+ },
+ {
+ "business_id": "-23R9P2eG7VTc6DVLjFKzA",
+ "dates": [
+ "2011-12-21 19:02:51",
+ "2012-04-15 04:21:39",
+ "2012-04-15 14:23:56",
+ "2013-06-30 22:39:51",
+ "2013-10-04 20:34:13",
+ "2014-07-16 02:28:40"
+ ]
+ },
+ {
+ "business_id": "-26MGfikhJiTfCI-GqmzhQ",
+ "dates": [
+ "2018-06-13 20:16:07"
+ ]
+ },
+ {
+ "business_id": "-2bLuJsMZ0WhI9daurVQNQ",
+ "dates": [
+ "2015-05-29 16:46:17",
+ "2015-06-01 15:03:53"
+ ]
+ },
+ {
+ "business_id": "-2hDBMaza_ldqnZdiU06LQ",
+ "dates": [
+ "2011-10-08 12:02:23",
+ "2014-08-18 02:11:11",
+ "2016-01-07 05:27:51",
+ "2016-10-21 20:15:55",
+ "2016-12-01 03:57:10",
+ "2016-12-29 01:54:42",
+ "2018-07-22 19:55:31",
+ "2018-09-07 01:42:54",
+ "2019-03-08 03:41:06"
+ ]
+ }
+ ]
+);
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-1/use-case-1.03.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-1/use-case-1.03.query.sqlpp
new file mode 100644
index 0000000..69fe7cc
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-1/use-case-1.03.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.
+ */
+SET `compiler.arrayindex` "true";
+
+USE TestYelp;
+
+SELECT COUNT(*)
+FROM YelpCheckin C, C.dates D
+WHERE D > " ";
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-1/use-case-1.04.get.http b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-1/use-case-1.04.get.http
new file mode 100644
index 0000000..a55ce93
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-1/use-case-1.04.get.http
@@ -0,0 +1,19 @@
+/*
+ * 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.
+ */
+/connector?dataverseName=TestYelp&datasetName=YelpCheckin
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-1/use-case-1.05.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-1/use-case-1.05.query.sqlpp
new file mode 100644
index 0000000..69fe7cc
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-1/use-case-1.05.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.
+ */
+SET `compiler.arrayindex` "true";
+
+USE TestYelp;
+
+SELECT COUNT(*)
+FROM YelpCheckin C, C.dates D
+WHERE D > " ";
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-1/use-case-1.06.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-1/use-case-1.06.update.sqlpp
new file mode 100644
index 0000000..ea1dba3
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-1/use-case-1.06.update.sqlpp
@@ -0,0 +1,23 @@
+/*
+ * 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 TestYelp;
+
+DELETE FROM YelpCheckin C
+WHERE C.business_id != "--1UhMGODdWsrMastO9DZw";
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-1/use-case-1.07.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-1/use-case-1.07.query.sqlpp
new file mode 100644
index 0000000..69fe7cc
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-1/use-case-1.07.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.
+ */
+SET `compiler.arrayindex` "true";
+
+USE TestYelp;
+
+SELECT COUNT(*)
+FROM YelpCheckin C, C.dates D
+WHERE D > " ";
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-1/use-case-1.08.get.http b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-1/use-case-1.08.get.http
new file mode 100644
index 0000000..a55ce93
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-1/use-case-1.08.get.http
@@ -0,0 +1,19 @@
+/*
+ * 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.
+ */
+/connector?dataverseName=TestYelp&datasetName=YelpCheckin
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-1/use-case-1.09.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-1/use-case-1.09.query.sqlpp
new file mode 100644
index 0000000..69fe7cc
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-1/use-case-1.09.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.
+ */
+SET `compiler.arrayindex` "true";
+
+USE TestYelp;
+
+SELECT COUNT(*)
+FROM YelpCheckin C, C.dates D
+WHERE D > " ";
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-1/use-case-1.10.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-1/use-case-1.10.update.sqlpp
new file mode 100644
index 0000000..055fe8c
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-1/use-case-1.10.update.sqlpp
@@ -0,0 +1,276 @@
+/*
+ * 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 TestYelp;
+
+UPSERT INTO YelpCheckin (
+ [
+ {
+ "business_id": "--1UhMGODdWsrMastO9DZw",
+ "dates": [
+ "2016-04-26 19:49:16",
+ "2016-08-30 18:36:57",
+ "2016-10-15 02:45:18",
+ "2016-11-18 01:54:50",
+ "2017-04-20 18:39:06",
+ "2017-05-03 17:58:02",
+ "2019-03-19 22:04:48"
+ ]
+ },
+ {
+ "business_id": "--EF5N7P70J_UYBTPypYlA",
+ "dates": [
+ "2018-05-25 19:52:07",
+ "2018-09-18 16:09:44",
+ "2019-10-18 21:29:09"
+ ]
+ },
+ {
+ "business_id": "--Ni3oJ4VOqfOEu7Sj2Vzg",
+ "dates": [
+ "2019-06-07 17:54:58"
+ ]
+ },
+ {
+ "business_id": "--Y1Adl1YUWfYIRSd8vkmA",
+ "dates": [
+ "2011-05-03 20:54:05",
+ "2011-08-23 20:49:45",
+ "2014-12-04 06:13:01",
+ "2016-11-16 19:25:55"
+ ]
+ },
+ {
+ "business_id": "--YPwqIlRJrhHkJcjY3eiA",
+ "dates": [
+ "2016-06-18 21:35:45",
+ "2016-10-15 18:17:51"
+ ]
+ },
+ {
+ "business_id": "--e8PjCNhEz32pprnPhCwQ",
+ "dates": [
+ "2015-04-02 21:45:17"
+ ]
+ },
+ {
+ "business_id": "--kinfHwmtdjz03g8B8z8Q",
+ "dates": [
+ "2014-08-27 17:49:18",
+ "2015-12-19 21:30:31",
+ "2018-11-27 15:53:50"
+ ]
+ },
+ {
+ "business_id": "--q6datkI-f0EoVheXNEeQ",
+ "dates": [
+ "2014-01-28 20:56:04",
+ "2014-11-16 16:11:58",
+ "2015-11-15 19:21:53",
+ "2015-11-15 19:33:39"
+ ]
+ },
+ {
+ "business_id": "--qvQS4MigHPykD2GV0-zw",
+ "dates": [
+ "2019-04-11 18:30:12"
+ ]
+ },
+ {
+ "business_id": "--wIGbLEhlpl_UeAIyDmZQ",
+ "dates": [
+ "2015-06-06 20:01:06",
+ "2019-03-14 22:01:52"
+ ]
+ },
+ {
+ "business_id": "-0FA-Qdi3SPYIoJz9UQw-A",
+ "dates": [
+ "2018-09-29 18:55:17",
+ "2018-10-20 16:48:05",
+ "2018-10-20 22:20:24"
+ ]
+ },
+ {
+ "business_id": "-0Hj1hb_XW6ybWq2M7QhGA",
+ "dates": [
+ "2011-04-23 21:11:22",
+ "2014-05-04 19:42:48",
+ "2014-05-11 19:16:08",
+ "2014-06-04 19:14:18",
+ "2015-12-05 19:22:42",
+ "2017-05-15 23:19:00"
+ ]
+ },
+ {
+ "business_id": "-0KMvRFwDWdVBeTpT11iHw",
+ "dates": [
+ "2012-07-13 21:43:57",
+ "2016-12-24 02:27:31",
+ "2017-08-31 00:35:26"
+ ]
+ },
+ {
+ "business_id": "-0LPtgJC31FWMrMv317p0Q",
+ "dates": [
+ "2013-04-13 12:35:33",
+ "2013-08-19 23:35:49",
+ "2013-10-04 19:14:56"
+ ]
+ },
+ {
+ "business_id": "-0M3o2uWBnQZwd3hmfEwuw",
+ "dates": [
+ "2016-09-10 19:26:19",
+ "2018-09-08 14:15:37",
+ "2019-09-13 22:47:25"
+ ]
+ },
+ {
+ "business_id": "-0RRiWDtfnS16AKCtfvBZg",
+ "dates": [
+ "2017-05-19 14:30:16",
+ "2017-05-19 14:30:25",
+ "2017-08-28 15:49:37",
+ "2017-09-20 20:19:51",
+ "2017-10-01 16:31:05",
+ "2017-10-01 16:56:27",
+ "2017-12-27 23:33:20"
+ ]
+ },
+ {
+ "business_id": "-0Soj75v-XoRcf2ERr8Bmg",
+ "dates": [
+ "2019-06-05 18:22:49"
+ ]
+ },
+ {
+ "business_id": "-0ZumLlFjMh4ZW1z2nXGug",
+ "dates": [
+ "2011-09-24 21:37:32",
+ "2014-03-10 20:20:07",
+ "2015-05-27 00:40:24",
+ "2015-08-29 17:58:15",
+ "2018-03-16 15:03:26"
+ ]
+ },
+ {
+ "business_id": "-0aOudcaAyac0VJbMX-L1g",
+ "dates": [
+ "2015-03-16 23:51:16",
+ "2015-12-21 04:48:01",
+ "2016-10-28 20:22:42",
+ "2016-10-28 20:23:00"
+ ]
+ },
+ {
+ "business_id": "-0b86isaXMY0v4g-V8GZ9Q",
+ "dates": [
+ "2013-10-22 16:49:21",
+ "2014-11-21 17:39:24"
+ ]
+ },
+ {
+ "business_id": "-0d-BfFSU0bwLcnMaGRxYw",
+ "dates": [
+ "2014-08-07 18:30:48",
+ "2014-09-16 20:41:45",
+ "2014-10-12 23:22:27",
+ "2015-07-21 20:43:56",
+ "2015-07-21 20:45:07"
+ ]
+ },
+ {
+ "business_id": "-0jz6c3C6i7RG7Ag22K-Pg",
+ "dates": [
+ "2015-05-02 19:49:05",
+ "2015-05-06 03:52:18",
+ "2015-09-26 01:13:19"
+ ]
+ },
+ {
+ "business_id": "-0y3MZU2oYP8r1ruDP1bfQ",
+ "dates": [
+ "2015-04-11 13:14:14",
+ "2015-11-21 16:05:56",
+ "2016-05-06 14:10:04",
+ "2017-08-09 15:15:10",
+ "2017-10-21 15:12:56"
+ ]
+ },
+ {
+ "business_id": "-1BPe8UjF2_l3nVk-DFUjA",
+ "dates": [
+ "2015-12-03 18:44:00",
+ "2016-03-17 18:19:21",
+ "2016-11-02 15:58:38"
+ ]
+ },
+ {
+ "business_id": "-1E2CQu_38mkghvmZgCCRw",
+ "dates": [
+ "2019-04-04 22:02:37"
+ ]
+ },
+ {
+ "business_id": "-1wzk43IZ5D9Ysu6kzb5xA",
+ "dates": [
+ "2019-02-27 14:03:08"
+ ]
+ },
+ {
+ "business_id": "-23R9P2eG7VTc6DVLjFKzA",
+ "dates": [
+ "2011-12-21 19:02:51",
+ "2012-04-15 04:21:39",
+ "2012-04-15 14:23:56",
+ "2013-06-30 22:39:51",
+ "2013-10-04 20:34:13",
+ "2014-07-16 02:28:40"
+ ]
+ },
+ {
+ "business_id": "-26MGfikhJiTfCI-GqmzhQ",
+ "dates": [
+ "2018-06-13 20:16:07"
+ ]
+ },
+ {
+ "business_id": "-2bLuJsMZ0WhI9daurVQNQ",
+ "dates": [
+ "2015-05-29 16:46:17",
+ "2015-06-01 15:03:53"
+ ]
+ },
+ {
+ "business_id": "-2hDBMaza_ldqnZdiU06LQ",
+ "dates": [
+ "2011-10-08 12:02:23",
+ "2014-08-18 02:11:11",
+ "2016-01-07 05:27:51",
+ "2016-10-21 20:15:55",
+ "2016-12-01 03:57:10",
+ "2016-12-29 01:54:42",
+ "2018-07-22 19:55:31",
+ "2018-09-07 01:42:54",
+ "2019-03-08 03:41:06"
+ ]
+ }
+ ]
+);
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-1/use-case-1.11.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-1/use-case-1.11.query.sqlpp
new file mode 100644
index 0000000..69fe7cc
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-1/use-case-1.11.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.
+ */
+SET `compiler.arrayindex` "true";
+
+USE TestYelp;
+
+SELECT COUNT(*)
+FROM YelpCheckin C, C.dates D
+WHERE D > " ";
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-1/use-case-1.12.get.http b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-1/use-case-1.12.get.http
new file mode 100644
index 0000000..a55ce93
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-1/use-case-1.12.get.http
@@ -0,0 +1,19 @@
+/*
+ * 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.
+ */
+/connector?dataverseName=TestYelp&datasetName=YelpCheckin
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-1/use-case-1.13.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-1/use-case-1.13.query.sqlpp
new file mode 100644
index 0000000..69fe7cc
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-1/use-case-1.13.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.
+ */
+SET `compiler.arrayindex` "true";
+
+USE TestYelp;
+
+SELECT COUNT(*)
+FROM YelpCheckin C, C.dates D
+WHERE D > " ";
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-2/use-case-2.01.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-2/use-case-2.01.ddl.sqlpp
new file mode 100644
index 0000000..46715fb
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-2/use-case-2.01.ddl.sqlpp
@@ -0,0 +1,40 @@
+/*
+ * 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: Verify the following DML actions for an array->atomic index:
+ * 1) Insert into an empty index (non bulk-load operation).
+ * 2) Delete all-but-one entry from the index.
+ * 3) Upsert all entries into the index.
+ */
+
+DROP DATAVERSE TestYelp IF EXISTS;
+CREATE DATAVERSE TestYelp;
+USE TestYelp;
+
+CREATE TYPE CheckinType AS {
+ business_id: string
+};
+
+CREATE DATASET YelpCheckin(CheckinType) PRIMARY KEY business_id WITH {
+ "storage-format" : {"format" : "column"}
+};
+
+CREATE INDEX IdxYelpCheckinDates ON YelpCheckin (UNNEST checkin_times.dates : string ) EXCLUDE UNKNOWN KEY;
+CREATE INDEX IdxYelpCheckinTimes ON YelpCheckin (UNNEST checkin_times.times : string ) EXCLUDE UNKNOWN KEY;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-2/use-case-2.02.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-2/use-case-2.02.update.sqlpp
new file mode 100644
index 0000000..2549e8f
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-2/use-case-2.02.update.sqlpp
@@ -0,0 +1,497 @@
+/*
+ * 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 TestYelp;
+
+INSERT INTO YelpCheckin (
+ [
+ {
+ "business_id": "--1UhMGODdWsrMastO9DZw",
+ "checkin_times": {
+ "dates": [
+ "2016-04-26",
+ "2016-08-30",
+ "2016-10-15",
+ "2016-11-18",
+ "2017-04-20",
+ "2017-05-03",
+ "2019-03-19"
+ ],
+ "times": [
+ "19:49:16",
+ "18:36:57",
+ "02:45:18",
+ "01:54:50",
+ "18:39:06",
+ "17:58:02",
+ "22:04:48"
+ ]
+ }
+ },
+ {
+ "business_id": "--EF5N7P70J_UYBTPypYlA",
+ "checkin_times": {
+ "dates": [
+ "2018-05-25",
+ "2018-09-18",
+ "2019-10-18"
+ ],
+ "times": [
+ "19:52:07",
+ "16:09:44",
+ "21:29:09"
+ ]
+ }
+ },
+ {
+ "business_id": "--Ni3oJ4VOqfOEu7Sj2Vzg",
+ "checkin_times": {
+ "dates": [
+ "2019-06-07"
+ ],
+ "times": [
+ "17:54:58"
+ ]
+ }
+ },
+ {
+ "business_id": "--Y1Adl1YUWfYIRSd8vkmA",
+ "checkin_times": {
+ "dates": [
+ "2011-05-03",
+ "2011-08-23",
+ "2014-12-04",
+ "2016-11-16"
+ ],
+ "times": [
+ "20:54:05",
+ "20:49:45",
+ "06:13:01",
+ "19:25:55"
+ ]
+ }
+ },
+ {
+ "business_id": "--YPwqIlRJrhHkJcjY3eiA",
+ "checkin_times": {
+ "dates": [
+ "2016-06-18",
+ "2016-10-15"
+ ],
+ "times": [
+ "21:35:45",
+ "18:17:51"
+ ]
+ }
+ },
+ {
+ "business_id": "--e8PjCNhEz32pprnPhCwQ",
+ "checkin_times": {
+ "dates": [
+ "2015-04-02"
+ ],
+ "times": [
+ "21:45:17"
+ ]
+ }
+ },
+ {
+ "business_id": "--kinfHwmtdjz03g8B8z8Q",
+ "checkin_times": {
+ "dates": [
+ "2014-08-27",
+ "2015-12-19",
+ "2018-11-27"
+ ],
+ "times": [
+ "17:49:18",
+ "21:30:31",
+ "15:53:50"
+ ]
+ }
+ },
+ {
+ "business_id": "--q6datkI-f0EoVheXNEeQ",
+ "checkin_times": {
+ "dates": [
+ "2014-01-28",
+ "2014-11-16",
+ "2015-11-15",
+ "2015-11-15"
+ ],
+ "times": [
+ "20:56:04",
+ "16:11:58",
+ "19:21:53",
+ "19:33:39"
+ ]
+ }
+ },
+ {
+ "business_id": "--qvQS4MigHPykD2GV0-zw",
+ "checkin_times": {
+ "dates": [
+ "2019-04-11"
+ ],
+ "times": [
+ "18:30:12"
+ ]
+ }
+ },
+ {
+ "business_id": "--wIGbLEhlpl_UeAIyDmZQ",
+ "checkin_times": {
+ "dates": [
+ "2015-06-06",
+ "2019-03-14"
+ ],
+ "times": [
+ "20:01:06",
+ "22:01:52"
+ ]
+ }
+ },
+ {
+ "business_id": "-0FA-Qdi3SPYIoJz9UQw-A",
+ "checkin_times": {
+ "dates": [
+ "2018-09-29",
+ "2018-10-20",
+ "2018-10-20"
+ ],
+ "times": [
+ "18:55:17",
+ "16:48:05",
+ "22:20:24"
+ ]
+ }
+ },
+ {
+ "business_id": "-0Hj1hb_XW6ybWq2M7QhGA",
+ "checkin_times": {
+ "dates": [
+ "2011-04-23",
+ "2014-05-04",
+ "2014-05-11",
+ "2014-06-04",
+ "2015-12-05",
+ "2017-05-15"
+ ],
+ "times": [
+ "21:11:22",
+ "19:42:48",
+ "19:16:08",
+ "19:14:18",
+ "19:22:42",
+ "23:19:00"
+ ]
+ }
+ },
+ {
+ "business_id": "-0KMvRFwDWdVBeTpT11iHw",
+ "checkin_times": {
+ "dates": [
+ "2012-07-13",
+ "2016-12-24",
+ "2017-08-31"
+ ],
+ "times": [
+ "21:43:57",
+ "02:27:31",
+ "00:35:26"
+ ]
+ }
+ },
+ {
+ "business_id": "-0LPtgJC31FWMrMv317p0Q",
+ "checkin_times": {
+ "dates": [
+ "2013-04-13",
+ "2013-08-19",
+ "2013-10-04"
+ ],
+ "times": [
+ "12:35:33",
+ "23:35:49",
+ "19:14:56"
+ ]
+ }
+ },
+ {
+ "business_id": "-0M3o2uWBnQZwd3hmfEwuw",
+ "checkin_times": {
+ "dates": [
+ "2016-09-10",
+ "2018-09-08",
+ "2019-09-13"
+ ],
+ "times": [
+ "19:26:19",
+ "14:15:37",
+ "22:47:25"
+ ]
+ }
+ },
+ {
+ "business_id": "-0RRiWDtfnS16AKCtfvBZg",
+ "checkin_times": {
+ "dates": [
+ "2017-05-19",
+ "2017-05-19",
+ "2017-08-28",
+ "2017-09-20",
+ "2017-10-01",
+ "2017-10-01",
+ "2017-12-27"
+ ],
+ "times": [
+ "14:30:16",
+ "14:30:25",
+ "15:49:37",
+ "20:19:51",
+ "16:31:05",
+ "16:56:27",
+ "23:33:20"
+ ]
+ }
+ },
+ {
+ "business_id": "-0Soj75v-XoRcf2ERr8Bmg",
+ "checkin_times": {
+ "dates": [
+ "2019-06-05"
+ ],
+ "times": [
+ "18:22:49"
+ ]
+ }
+ },
+ {
+ "business_id": "-0ZumLlFjMh4ZW1z2nXGug",
+ "checkin_times": {
+ "dates": [
+ "2011-09-24",
+ "2014-03-10",
+ "2015-05-27",
+ "2015-08-29",
+ "2018-03-16"
+ ],
+ "times": [
+ "21:37:32",
+ "20:20:07",
+ "00:40:24",
+ "17:58:15",
+ "15:03:26"
+ ]
+ }
+ },
+ {
+ "business_id": "-0aOudcaAyac0VJbMX-L1g",
+ "checkin_times": {
+ "dates": [
+ "2015-03-16",
+ "2015-12-21",
+ "2016-10-28",
+ "2016-10-28"
+ ],
+ "times": [
+ "23:51:16",
+ "04:48:01",
+ "20:22:42",
+ "20:23:00"
+ ]
+ }
+ },
+ {
+ "business_id": "-0b86isaXMY0v4g-V8GZ9Q",
+ "checkin_times": {
+ "dates": [
+ "2013-10-22",
+ "2014-11-21"
+ ],
+ "times": [
+ "16:49:21",
+ "17:39:24"
+ ]
+ }
+ },
+ {
+ "business_id": "-0d-BfFSU0bwLcnMaGRxYw",
+ "checkin_times": {
+ "dates": [
+ "2014-08-07",
+ "2014-09-16",
+ "2014-10-12",
+ "2015-07-21",
+ "2015-07-21"
+ ],
+ "times": [
+ "18:30:48",
+ "20:41:45",
+ "23:22:27",
+ "20:43:56",
+ "20:45:07"
+ ]
+ }
+ },
+ {
+ "business_id": "-0jz6c3C6i7RG7Ag22K-Pg",
+ "checkin_times": {
+ "dates": [
+ "2015-05-02",
+ "2015-05-06",
+ "2015-09-26"
+ ],
+ "times": [
+ "19:49:05",
+ "03:52:18",
+ "01:13:19"
+ ]
+ }
+ },
+ {
+ "business_id": "-0y3MZU2oYP8r1ruDP1bfQ",
+ "checkin_times": {
+ "dates": [
+ "2015-04-11",
+ "2015-11-21",
+ "2016-05-06",
+ "2017-08-09",
+ "2017-10-21"
+ ],
+ "times": [
+ "13:14:14",
+ "16:05:56",
+ "14:10:04",
+ "15:15:10",
+ "15:12:56"
+ ]
+ }
+ },
+ {
+ "business_id": "-1BPe8UjF2_l3nVk-DFUjA",
+ "checkin_times": {
+ "dates": [
+ "2015-12-03",
+ "2016-03-17",
+ "2016-11-02"
+ ],
+ "times": [
+ "18:44:00",
+ "18:19:21",
+ "15:58:38"
+ ]
+ }
+ },
+ {
+ "business_id": "-1E2CQu_38mkghvmZgCCRw",
+ "checkin_times": {
+ "dates": [
+ "2019-04-04"
+ ],
+ "times": [
+ "22:02:37"
+ ]
+ }
+ },
+ {
+ "business_id": "-1wzk43IZ5D9Ysu6kzb5xA",
+ "checkin_times": {
+ "dates": [
+ "2019-02-27"
+ ],
+ "times": [
+ "14:03:08"
+ ]
+ }
+ },
+ {
+ "business_id": "-23R9P2eG7VTc6DVLjFKzA",
+ "checkin_times": {
+ "dates": [
+ "2011-12-21",
+ "2012-04-15",
+ "2012-04-15",
+ "2013-06-30",
+ "2013-10-04",
+ "2014-07-16"
+ ],
+ "times": [
+ "19:02:51",
+ "04:21:39",
+ "14:23:56",
+ "22:39:51",
+ "20:34:13",
+ "02:28:40"
+ ]
+ }
+ },
+ {
+ "business_id": "-26MGfikhJiTfCI-GqmzhQ",
+ "checkin_times": {
+ "dates": [
+ "2018-06-13"
+ ],
+ "times": [
+ "20:16:07"
+ ]
+ }
+ },
+ {
+ "business_id": "-2bLuJsMZ0WhI9daurVQNQ",
+ "checkin_times": {
+ "dates": [
+ "2015-05-29",
+ "2015-06-01"
+ ],
+ "times": [
+ "16:46:17",
+ "15:03:53"
+ ]
+ }
+ },
+ {
+ "business_id": "-2hDBMaza_ldqnZdiU06LQ",
+ "checkin_times": {
+ "dates": [
+ "2011-10-08",
+ "2014-08-18",
+ "2016-01-07",
+ "2016-10-21",
+ "2016-12-01",
+ "2016-12-29",
+ "2018-07-22",
+ "2018-09-07",
+ "2019-03-08"
+ ],
+ "times": [
+ "12:02:23",
+ "02:11:11",
+ "05:27:51",
+ "20:15:55",
+ "03:57:10",
+ "01:54:42",
+ "19:55:31",
+ "01:42:54",
+ "03:41:06"
+ ]
+ }
+ }
+ ]
+);
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-2/use-case-2.03.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-2/use-case-2.03.query.sqlpp
new file mode 100644
index 0000000..a440550
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-2/use-case-2.03.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.
+ */
+SET `compiler.arrayindex` "true";
+
+USE TestYelp;
+
+SELECT COUNT(*)
+FROM YelpCheckin C, C.checkin_times.dates D
+WHERE D > " ";
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-2/use-case-2.04.get.http b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-2/use-case-2.04.get.http
new file mode 100644
index 0000000..a55ce93
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-2/use-case-2.04.get.http
@@ -0,0 +1,19 @@
+/*
+ * 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.
+ */
+/connector?dataverseName=TestYelp&datasetName=YelpCheckin
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-2/use-case-2.05.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-2/use-case-2.05.query.sqlpp
new file mode 100644
index 0000000..a440550
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-2/use-case-2.05.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.
+ */
+SET `compiler.arrayindex` "true";
+
+USE TestYelp;
+
+SELECT COUNT(*)
+FROM YelpCheckin C, C.checkin_times.dates D
+WHERE D > " ";
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-2/use-case-2.06.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-2/use-case-2.06.update.sqlpp
new file mode 100644
index 0000000..ea1dba3
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-2/use-case-2.06.update.sqlpp
@@ -0,0 +1,23 @@
+/*
+ * 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 TestYelp;
+
+DELETE FROM YelpCheckin C
+WHERE C.business_id != "--1UhMGODdWsrMastO9DZw";
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-2/use-case-2.07.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-2/use-case-2.07.query.sqlpp
new file mode 100644
index 0000000..a440550
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-2/use-case-2.07.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.
+ */
+SET `compiler.arrayindex` "true";
+
+USE TestYelp;
+
+SELECT COUNT(*)
+FROM YelpCheckin C, C.checkin_times.dates D
+WHERE D > " ";
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-2/use-case-2.08.get.http b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-2/use-case-2.08.get.http
new file mode 100644
index 0000000..a55ce93
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-2/use-case-2.08.get.http
@@ -0,0 +1,19 @@
+/*
+ * 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.
+ */
+/connector?dataverseName=TestYelp&datasetName=YelpCheckin
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-2/use-case-2.09.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-2/use-case-2.09.query.sqlpp
new file mode 100644
index 0000000..a440550
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-2/use-case-2.09.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.
+ */
+SET `compiler.arrayindex` "true";
+
+USE TestYelp;
+
+SELECT COUNT(*)
+FROM YelpCheckin C, C.checkin_times.dates D
+WHERE D > " ";
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-2/use-case-2.10.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-2/use-case-2.10.update.sqlpp
new file mode 100644
index 0000000..9467e0d
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-2/use-case-2.10.update.sqlpp
@@ -0,0 +1,497 @@
+/*
+ * 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 TestYelp;
+
+UPSERT INTO YelpCheckin (
+ [
+ {
+ "business_id": "--1UhMGODdWsrMastO9DZw",
+ "checkin_times": {
+ "dates": [
+ "2016-04-26",
+ "2016-08-30",
+ "2016-10-15",
+ "2016-11-18",
+ "2017-04-20",
+ "2017-05-03",
+ "2019-03-19"
+ ],
+ "times": [
+ "19:49:16",
+ "18:36:57",
+ "02:45:18",
+ "01:54:50",
+ "18:39:06",
+ "17:58:02",
+ "22:04:48"
+ ]
+ }
+ },
+ {
+ "business_id": "--EF5N7P70J_UYBTPypYlA",
+ "checkin_times": {
+ "dates": [
+ "2018-05-25",
+ "2018-09-18",
+ "2019-10-18"
+ ],
+ "times": [
+ "19:52:07",
+ "16:09:44",
+ "21:29:09"
+ ]
+ }
+ },
+ {
+ "business_id": "--Ni3oJ4VOqfOEu7Sj2Vzg",
+ "checkin_times": {
+ "dates": [
+ "2019-06-07"
+ ],
+ "times": [
+ "17:54:58"
+ ]
+ }
+ },
+ {
+ "business_id": "--Y1Adl1YUWfYIRSd8vkmA",
+ "checkin_times": {
+ "dates": [
+ "2011-05-03",
+ "2011-08-23",
+ "2014-12-04",
+ "2016-11-16"
+ ],
+ "times": [
+ "20:54:05",
+ "20:49:45",
+ "06:13:01",
+ "19:25:55"
+ ]
+ }
+ },
+ {
+ "business_id": "--YPwqIlRJrhHkJcjY3eiA",
+ "checkin_times": {
+ "dates": [
+ "2016-06-18",
+ "2016-10-15"
+ ],
+ "times": [
+ "21:35:45",
+ "18:17:51"
+ ]
+ }
+ },
+ {
+ "business_id": "--e8PjCNhEz32pprnPhCwQ",
+ "checkin_times": {
+ "dates": [
+ "2015-04-02"
+ ],
+ "times": [
+ "21:45:17"
+ ]
+ }
+ },
+ {
+ "business_id": "--kinfHwmtdjz03g8B8z8Q",
+ "checkin_times": {
+ "dates": [
+ "2014-08-27",
+ "2015-12-19",
+ "2018-11-27"
+ ],
+ "times": [
+ "17:49:18",
+ "21:30:31",
+ "15:53:50"
+ ]
+ }
+ },
+ {
+ "business_id": "--q6datkI-f0EoVheXNEeQ",
+ "checkin_times": {
+ "dates": [
+ "2014-01-28",
+ "2014-11-16",
+ "2015-11-15",
+ "2015-11-15"
+ ],
+ "times": [
+ "20:56:04",
+ "16:11:58",
+ "19:21:53",
+ "19:33:39"
+ ]
+ }
+ },
+ {
+ "business_id": "--qvQS4MigHPykD2GV0-zw",
+ "checkin_times": {
+ "dates": [
+ "2019-04-11"
+ ],
+ "times": [
+ "18:30:12"
+ ]
+ }
+ },
+ {
+ "business_id": "--wIGbLEhlpl_UeAIyDmZQ",
+ "checkin_times": {
+ "dates": [
+ "2015-06-06",
+ "2019-03-14"
+ ],
+ "times": [
+ "20:01:06",
+ "22:01:52"
+ ]
+ }
+ },
+ {
+ "business_id": "-0FA-Qdi3SPYIoJz9UQw-A",
+ "checkin_times": {
+ "dates": [
+ "2018-09-29",
+ "2018-10-20",
+ "2018-10-20"
+ ],
+ "times": [
+ "18:55:17",
+ "16:48:05",
+ "22:20:24"
+ ]
+ }
+ },
+ {
+ "business_id": "-0Hj1hb_XW6ybWq2M7QhGA",
+ "checkin_times": {
+ "dates": [
+ "2011-04-23",
+ "2014-05-04",
+ "2014-05-11",
+ "2014-06-04",
+ "2015-12-05",
+ "2017-05-15"
+ ],
+ "times": [
+ "21:11:22",
+ "19:42:48",
+ "19:16:08",
+ "19:14:18",
+ "19:22:42",
+ "23:19:00"
+ ]
+ }
+ },
+ {
+ "business_id": "-0KMvRFwDWdVBeTpT11iHw",
+ "checkin_times": {
+ "dates": [
+ "2012-07-13",
+ "2016-12-24",
+ "2017-08-31"
+ ],
+ "times": [
+ "21:43:57",
+ "02:27:31",
+ "00:35:26"
+ ]
+ }
+ },
+ {
+ "business_id": "-0LPtgJC31FWMrMv317p0Q",
+ "checkin_times": {
+ "dates": [
+ "2013-04-13",
+ "2013-08-19",
+ "2013-10-04"
+ ],
+ "times": [
+ "12:35:33",
+ "23:35:49",
+ "19:14:56"
+ ]
+ }
+ },
+ {
+ "business_id": "-0M3o2uWBnQZwd3hmfEwuw",
+ "checkin_times": {
+ "dates": [
+ "2016-09-10",
+ "2018-09-08",
+ "2019-09-13"
+ ],
+ "times": [
+ "19:26:19",
+ "14:15:37",
+ "22:47:25"
+ ]
+ }
+ },
+ {
+ "business_id": "-0RRiWDtfnS16AKCtfvBZg",
+ "checkin_times": {
+ "dates": [
+ "2017-05-19",
+ "2017-05-19",
+ "2017-08-28",
+ "2017-09-20",
+ "2017-10-01",
+ "2017-10-01",
+ "2017-12-27"
+ ],
+ "times": [
+ "14:30:16",
+ "14:30:25",
+ "15:49:37",
+ "20:19:51",
+ "16:31:05",
+ "16:56:27",
+ "23:33:20"
+ ]
+ }
+ },
+ {
+ "business_id": "-0Soj75v-XoRcf2ERr8Bmg",
+ "checkin_times": {
+ "dates": [
+ "2019-06-05"
+ ],
+ "times": [
+ "18:22:49"
+ ]
+ }
+ },
+ {
+ "business_id": "-0ZumLlFjMh4ZW1z2nXGug",
+ "checkin_times": {
+ "dates": [
+ "2011-09-24",
+ "2014-03-10",
+ "2015-05-27",
+ "2015-08-29",
+ "2018-03-16"
+ ],
+ "times": [
+ "21:37:32",
+ "20:20:07",
+ "00:40:24",
+ "17:58:15",
+ "15:03:26"
+ ]
+ }
+ },
+ {
+ "business_id": "-0aOudcaAyac0VJbMX-L1g",
+ "checkin_times": {
+ "dates": [
+ "2015-03-16",
+ "2015-12-21",
+ "2016-10-28",
+ "2016-10-28"
+ ],
+ "times": [
+ "23:51:16",
+ "04:48:01",
+ "20:22:42",
+ "20:23:00"
+ ]
+ }
+ },
+ {
+ "business_id": "-0b86isaXMY0v4g-V8GZ9Q",
+ "checkin_times": {
+ "dates": [
+ "2013-10-22",
+ "2014-11-21"
+ ],
+ "times": [
+ "16:49:21",
+ "17:39:24"
+ ]
+ }
+ },
+ {
+ "business_id": "-0d-BfFSU0bwLcnMaGRxYw",
+ "checkin_times": {
+ "dates": [
+ "2014-08-07",
+ "2014-09-16",
+ "2014-10-12",
+ "2015-07-21",
+ "2015-07-21"
+ ],
+ "times": [
+ "18:30:48",
+ "20:41:45",
+ "23:22:27",
+ "20:43:56",
+ "20:45:07"
+ ]
+ }
+ },
+ {
+ "business_id": "-0jz6c3C6i7RG7Ag22K-Pg",
+ "checkin_times": {
+ "dates": [
+ "2015-05-02",
+ "2015-05-06",
+ "2015-09-26"
+ ],
+ "times": [
+ "19:49:05",
+ "03:52:18",
+ "01:13:19"
+ ]
+ }
+ },
+ {
+ "business_id": "-0y3MZU2oYP8r1ruDP1bfQ",
+ "checkin_times": {
+ "dates": [
+ "2015-04-11",
+ "2015-11-21",
+ "2016-05-06",
+ "2017-08-09",
+ "2017-10-21"
+ ],
+ "times": [
+ "13:14:14",
+ "16:05:56",
+ "14:10:04",
+ "15:15:10",
+ "15:12:56"
+ ]
+ }
+ },
+ {
+ "business_id": "-1BPe8UjF2_l3nVk-DFUjA",
+ "checkin_times": {
+ "dates": [
+ "2015-12-03",
+ "2016-03-17",
+ "2016-11-02"
+ ],
+ "times": [
+ "18:44:00",
+ "18:19:21",
+ "15:58:38"
+ ]
+ }
+ },
+ {
+ "business_id": "-1E2CQu_38mkghvmZgCCRw",
+ "checkin_times": {
+ "dates": [
+ "2019-04-04"
+ ],
+ "times": [
+ "22:02:37"
+ ]
+ }
+ },
+ {
+ "business_id": "-1wzk43IZ5D9Ysu6kzb5xA",
+ "checkin_times": {
+ "dates": [
+ "2019-02-27"
+ ],
+ "times": [
+ "14:03:08"
+ ]
+ }
+ },
+ {
+ "business_id": "-23R9P2eG7VTc6DVLjFKzA",
+ "checkin_times": {
+ "dates": [
+ "2011-12-21",
+ "2012-04-15",
+ "2012-04-15",
+ "2013-06-30",
+ "2013-10-04",
+ "2014-07-16"
+ ],
+ "times": [
+ "19:02:51",
+ "04:21:39",
+ "14:23:56",
+ "22:39:51",
+ "20:34:13",
+ "02:28:40"
+ ]
+ }
+ },
+ {
+ "business_id": "-26MGfikhJiTfCI-GqmzhQ",
+ "checkin_times": {
+ "dates": [
+ "2018-06-13"
+ ],
+ "times": [
+ "20:16:07"
+ ]
+ }
+ },
+ {
+ "business_id": "-2bLuJsMZ0WhI9daurVQNQ",
+ "checkin_times": {
+ "dates": [
+ "2015-05-29",
+ "2015-06-01"
+ ],
+ "times": [
+ "16:46:17",
+ "15:03:53"
+ ]
+ }
+ },
+ {
+ "business_id": "-2hDBMaza_ldqnZdiU06LQ",
+ "checkin_times": {
+ "dates": [
+ "2011-10-08",
+ "2014-08-18",
+ "2016-01-07",
+ "2016-10-21",
+ "2016-12-01",
+ "2016-12-29",
+ "2018-07-22",
+ "2018-09-07",
+ "2019-03-08"
+ ],
+ "times": [
+ "12:02:23",
+ "02:11:11",
+ "05:27:51",
+ "20:15:55",
+ "03:57:10",
+ "01:54:42",
+ "19:55:31",
+ "01:42:54",
+ "03:41:06"
+ ]
+ }
+ }
+ ]
+);
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-2/use-case-2.11.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-2/use-case-2.11.query.sqlpp
new file mode 100644
index 0000000..a440550
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-2/use-case-2.11.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.
+ */
+SET `compiler.arrayindex` "true";
+
+USE TestYelp;
+
+SELECT COUNT(*)
+FROM YelpCheckin C, C.checkin_times.dates D
+WHERE D > " ";
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-2/use-case-2.12.get.http b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-2/use-case-2.12.get.http
new file mode 100644
index 0000000..a55ce93
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-2/use-case-2.12.get.http
@@ -0,0 +1,19 @@
+/*
+ * 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.
+ */
+/connector?dataverseName=TestYelp&datasetName=YelpCheckin
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-2/use-case-2.13.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-2/use-case-2.13.query.sqlpp
new file mode 100644
index 0000000..a440550
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-2/use-case-2.13.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.
+ */
+SET `compiler.arrayindex` "true";
+
+USE TestYelp;
+
+SELECT COUNT(*)
+FROM YelpCheckin C, C.checkin_times.dates D
+WHERE D > " ";
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-3/use-case-3.01.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-3/use-case-3.01.ddl.sqlpp
new file mode 100644
index 0000000..559c091
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-3/use-case-3.01.ddl.sqlpp
@@ -0,0 +1,40 @@
+/*
+ * 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: Verify the following DML actions for an array->record->atomic index:
+ * 1) Insert into an empty index (non bulk-load operation).
+ * 2) Delete all-but-one entry from the index.
+ * 3) Upsert all entries into the index.
+ */
+
+DROP DATAVERSE TestYelp IF EXISTS;
+CREATE DATAVERSE TestYelp;
+USE TestYelp;
+
+CREATE TYPE CheckinType AS {
+ business_id: string
+};
+
+CREATE DATASET YelpCheckin(CheckinType) PRIMARY KEY business_id WITH {
+ "storage-format" : {"format" : "column"}
+};
+
+CREATE INDEX IdxYelpCheckinDates ON YelpCheckin (UNNEST checkin_times SELECT date : string ) EXCLUDE UNKNOWN KEY;
+CREATE INDEX IdxYelpCheckinTimes ON YelpCheckin (UNNEST checkin_times SELECT time : string ) EXCLUDE UNKNOWN KEY;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-3/use-case-3.02.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-3/use-case-3.02.update.sqlpp
new file mode 100644
index 0000000..4fd7c64
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-3/use-case-3.02.update.sqlpp
@@ -0,0 +1,276 @@
+/*
+ * 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 TestYelp;
+
+INSERT INTO YelpCheckin (
+ [
+ {
+ "business_id": "--1UhMGODdWsrMastO9DZw",
+ "checkin_times": [
+ {"date": "2016-04-26", "time": "19:49:16"},
+ {"date": "2016-08-30", "time": "18:36:57"},
+ {"date": "2016-10-15", "time": "02:45:18"},
+ {"date": "2016-11-18", "time": "01:54:50"},
+ {"date": "2017-04-20", "time": "18:39:06"},
+ {"date": "2017-05-03", "time": "17:58:02"},
+ {"date": "2019-03-19", "time": "22:04:48"}
+ ]
+ },
+ {
+ "business_id": "--EF5N7P70J_UYBTPypYlA",
+ "checkin_times": [
+ {"date": "2018-05-25", "time": "19:52:07"},
+ {"date": "2018-09-18", "time": "16:09:44"},
+ {"date": "2019-10-18", "time": "21:29:09"}
+ ]
+ },
+ {
+ "business_id": "--Ni3oJ4VOqfOEu7Sj2Vzg",
+ "checkin_times": [
+ {"date": "2019-06-07", "time": "17:54:58"}
+ ]
+ },
+ {
+ "business_id": "--Y1Adl1YUWfYIRSd8vkmA",
+ "checkin_times": [
+ {"date": "2011-05-03", "time": "20:54:05"},
+ {"date": "2011-08-23", "time": "20:49:45"},
+ {"date": "2014-12-04", "time": "06:13:01"},
+ {"date": "2016-11-16", "time": "19:25:55"}
+ ]
+ },
+ {
+ "business_id": "--YPwqIlRJrhHkJcjY3eiA",
+ "checkin_times": [
+ {"date": "2016-06-18", "time": "21:35:45"},
+ {"date": "2016-10-15", "time": "18:17:51"}
+ ]
+ },
+ {
+ "business_id": "--e8PjCNhEz32pprnPhCwQ",
+ "checkin_times": [
+ {"date": "2015-04-02", "time": "21:45:17"}
+ ]
+ },
+ {
+ "business_id": "--kinfHwmtdjz03g8B8z8Q",
+ "checkin_times": [
+ {"date": "2014-08-27", "time": "17:49:18"},
+ {"date": "2015-12-19", "time": "21:30:31"},
+ {"date": "2018-11-27", "time": "15:53:50"}
+ ]
+ },
+ {
+ "business_id": "--q6datkI-f0EoVheXNEeQ",
+ "checkin_times": [
+ {"date": "2014-01-28", "time": "20:56:04"},
+ {"date": "2014-11-16", "time": "16:11:58"},
+ {"date": "2015-11-15", "time": "19:21:53"},
+ {"date": "2015-11-15", "time": "19:33:39"}
+ ]
+ },
+ {
+ "business_id": "--qvQS4MigHPykD2GV0-zw",
+ "checkin_times": [
+ {"date": "2019-04-11", "time": "18:30:12"}
+ ]
+ },
+ {
+ "business_id": "--wIGbLEhlpl_UeAIyDmZQ",
+ "checkin_times": [
+ {"date": "2015-06-06", "time": "20:01:06"},
+ {"date": "2019-03-14", "time": "22:01:52"}
+ ]
+ },
+ {
+ "business_id": "-0FA-Qdi3SPYIoJz9UQw-A",
+ "checkin_times": [
+ {"date": "2018-09-29", "time": "18:55:17"},
+ {"date": "2018-10-20", "time": "16:48:05"},
+ {"date": "2018-10-20", "time": "22:20:24"}
+ ]
+ },
+ {
+ "business_id": "-0Hj1hb_XW6ybWq2M7QhGA",
+ "checkin_times": [
+ {"date": "2011-04-23", "time": "21:11:22"},
+ {"date": "2014-05-04", "time": "19:42:48"},
+ {"date": "2014-05-11", "time": "19:16:08"},
+ {"date": "2014-06-04", "time": "19:14:18"},
+ {"date": "2015-12-05", "time": "19:22:42"},
+ {"date": "2017-05-15", "time": "23:19:00"}
+ ]
+ },
+ {
+ "business_id": "-0KMvRFwDWdVBeTpT11iHw",
+ "checkin_times": [
+ {"date": "2012-07-13", "time": "21:43:57"},
+ {"date": "2016-12-24", "time": "02:27:31"},
+ {"date": "2017-08-31", "time": "00:35:26"}
+ ]
+ },
+ {
+ "business_id": "-0LPtgJC31FWMrMv317p0Q",
+ "checkin_times": [
+ {"date": "2013-04-13", "time": "12:35:33"},
+ {"date": "2013-08-19", "time": "23:35:49"},
+ {"date": "2013-10-04", "time": "19:14:56"}
+ ]
+ },
+ {
+ "business_id": "-0M3o2uWBnQZwd3hmfEwuw",
+ "checkin_times": [
+ {"date": "2016-09-10", "time": "19:26:19"},
+ {"date": "2018-09-08", "time": "14:15:37"},
+ {"date": "2019-09-13", "time": "22:47:25"}
+ ]
+ },
+ {
+ "business_id": "-0RRiWDtfnS16AKCtfvBZg",
+ "checkin_times": [
+ {"date": "2017-05-19", "time": "14:30:16"},
+ {"date": "2017-05-19", "time": "14:30:25"},
+ {"date": "2017-08-28", "time": "15:49:37"},
+ {"date": "2017-09-20", "time": "20:19:51"},
+ {"date": "2017-10-01", "time": "16:31:05"},
+ {"date": "2017-10-01", "time": "16:56:27"},
+ {"date": "2017-12-27", "time": "23:33:20"}
+ ]
+ },
+ {
+ "business_id": "-0Soj75v-XoRcf2ERr8Bmg",
+ "checkin_times": [
+ {"date": "2019-06-05", "time": "18:22:49"}
+ ]
+ },
+ {
+ "business_id": "-0ZumLlFjMh4ZW1z2nXGug",
+ "checkin_times": [
+ {"date": "2011-09-24", "time": "21:37:32"},
+ {"date": "2014-03-10", "time": "20:20:07"},
+ {"date": "2015-05-27", "time": "00:40:24"},
+ {"date": "2015-08-29", "time": "17:58:15"},
+ {"date": "2018-03-16", "time": "15:03:26"}
+ ]
+ },
+ {
+ "business_id": "-0aOudcaAyac0VJbMX-L1g",
+ "checkin_times": [
+ {"date": "2015-03-16", "time": "23:51:16"},
+ {"date": "2015-12-21", "time": "04:48:01"},
+ {"date": "2016-10-28", "time": "20:22:42"},
+ {"date": "2016-10-28", "time": "20:23:00"}
+ ]
+ },
+ {
+ "business_id": "-0b86isaXMY0v4g-V8GZ9Q",
+ "checkin_times": [
+ {"date": "2013-10-22", "time": "16:49:21"},
+ {"date": "2014-11-21", "time": "17:39:24"}
+ ]
+ },
+ {
+ "business_id": "-0d-BfFSU0bwLcnMaGRxYw",
+ "checkin_times": [
+ {"date": "2014-08-07", "time": "18:30:48"},
+ {"date": "2014-09-16", "time": "20:41:45"},
+ {"date": "2014-10-12", "time": "23:22:27"},
+ {"date": "2015-07-21", "time": "20:43:56"},
+ {"date": "2015-07-21", "time": "20:45:07"}
+ ]
+ },
+ {
+ "business_id": "-0jz6c3C6i7RG7Ag22K-Pg",
+ "checkin_times": [
+ {"date": "2015-05-02", "time": "19:49:05"},
+ {"date": "2015-05-06", "time": "03:52:18"},
+ {"date": "2015-09-26", "time": "01:13:19"}
+ ]
+ },
+ {
+ "business_id": "-0y3MZU2oYP8r1ruDP1bfQ",
+ "checkin_times": [
+ {"date": "2015-04-11", "time": "13:14:14"},
+ {"date": "2015-11-21", "time": "16:05:56"},
+ {"date": "2016-05-06", "time": "14:10:04"},
+ {"date": "2017-08-09", "time": "15:15:10"},
+ {"date": "2017-10-21", "time": "15:12:56"}
+ ]
+ },
+ {
+ "business_id": "-1BPe8UjF2_l3nVk-DFUjA",
+ "checkin_times": [
+ {"date": "2015-12-03", "time": "18:44:00"},
+ {"date": "2016-03-17", "time": "18:19:21"},
+ {"date": "2016-11-02", "time": "15:58:38"}
+ ]
+ },
+ {
+ "business_id": "-1E2CQu_38mkghvmZgCCRw",
+ "checkin_times": [
+ {"date": "2019-04-04", "time": "22:02:37"}
+ ]
+ },
+ {
+ "business_id": "-1wzk43IZ5D9Ysu6kzb5xA",
+ "checkin_times": [
+ {"date": "2019-02-27", "time": "14:03:08"}
+ ]
+ },
+ {
+ "business_id": "-23R9P2eG7VTc6DVLjFKzA",
+ "checkin_times": [
+ {"date": "2011-12-21", "time": "19:02:51"},
+ {"date": "2012-04-15", "time": "04:21:39"},
+ {"date": "2012-04-15", "time": "14:23:56"},
+ {"date": "2013-06-30", "time": "22:39:51"},
+ {"date": "2013-10-04", "time": "20:34:13"},
+ {"date": "2014-07-16", "time": "02:28:40"}
+ ]
+ },
+ {
+ "business_id": "-26MGfikhJiTfCI-GqmzhQ",
+ "checkin_times": [
+ {"date": "2018-06-13", "time": "20:16:07"}
+ ]
+ },
+ {
+ "business_id": "-2bLuJsMZ0WhI9daurVQNQ",
+ "checkin_times": [
+ {"date": "2015-05-29", "time": "16:46:17"},
+ {"date": "2015-06-01", "time": "15:03:53"}
+ ]
+ },
+ {
+ "business_id": "-2hDBMaza_ldqnZdiU06LQ",
+ "checkin_times": [
+ {"date": "2011-10-08", "time": "12:02:23"},
+ {"date": "2014-08-18", "time": "02:11:11"},
+ {"date": "2016-01-07", "time": "05:27:51"},
+ {"date": "2016-10-21", "time": "20:15:55"},
+ {"date": "2016-12-01", "time": "03:57:10"},
+ {"date": "2016-12-29", "time": "01:54:42"},
+ {"date": "2018-07-22", "time": "19:55:31"},
+ {"date": "2018-09-07", "time": "01:42:54"},
+ {"date": "2019-03-08", "time": "03:41:06"}
+ ]
+ }
+ ]
+);
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-3/use-case-3.03.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-3/use-case-3.03.query.sqlpp
new file mode 100644
index 0000000..2757b02
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-3/use-case-3.03.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.
+ */
+SET `compiler.arrayindex` "true";
+
+USE TestYelp;
+
+SELECT COUNT(*)
+FROM YelpCheckin C, C.checkin_times D
+WHERE D.date > " ";
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-3/use-case-3.04.get.http b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-3/use-case-3.04.get.http
new file mode 100644
index 0000000..a55ce93
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-3/use-case-3.04.get.http
@@ -0,0 +1,19 @@
+/*
+ * 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.
+ */
+/connector?dataverseName=TestYelp&datasetName=YelpCheckin
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-3/use-case-3.05.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-3/use-case-3.05.query.sqlpp
new file mode 100644
index 0000000..2757b02
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-3/use-case-3.05.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.
+ */
+SET `compiler.arrayindex` "true";
+
+USE TestYelp;
+
+SELECT COUNT(*)
+FROM YelpCheckin C, C.checkin_times D
+WHERE D.date > " ";
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-3/use-case-3.06.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-3/use-case-3.06.update.sqlpp
new file mode 100644
index 0000000..ea1dba3
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-3/use-case-3.06.update.sqlpp
@@ -0,0 +1,23 @@
+/*
+ * 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 TestYelp;
+
+DELETE FROM YelpCheckin C
+WHERE C.business_id != "--1UhMGODdWsrMastO9DZw";
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-3/use-case-3.07.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-3/use-case-3.07.query.sqlpp
new file mode 100644
index 0000000..2757b02
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-3/use-case-3.07.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.
+ */
+SET `compiler.arrayindex` "true";
+
+USE TestYelp;
+
+SELECT COUNT(*)
+FROM YelpCheckin C, C.checkin_times D
+WHERE D.date > " ";
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-3/use-case-3.08.get.http b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-3/use-case-3.08.get.http
new file mode 100644
index 0000000..a55ce93
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-3/use-case-3.08.get.http
@@ -0,0 +1,19 @@
+/*
+ * 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.
+ */
+/connector?dataverseName=TestYelp&datasetName=YelpCheckin
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-3/use-case-3.09.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-3/use-case-3.09.query.sqlpp
new file mode 100644
index 0000000..2757b02
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-3/use-case-3.09.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.
+ */
+SET `compiler.arrayindex` "true";
+
+USE TestYelp;
+
+SELECT COUNT(*)
+FROM YelpCheckin C, C.checkin_times D
+WHERE D.date > " ";
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-3/use-case-3.10.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-3/use-case-3.10.update.sqlpp
new file mode 100644
index 0000000..b3f8466
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-3/use-case-3.10.update.sqlpp
@@ -0,0 +1,276 @@
+/*
+ * 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 TestYelp;
+
+UPSERT INTO YelpCheckin (
+ [
+ {
+ "business_id": "--1UhMGODdWsrMastO9DZw",
+ "checkin_times": [
+ {"date": "2016-04-26", "time": "19:49:16"},
+ {"date": "2016-08-30", "time": "18:36:57"},
+ {"date": "2016-10-15", "time": "02:45:18"},
+ {"date": "2016-11-18", "time": "01:54:50"},
+ {"date": "2017-04-20", "time": "18:39:06"},
+ {"date": "2017-05-03", "time": "17:58:02"},
+ {"date": "2019-03-19", "time": "22:04:48"}
+ ]
+ },
+ {
+ "business_id": "--EF5N7P70J_UYBTPypYlA",
+ "checkin_times": [
+ {"date": "2018-05-25", "time": "19:52:07"},
+ {"date": "2018-09-18", "time": "16:09:44"},
+ {"date": "2019-10-18", "time": "21:29:09"}
+ ]
+ },
+ {
+ "business_id": "--Ni3oJ4VOqfOEu7Sj2Vzg",
+ "checkin_times": [
+ {"date": "2019-06-07", "time": "17:54:58"}
+ ]
+ },
+ {
+ "business_id": "--Y1Adl1YUWfYIRSd8vkmA",
+ "checkin_times": [
+ {"date": "2011-05-03", "time": "20:54:05"},
+ {"date": "2011-08-23", "time": "20:49:45"},
+ {"date": "2014-12-04", "time": "06:13:01"},
+ {"date": "2016-11-16", "time": "19:25:55"}
+ ]
+ },
+ {
+ "business_id": "--YPwqIlRJrhHkJcjY3eiA",
+ "checkin_times": [
+ {"date": "2016-06-18", "time": "21:35:45"},
+ {"date": "2016-10-15", "time": "18:17:51"}
+ ]
+ },
+ {
+ "business_id": "--e8PjCNhEz32pprnPhCwQ",
+ "checkin_times": [
+ {"date": "2015-04-02", "time": "21:45:17"}
+ ]
+ },
+ {
+ "business_id": "--kinfHwmtdjz03g8B8z8Q",
+ "checkin_times": [
+ {"date": "2014-08-27", "time": "17:49:18"},
+ {"date": "2015-12-19", "time": "21:30:31"},
+ {"date": "2018-11-27", "time": "15:53:50"}
+ ]
+ },
+ {
+ "business_id": "--q6datkI-f0EoVheXNEeQ",
+ "checkin_times": [
+ {"date": "2014-01-28", "time": "20:56:04"},
+ {"date": "2014-11-16", "time": "16:11:58"},
+ {"date": "2015-11-15", "time": "19:21:53"},
+ {"date": "2015-11-15", "time": "19:33:39"}
+ ]
+ },
+ {
+ "business_id": "--qvQS4MigHPykD2GV0-zw",
+ "checkin_times": [
+ {"date": "2019-04-11", "time": "18:30:12"}
+ ]
+ },
+ {
+ "business_id": "--wIGbLEhlpl_UeAIyDmZQ",
+ "checkin_times": [
+ {"date": "2015-06-06", "time": "20:01:06"},
+ {"date": "2019-03-14", "time": "22:01:52"}
+ ]
+ },
+ {
+ "business_id": "-0FA-Qdi3SPYIoJz9UQw-A",
+ "checkin_times": [
+ {"date": "2018-09-29", "time": "18:55:17"},
+ {"date": "2018-10-20", "time": "16:48:05"},
+ {"date": "2018-10-20", "time": "22:20:24"}
+ ]
+ },
+ {
+ "business_id": "-0Hj1hb_XW6ybWq2M7QhGA",
+ "checkin_times": [
+ {"date": "2011-04-23", "time": "21:11:22"},
+ {"date": "2014-05-04", "time": "19:42:48"},
+ {"date": "2014-05-11", "time": "19:16:08"},
+ {"date": "2014-06-04", "time": "19:14:18"},
+ {"date": "2015-12-05", "time": "19:22:42"},
+ {"date": "2017-05-15", "time": "23:19:00"}
+ ]
+ },
+ {
+ "business_id": "-0KMvRFwDWdVBeTpT11iHw",
+ "checkin_times": [
+ {"date": "2012-07-13", "time": "21:43:57"},
+ {"date": "2016-12-24", "time": "02:27:31"},
+ {"date": "2017-08-31", "time": "00:35:26"}
+ ]
+ },
+ {
+ "business_id": "-0LPtgJC31FWMrMv317p0Q",
+ "checkin_times": [
+ {"date": "2013-04-13", "time": "12:35:33"},
+ {"date": "2013-08-19", "time": "23:35:49"},
+ {"date": "2013-10-04", "time": "19:14:56"}
+ ]
+ },
+ {
+ "business_id": "-0M3o2uWBnQZwd3hmfEwuw",
+ "checkin_times": [
+ {"date": "2016-09-10", "time": "19:26:19"},
+ {"date": "2018-09-08", "time": "14:15:37"},
+ {"date": "2019-09-13", "time": "22:47:25"}
+ ]
+ },
+ {
+ "business_id": "-0RRiWDtfnS16AKCtfvBZg",
+ "checkin_times": [
+ {"date": "2017-05-19", "time": "14:30:16"},
+ {"date": "2017-05-19", "time": "14:30:25"},
+ {"date": "2017-08-28", "time": "15:49:37"},
+ {"date": "2017-09-20", "time": "20:19:51"},
+ {"date": "2017-10-01", "time": "16:31:05"},
+ {"date": "2017-10-01", "time": "16:56:27"},
+ {"date": "2017-12-27", "time": "23:33:20"}
+ ]
+ },
+ {
+ "business_id": "-0Soj75v-XoRcf2ERr8Bmg",
+ "checkin_times": [
+ {"date": "2019-06-05", "time": "18:22:49"}
+ ]
+ },
+ {
+ "business_id": "-0ZumLlFjMh4ZW1z2nXGug",
+ "checkin_times": [
+ {"date": "2011-09-24", "time": "21:37:32"},
+ {"date": "2014-03-10", "time": "20:20:07"},
+ {"date": "2015-05-27", "time": "00:40:24"},
+ {"date": "2015-08-29", "time": "17:58:15"},
+ {"date": "2018-03-16", "time": "15:03:26"}
+ ]
+ },
+ {
+ "business_id": "-0aOudcaAyac0VJbMX-L1g",
+ "checkin_times": [
+ {"date": "2015-03-16", "time": "23:51:16"},
+ {"date": "2015-12-21", "time": "04:48:01"},
+ {"date": "2016-10-28", "time": "20:22:42"},
+ {"date": "2016-10-28", "time": "20:23:00"}
+ ]
+ },
+ {
+ "business_id": "-0b86isaXMY0v4g-V8GZ9Q",
+ "checkin_times": [
+ {"date": "2013-10-22", "time": "16:49:21"},
+ {"date": "2014-11-21", "time": "17:39:24"}
+ ]
+ },
+ {
+ "business_id": "-0d-BfFSU0bwLcnMaGRxYw",
+ "checkin_times": [
+ {"date": "2014-08-07", "time": "18:30:48"},
+ {"date": "2014-09-16", "time": "20:41:45"},
+ {"date": "2014-10-12", "time": "23:22:27"},
+ {"date": "2015-07-21", "time": "20:43:56"},
+ {"date": "2015-07-21", "time": "20:45:07"}
+ ]
+ },
+ {
+ "business_id": "-0jz6c3C6i7RG7Ag22K-Pg",
+ "checkin_times": [
+ {"date": "2015-05-02", "time": "19:49:05"},
+ {"date": "2015-05-06", "time": "03:52:18"},
+ {"date": "2015-09-26", "time": "01:13:19"}
+ ]
+ },
+ {
+ "business_id": "-0y3MZU2oYP8r1ruDP1bfQ",
+ "checkin_times": [
+ {"date": "2015-04-11", "time": "13:14:14"},
+ {"date": "2015-11-21", "time": "16:05:56"},
+ {"date": "2016-05-06", "time": "14:10:04"},
+ {"date": "2017-08-09", "time": "15:15:10"},
+ {"date": "2017-10-21", "time": "15:12:56"}
+ ]
+ },
+ {
+ "business_id": "-1BPe8UjF2_l3nVk-DFUjA",
+ "checkin_times": [
+ {"date": "2015-12-03", "time": "18:44:00"},
+ {"date": "2016-03-17", "time": "18:19:21"},
+ {"date": "2016-11-02", "time": "15:58:38"}
+ ]
+ },
+ {
+ "business_id": "-1E2CQu_38mkghvmZgCCRw",
+ "checkin_times": [
+ {"date": "2019-04-04", "time": "22:02:37"}
+ ]
+ },
+ {
+ "business_id": "-1wzk43IZ5D9Ysu6kzb5xA",
+ "checkin_times": [
+ {"date": "2019-02-27", "time": "14:03:08"}
+ ]
+ },
+ {
+ "business_id": "-23R9P2eG7VTc6DVLjFKzA",
+ "checkin_times": [
+ {"date": "2011-12-21", "time": "19:02:51"},
+ {"date": "2012-04-15", "time": "04:21:39"},
+ {"date": "2012-04-15", "time": "14:23:56"},
+ {"date": "2013-06-30", "time": "22:39:51"},
+ {"date": "2013-10-04", "time": "20:34:13"},
+ {"date": "2014-07-16", "time": "02:28:40"}
+ ]
+ },
+ {
+ "business_id": "-26MGfikhJiTfCI-GqmzhQ",
+ "checkin_times": [
+ {"date": "2018-06-13", "time": "20:16:07"}
+ ]
+ },
+ {
+ "business_id": "-2bLuJsMZ0WhI9daurVQNQ",
+ "checkin_times": [
+ {"date": "2015-05-29", "time": "16:46:17"},
+ {"date": "2015-06-01", "time": "15:03:53"}
+ ]
+ },
+ {
+ "business_id": "-2hDBMaza_ldqnZdiU06LQ",
+ "checkin_times": [
+ {"date": "2011-10-08", "time": "12:02:23"},
+ {"date": "2014-08-18", "time": "02:11:11"},
+ {"date": "2016-01-07", "time": "05:27:51"},
+ {"date": "2016-10-21", "time": "20:15:55"},
+ {"date": "2016-12-01", "time": "03:57:10"},
+ {"date": "2016-12-29", "time": "01:54:42"},
+ {"date": "2018-07-22", "time": "19:55:31"},
+ {"date": "2018-09-07", "time": "01:42:54"},
+ {"date": "2019-03-08", "time": "03:41:06"}
+ ]
+ }
+ ]
+);
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-3/use-case-3.11.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-3/use-case-3.11.query.sqlpp
new file mode 100644
index 0000000..2757b02
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-3/use-case-3.11.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.
+ */
+SET `compiler.arrayindex` "true";
+
+USE TestYelp;
+
+SELECT COUNT(*)
+FROM YelpCheckin C, C.checkin_times D
+WHERE D.date > " ";
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-3/use-case-3.12.get.http b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-3/use-case-3.12.get.http
new file mode 100644
index 0000000..a55ce93
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-3/use-case-3.12.get.http
@@ -0,0 +1,19 @@
+/*
+ * 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.
+ */
+/connector?dataverseName=TestYelp&datasetName=YelpCheckin
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-3/use-case-3.13.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-3/use-case-3.13.query.sqlpp
new file mode 100644
index 0000000..2757b02
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-3/use-case-3.13.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.
+ */
+SET `compiler.arrayindex` "true";
+
+USE TestYelp;
+
+SELECT COUNT(*)
+FROM YelpCheckin C, C.checkin_times D
+WHERE D.date > " ";
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-4/use-case-4.01.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-4/use-case-4.01.ddl.sqlpp
new file mode 100644
index 0000000..410225a
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-4/use-case-4.01.ddl.sqlpp
@@ -0,0 +1,40 @@
+/*
+ * 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: Verify the following DML actions for an array->record->array->atomic index:
+ * 1) Insert into an empty index (non bulk-load operation).
+ * 2) Delete all-but-one entry from the index.
+ * 3) Upsert all entries into the index.
+ */
+
+DROP DATAVERSE TestYelp IF EXISTS;
+CREATE DATAVERSE TestYelp;
+USE TestYelp;
+
+CREATE TYPE CheckinType AS {
+ business_id: string
+};
+
+CREATE DATASET YelpCheckin(CheckinType) PRIMARY KEY business_id WITH {
+ "storage-format" : {"format" : "column"}
+};
+
+CREATE INDEX IdxYelpCheckinDates ON YelpCheckin (UNNEST checkin_times UNNEST dates : string ) EXCLUDE UNKNOWN KEY;
+CREATE INDEX IdxYelpCheckinTimes ON YelpCheckin (UNNEST checkin_times UNNEST times : string ) EXCLUDE UNKNOWN KEY;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-4/use-case-4.02.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-4/use-case-4.02.update.sqlpp
new file mode 100644
index 0000000..0360912
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-4/use-case-4.02.update.sqlpp
@@ -0,0 +1,425 @@
+/*
+ * 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 TestYelp;
+
+INSERT INTO YelpCheckin (
+ [
+ {
+ "business_id": "--1UhMGODdWsrMastO9DZw",
+ "checkin_times": [
+ {
+ "dates": ["2016-04-26", "2016-08-30", "2016-10-15", "2016-11-18"],
+ "times": ["19:49:16", "18:36:57", "02:45:18", "01:54:50"]
+ },
+ {
+ "dates": ["2017-04-20", "2017-05-03"],
+ "times": ["18:39:06", "17:58:02"]
+ },
+ {
+ "dates": ["2019-03-19"],
+ "times": ["22:04:48"]
+ }
+ ]
+ },
+ {
+ "business_id": "--EF5N7P70J_UYBTPypYlA",
+ "checkin_times": [
+ {
+ "dates": ["2018-05-25", "2018-09-18"],
+ "times": ["19:52:07", "16:09:44"]
+ },
+ {
+ "dates": ["2019-10-18"],
+ "times": ["21:29:09"]
+ }
+ ]
+ },
+ {
+ "business_id": "--Ni3oJ4VOqfOEu7Sj2Vzg",
+ "checkin_times": [
+ {
+ "dates": ["2019-06-07"],
+ "times": ["17:54:58"]
+ }
+ ]
+ },
+ {
+ "business_id": "--Y1Adl1YUWfYIRSd8vkmA",
+ "checkin_times": [
+ {
+ "dates": ["2011-05-03", "2011-08-23"],
+ "times": ["20:54:05", "20:49:45"]
+ },
+ {
+ "dates": ["2014-12-04"],
+ "times": ["06:13:01"]
+ },
+ {
+ "dates": ["2016-11-16"],
+ "times": ["19:25:55"]
+ }
+ ]
+ },
+ {
+ "business_id": "--YPwqIlRJrhHkJcjY3eiA",
+ "checkin_times": [
+ {
+ "dates": ["2016-06-18", "2016-10-15"],
+ "times": ["21:35:45", "18:17:51"]
+ }
+ ]
+ },
+ {
+ "business_id": "--e8PjCNhEz32pprnPhCwQ",
+ "checkin_times": [
+ {
+ "dates": ["2015-04-02"],
+ "times": ["21:45:17"]
+ }
+ ]
+ },
+ {
+ "business_id": "--kinfHwmtdjz03g8B8z8Q",
+ "checkin_times": [
+ {
+ "dates": ["2014-08-27"],
+ "times": ["17:49:18"]
+ },
+ {
+ "dates": ["2015-12-19"],
+ "times": ["21:30:31"]
+ },
+ {
+ "dates": ["2018-11-27"],
+ "times": ["15:53:50"]
+ }
+ ]
+ },
+ {
+ "business_id": "--q6datkI-f0EoVheXNEeQ",
+ "checkin_times": [
+ {
+ "dates": ["2014-01-28", "2014-11-16"],
+ "times": ["20:56:04", "16:11:58"]
+ },
+ {
+ "dates": ["2015-11-15", "2015-11-15"],
+ "times": ["19:21:53", "19:33:39"]
+ }
+ ]
+ },
+ {
+ "business_id": "--qvQS4MigHPykD2GV0-zw",
+ "checkin_times": [
+ {
+ "dates": ["2019-04-11"],
+ "times": ["18:30:12"]
+ }
+ ]
+ },
+ {
+ "business_id": "--wIGbLEhlpl_UeAIyDmZQ",
+ "checkin_times": [
+ {
+ "dates": ["2015-06-06"],
+ "times": ["20:01:06"]
+ },
+ {
+ "dates": ["2019-03-14"],
+ "times": ["22:01:52"]
+ }
+ ]
+ },
+ {
+ "business_id": "-0FA-Qdi3SPYIoJz9UQw-A",
+ "checkin_times": [
+ {
+ "dates": ["2018-09-29", "2018-10-20", "2018-10-20"],
+ "times": ["18:55:17", "16:48:05", "22:20:24"]
+ }
+ ]
+ },
+ {
+ "business_id": "-0Hj1hb_XW6ybWq2M7QhGA",
+ "checkin_times": [
+ {
+ "dates": ["2011-04-23"],
+ "times": ["21:11:22"]
+ },
+ {
+ "dates": ["2014-05-04", "2014-05-11", "2014-06-04"],
+ "times": ["19:42:48", "19:16:08", "19:14:18"]
+ },
+ {
+ "dates": ["2015-12-05"],
+ "times": ["19:22:42"]
+ },
+ {
+ "dates": ["2017-05-15"],
+ "times": ["23:19:00"]
+ }
+ ]
+ },
+ {
+ "business_id": "-0KMvRFwDWdVBeTpT11iHw",
+ "checkin_times": [
+ {
+ "dates": ["2012-07-13"],
+ "times": ["21:43:57"]
+ },
+ {
+ "dates": ["2016-12-24"],
+ "times": ["02:27:31"]
+ },
+ {
+ "dates": ["2017-08-31"],
+ "times": ["00:35:26"]
+ }
+ ]
+ },
+ {
+ "business_id": "-0LPtgJC31FWMrMv317p0Q",
+ "checkin_times": [
+ {
+ "dates": ["2013-04-13", "2013-08-19", "2013-10-04"],
+ "times": ["12:35:33", "23:35:49", "19:14:56"]
+ }
+
+ ]
+ },
+ {
+ "business_id": "-0M3o2uWBnQZwd3hmfEwuw",
+ "checkin_times": [
+ {
+ "dates": ["2016-09-10"],
+ "times": ["19:26:19"]
+ },
+ {
+ "dates": ["2018-09-08"],
+ "times": ["14:15:37"]
+ },
+ {
+ "dates": ["2019-09-13"],
+ "times": ["22:47:25"]
+ }
+ ]
+ },
+ {
+ "business_id": "-0RRiWDtfnS16AKCtfvBZg",
+ "checkin_times": [
+ {
+ "dates": ["2017-05-19", "2017-05-19", "2017-08-28", "2017-09-20", "2017-10-01", "2017-10-01", "2017-12-27"],
+ "times": ["14:30:16", "14:30:25", "15:49:37", "20:19:51", "16:31:05", "16:56:27", "23:33:20"]
+ }
+ ]
+ },
+ {
+ "business_id": "-0Soj75v-XoRcf2ERr8Bmg",
+ "checkin_times": [
+ {
+ "dates": ["2019-06-05"],
+ "times": ["18:22:49"]
+ }
+ ]
+ },
+ {
+ "business_id": "-0ZumLlFjMh4ZW1z2nXGug",
+ "checkin_times": [
+ {
+ "dates": ["2011-09-24"],
+ "times": ["21:37:32"]
+ },
+ {
+ "dates": ["2014-03-10"],
+ "times": ["20:20:07"]
+ },
+ {
+ "dates": ["2015-05-27", "2015-08-29"],
+ "times": ["00:40:24", "17:58:15"]
+ },
+ {
+ "dates": ["2018-03-16"],
+ "times": ["15:03:26"]
+ }
+ ]
+ },
+ {
+ "business_id": "-0aOudcaAyac0VJbMX-L1g",
+ "checkin_times": [
+ {
+ "dates": ["2015-03-16", "2015-12-21"],
+ "times": ["23:51:16", "04:48:01"]
+ },
+ {
+ "dates": ["2016-10-28", "2016-10-28"],
+ "times": ["20:22:42", "20:23:00"]
+ }
+ ]
+ },
+ {
+ "business_id": "-0b86isaXMY0v4g-V8GZ9Q",
+ "checkin_times": [
+ {
+ "dates": ["2013-10-22"],
+ "times": ["16:49:21"]
+ },
+ {
+ "dates": ["2014-11-21"],
+ "times": ["17:39:24"]
+ }
+ ]
+ },
+ {
+ "business_id": "-0d-BfFSU0bwLcnMaGRxYw",
+ "checkin_times": [
+ {
+ "dates": ["2014-08-07", "2014-09-16", "2014-10-12"],
+ "times": ["18:30:48", "20:41:45", "23:22:27"]
+ },
+ {
+ "dates": ["2015-07-21", "2015-07-21"],
+ "times": ["20:43:56", "20:45:07"]
+ }
+ ]
+ },
+ {
+ "business_id": "-0jz6c3C6i7RG7Ag22K-Pg",
+ "checkin_times": [
+ {
+ "dates": ["2015-05-02", "2015-05-06", "2015-09-26"],
+ "times": ["19:49:05", "03:52:18", "01:13:19"]
+ }
+
+ ]
+ },
+ {
+ "business_id": "-0y3MZU2oYP8r1ruDP1bfQ",
+ "checkin_times": [
+ {
+ "dates": ["2015-04-11", "2015-11-21"],
+ "times": ["13:14:14", "16:05:56"]
+ },
+ {
+ "dates": ["2016-05-06"],
+ "times": ["14:10:04"]
+ },
+ {
+ "dates": ["2017-08-09", "2017-10-21"],
+ "times": ["15:15:10", "15:12:56"]
+ }
+ ]
+ },
+ {
+ "business_id": "-1BPe8UjF2_l3nVk-DFUjA",
+ "checkin_times": [
+ {
+ "dates": ["2015-12-03"],
+ "times": ["18:44:00"]
+ },
+ {
+ "dates": ["2016-03-17", "2016-11-02"],
+ "times": ["18:19:21", "15:58:38"]
+ }
+ ]
+ },
+ {
+ "business_id": "-1E2CQu_38mkghvmZgCCRw",
+ "checkin_times": [
+ {
+ "dates": ["2019-04-04"],
+ "times": ["22:02:37"]
+ }
+ ]
+ },
+ {
+ "business_id": "-1wzk43IZ5D9Ysu6kzb5xA",
+ "checkin_times": [
+ {
+ "dates": ["2019-02-27"],
+ "times": ["14:03:08"]
+ }
+ ]
+ },
+ {
+ "business_id": "-23R9P2eG7VTc6DVLjFKzA",
+ "checkin_times": [
+ {
+ "dates": ["2011-12-21"],
+ "times": ["19:02:51"]
+ },
+ {
+ "dates": ["2012-04-15", "2012-04-15"],
+ "times": ["04:21:39", "14:23:56"]
+ },
+ {
+ "dates": ["2013-06-30", "2013-10-04"],
+ "times": ["22:39:51", "20:34:13"]
+ },
+ {
+ "dates": ["2014-07-16"],
+ "times": ["02:28:40"]
+ }
+ ]
+ },
+ {
+ "business_id": "-26MGfikhJiTfCI-GqmzhQ",
+ "checkin_times": [
+ {
+ "dates": ["2018-06-13"],
+ "times": ["20:16:07"]
+ }
+ ]
+ },
+ {
+ "business_id": "-2bLuJsMZ0WhI9daurVQNQ",
+ "checkin_times": [
+ {
+ "dates": ["2015-05-29", "2015-06-01"],
+ "times": ["16:46:17", "15:03:53"]
+ }
+ ]
+ },
+ {
+ "business_id": "-2hDBMaza_ldqnZdiU06LQ",
+ "checkin_times": [
+ {
+ "dates": ["2011-10-08"],
+ "times": ["12:02:23"]
+ },
+ {
+ "dates": ["2014-08-18"],
+ "times": ["02:11:11"]
+ },
+ {
+ "dates": ["2016-01-07", "2016-10-21", "2016-12-01", "2016-12-29"],
+ "times": ["05:27:51", "20:15:55", "03:57:10", "01:54:42"]
+ },
+ {
+ "dates": ["2018-07-22", "2018-09-07"],
+ "times": ["19:55:31", "01:42:54"]
+ },
+ {
+ "dates": ["2019-03-08"],
+ "times": ["03:41:06"]
+ }
+ ]
+ }
+ ]
+);
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-4/use-case-4.03.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-4/use-case-4.03.query.sqlpp
new file mode 100644
index 0000000..3406a35
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-4/use-case-4.03.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.
+ */
+SET `compiler.arrayindex` "true";
+
+USE TestYelp;
+
+SELECT COUNT(*)
+FROM YelpCheckin C, C.checkin_times CT, CT.dates D
+WHERE D > " ";
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-4/use-case-4.04.get.http b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-4/use-case-4.04.get.http
new file mode 100644
index 0000000..a55ce93
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-4/use-case-4.04.get.http
@@ -0,0 +1,19 @@
+/*
+ * 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.
+ */
+/connector?dataverseName=TestYelp&datasetName=YelpCheckin
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-4/use-case-4.05.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-4/use-case-4.05.query.sqlpp
new file mode 100644
index 0000000..3406a35
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-4/use-case-4.05.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.
+ */
+SET `compiler.arrayindex` "true";
+
+USE TestYelp;
+
+SELECT COUNT(*)
+FROM YelpCheckin C, C.checkin_times CT, CT.dates D
+WHERE D > " ";
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-4/use-case-4.06.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-4/use-case-4.06.update.sqlpp
new file mode 100644
index 0000000..ea1dba3
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-4/use-case-4.06.update.sqlpp
@@ -0,0 +1,23 @@
+/*
+ * 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 TestYelp;
+
+DELETE FROM YelpCheckin C
+WHERE C.business_id != "--1UhMGODdWsrMastO9DZw";
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-4/use-case-4.07.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-4/use-case-4.07.query.sqlpp
new file mode 100644
index 0000000..3406a35
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-4/use-case-4.07.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.
+ */
+SET `compiler.arrayindex` "true";
+
+USE TestYelp;
+
+SELECT COUNT(*)
+FROM YelpCheckin C, C.checkin_times CT, CT.dates D
+WHERE D > " ";
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-4/use-case-4.08.get.http b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-4/use-case-4.08.get.http
new file mode 100644
index 0000000..a55ce93
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-4/use-case-4.08.get.http
@@ -0,0 +1,19 @@
+/*
+ * 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.
+ */
+/connector?dataverseName=TestYelp&datasetName=YelpCheckin
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-4/use-case-4.09.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-4/use-case-4.09.query.sqlpp
new file mode 100644
index 0000000..3406a35
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-4/use-case-4.09.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.
+ */
+SET `compiler.arrayindex` "true";
+
+USE TestYelp;
+
+SELECT COUNT(*)
+FROM YelpCheckin C, C.checkin_times CT, CT.dates D
+WHERE D > " ";
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-4/use-case-4.10.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-4/use-case-4.10.update.sqlpp
new file mode 100644
index 0000000..b5b6c72
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-4/use-case-4.10.update.sqlpp
@@ -0,0 +1,425 @@
+/*
+ * 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 TestYelp;
+
+UPSERT INTO YelpCheckin (
+ [
+ {
+ "business_id": "--1UhMGODdWsrMastO9DZw",
+ "checkin_times": [
+ {
+ "dates": ["2016-04-26", "2016-08-30", "2016-10-15", "2016-11-18"],
+ "times": ["19:49:16", "18:36:57", "02:45:18", "01:54:50"]
+ },
+ {
+ "dates": ["2017-04-20", "2017-05-03"],
+ "times": ["18:39:06", "17:58:02"]
+ },
+ {
+ "dates": ["2019-03-19"],
+ "times": ["22:04:48"]
+ }
+ ]
+ },
+ {
+ "business_id": "--EF5N7P70J_UYBTPypYlA",
+ "checkin_times": [
+ {
+ "dates": ["2018-05-25", "2018-09-18"],
+ "times": ["19:52:07", "16:09:44"]
+ },
+ {
+ "dates": ["2019-10-18"],
+ "times": ["21:29:09"]
+ }
+ ]
+ },
+ {
+ "business_id": "--Ni3oJ4VOqfOEu7Sj2Vzg",
+ "checkin_times": [
+ {
+ "dates": ["2019-06-07"],
+ "times": ["17:54:58"]
+ }
+ ]
+ },
+ {
+ "business_id": "--Y1Adl1YUWfYIRSd8vkmA",
+ "checkin_times": [
+ {
+ "dates": ["2011-05-03", "2011-08-23"],
+ "times": ["20:54:05", "20:49:45"]
+ },
+ {
+ "dates": ["2014-12-04"],
+ "times": ["06:13:01"]
+ },
+ {
+ "dates": ["2016-11-16"],
+ "times": ["19:25:55"]
+ }
+ ]
+ },
+ {
+ "business_id": "--YPwqIlRJrhHkJcjY3eiA",
+ "checkin_times": [
+ {
+ "dates": ["2016-06-18", "2016-10-15"],
+ "times": ["21:35:45", "18:17:51"]
+ }
+ ]
+ },
+ {
+ "business_id": "--e8PjCNhEz32pprnPhCwQ",
+ "checkin_times": [
+ {
+ "dates": ["2015-04-02"],
+ "times": ["21:45:17"]
+ }
+ ]
+ },
+ {
+ "business_id": "--kinfHwmtdjz03g8B8z8Q",
+ "checkin_times": [
+ {
+ "dates": ["2014-08-27"],
+ "times": ["17:49:18"]
+ },
+ {
+ "dates": ["2015-12-19"],
+ "times": ["21:30:31"]
+ },
+ {
+ "dates": ["2018-11-27"],
+ "times": ["15:53:50"]
+ }
+ ]
+ },
+ {
+ "business_id": "--q6datkI-f0EoVheXNEeQ",
+ "checkin_times": [
+ {
+ "dates": ["2014-01-28", "2014-11-16"],
+ "times": ["20:56:04", "16:11:58"]
+ },
+ {
+ "dates": ["2015-11-15", "2015-11-15"],
+ "times": ["19:21:53", "19:33:39"]
+ }
+ ]
+ },
+ {
+ "business_id": "--qvQS4MigHPykD2GV0-zw",
+ "checkin_times": [
+ {
+ "dates": ["2019-04-11"],
+ "times": ["18:30:12"]
+ }
+ ]
+ },
+ {
+ "business_id": "--wIGbLEhlpl_UeAIyDmZQ",
+ "checkin_times": [
+ {
+ "dates": ["2015-06-06"],
+ "times": ["20:01:06"]
+ },
+ {
+ "dates": ["2019-03-14"],
+ "times": ["22:01:52"]
+ }
+ ]
+ },
+ {
+ "business_id": "-0FA-Qdi3SPYIoJz9UQw-A",
+ "checkin_times": [
+ {
+ "dates": ["2018-09-29", "2018-10-20", "2018-10-20"],
+ "times": ["18:55:17", "16:48:05", "22:20:24"]
+ }
+ ]
+ },
+ {
+ "business_id": "-0Hj1hb_XW6ybWq2M7QhGA",
+ "checkin_times": [
+ {
+ "dates": ["2011-04-23"],
+ "times": ["21:11:22"]
+ },
+ {
+ "dates": ["2014-05-04", "2014-05-11", "2014-06-04"],
+ "times": ["19:42:48", "19:16:08", "19:14:18"]
+ },
+ {
+ "dates": ["2015-12-05"],
+ "times": ["19:22:42"]
+ },
+ {
+ "dates": ["2017-05-15"],
+ "times": ["23:19:00"]
+ }
+ ]
+ },
+ {
+ "business_id": "-0KMvRFwDWdVBeTpT11iHw",
+ "checkin_times": [
+ {
+ "dates": ["2012-07-13"],
+ "times": ["21:43:57"]
+ },
+ {
+ "dates": ["2016-12-24"],
+ "times": ["02:27:31"]
+ },
+ {
+ "dates": ["2017-08-31"],
+ "times": ["00:35:26"]
+ }
+ ]
+ },
+ {
+ "business_id": "-0LPtgJC31FWMrMv317p0Q",
+ "checkin_times": [
+ {
+ "dates": ["2013-04-13", "2013-08-19", "2013-10-04"],
+ "times": ["12:35:33", "23:35:49", "19:14:56"]
+ }
+
+ ]
+ },
+ {
+ "business_id": "-0M3o2uWBnQZwd3hmfEwuw",
+ "checkin_times": [
+ {
+ "dates": ["2016-09-10"],
+ "times": ["19:26:19"]
+ },
+ {
+ "dates": ["2018-09-08"],
+ "times": ["14:15:37"]
+ },
+ {
+ "dates": ["2019-09-13"],
+ "times": ["22:47:25"]
+ }
+ ]
+ },
+ {
+ "business_id": "-0RRiWDtfnS16AKCtfvBZg",
+ "checkin_times": [
+ {
+ "dates": ["2017-05-19", "2017-05-19", "2017-08-28", "2017-09-20", "2017-10-01", "2017-10-01", "2017-12-27"],
+ "times": ["14:30:16", "14:30:25", "15:49:37", "20:19:51", "16:31:05", "16:56:27", "23:33:20"]
+ }
+ ]
+ },
+ {
+ "business_id": "-0Soj75v-XoRcf2ERr8Bmg",
+ "checkin_times": [
+ {
+ "dates": ["2019-06-05"],
+ "times": ["18:22:49"]
+ }
+ ]
+ },
+ {
+ "business_id": "-0ZumLlFjMh4ZW1z2nXGug",
+ "checkin_times": [
+ {
+ "dates": ["2011-09-24"],
+ "times": ["21:37:32"]
+ },
+ {
+ "dates": ["2014-03-10"],
+ "times": ["20:20:07"]
+ },
+ {
+ "dates": ["2015-05-27", "2015-08-29"],
+ "times": ["00:40:24", "17:58:15"]
+ },
+ {
+ "dates": ["2018-03-16"],
+ "times": ["15:03:26"]
+ }
+ ]
+ },
+ {
+ "business_id": "-0aOudcaAyac0VJbMX-L1g",
+ "checkin_times": [
+ {
+ "dates": ["2015-03-16", "2015-12-21"],
+ "times": ["23:51:16", "04:48:01"]
+ },
+ {
+ "dates": ["2016-10-28", "2016-10-28"],
+ "times": ["20:22:42", "20:23:00"]
+ }
+ ]
+ },
+ {
+ "business_id": "-0b86isaXMY0v4g-V8GZ9Q",
+ "checkin_times": [
+ {
+ "dates": ["2013-10-22"],
+ "times": ["16:49:21"]
+ },
+ {
+ "dates": ["2014-11-21"],
+ "times": ["17:39:24"]
+ }
+ ]
+ },
+ {
+ "business_id": "-0d-BfFSU0bwLcnMaGRxYw",
+ "checkin_times": [
+ {
+ "dates": ["2014-08-07", "2014-09-16", "2014-10-12"],
+ "times": ["18:30:48", "20:41:45", "23:22:27"]
+ },
+ {
+ "dates": ["2015-07-21", "2015-07-21"],
+ "times": ["20:43:56", "20:45:07"]
+ }
+ ]
+ },
+ {
+ "business_id": "-0jz6c3C6i7RG7Ag22K-Pg",
+ "checkin_times": [
+ {
+ "dates": ["2015-05-02", "2015-05-06", "2015-09-26"],
+ "times": ["19:49:05", "03:52:18", "01:13:19"]
+ }
+
+ ]
+ },
+ {
+ "business_id": "-0y3MZU2oYP8r1ruDP1bfQ",
+ "checkin_times": [
+ {
+ "dates": ["2015-04-11", "2015-11-21"],
+ "times": ["13:14:14", "16:05:56"]
+ },
+ {
+ "dates": ["2016-05-06"],
+ "times": ["14:10:04"]
+ },
+ {
+ "dates": ["2017-08-09", "2017-10-21"],
+ "times": ["15:15:10", "15:12:56"]
+ }
+ ]
+ },
+ {
+ "business_id": "-1BPe8UjF2_l3nVk-DFUjA",
+ "checkin_times": [
+ {
+ "dates": ["2015-12-03"],
+ "times": ["18:44:00"]
+ },
+ {
+ "dates": ["2016-03-17", "2016-11-02"],
+ "times": ["18:19:21", "15:58:38"]
+ }
+ ]
+ },
+ {
+ "business_id": "-1E2CQu_38mkghvmZgCCRw",
+ "checkin_times": [
+ {
+ "dates": ["2019-04-04"],
+ "times": ["22:02:37"]
+ }
+ ]
+ },
+ {
+ "business_id": "-1wzk43IZ5D9Ysu6kzb5xA",
+ "checkin_times": [
+ {
+ "dates": ["2019-02-27"],
+ "times": ["14:03:08"]
+ }
+ ]
+ },
+ {
+ "business_id": "-23R9P2eG7VTc6DVLjFKzA",
+ "checkin_times": [
+ {
+ "dates": ["2011-12-21"],
+ "times": ["19:02:51"]
+ },
+ {
+ "dates": ["2012-04-15", "2012-04-15"],
+ "times": ["04:21:39", "14:23:56"]
+ },
+ {
+ "dates": ["2013-06-30", "2013-10-04"],
+ "times": ["22:39:51", "20:34:13"]
+ },
+ {
+ "dates": ["2014-07-16"],
+ "times": ["02:28:40"]
+ }
+ ]
+ },
+ {
+ "business_id": "-26MGfikhJiTfCI-GqmzhQ",
+ "checkin_times": [
+ {
+ "dates": ["2018-06-13"],
+ "times": ["20:16:07"]
+ }
+ ]
+ },
+ {
+ "business_id": "-2bLuJsMZ0WhI9daurVQNQ",
+ "checkin_times": [
+ {
+ "dates": ["2015-05-29", "2015-06-01"],
+ "times": ["16:46:17", "15:03:53"]
+ }
+ ]
+ },
+ {
+ "business_id": "-2hDBMaza_ldqnZdiU06LQ",
+ "checkin_times": [
+ {
+ "dates": ["2011-10-08"],
+ "times": ["12:02:23"]
+ },
+ {
+ "dates": ["2014-08-18"],
+ "times": ["02:11:11"]
+ },
+ {
+ "dates": ["2016-01-07", "2016-10-21", "2016-12-01", "2016-12-29"],
+ "times": ["05:27:51", "20:15:55", "03:57:10", "01:54:42"]
+ },
+ {
+ "dates": ["2018-07-22", "2018-09-07"],
+ "times": ["19:55:31", "01:42:54"]
+ },
+ {
+ "dates": ["2019-03-08"],
+ "times": ["03:41:06"]
+ }
+ ]
+ }
+ ]
+);
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-4/use-case-4.11.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-4/use-case-4.11.query.sqlpp
new file mode 100644
index 0000000..3406a35
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-4/use-case-4.11.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.
+ */
+SET `compiler.arrayindex` "true";
+
+USE TestYelp;
+
+SELECT COUNT(*)
+FROM YelpCheckin C, C.checkin_times CT, CT.dates D
+WHERE D > " ";
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-4/use-case-4.12.get.http b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-4/use-case-4.12.get.http
new file mode 100644
index 0000000..a55ce93
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-4/use-case-4.12.get.http
@@ -0,0 +1,19 @@
+/*
+ * 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.
+ */
+/connector?dataverseName=TestYelp&datasetName=YelpCheckin
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-4/use-case-4.13.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-4/use-case-4.13.query.sqlpp
new file mode 100644
index 0000000..3406a35
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/use-case-4/use-case-4.13.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.
+ */
+SET `compiler.arrayindex` "true";
+
+USE TestYelp;
+
+SELECT COUNT(*)
+FROM YelpCheckin C, C.checkin_times CT, CT.dates D
+WHERE D > " ";
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.01.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.01.ddl.sqlpp
new file mode 100644
index 0000000..6a0d41d
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.01.ddl.sqlpp
@@ -0,0 +1,40 @@
+/*
+ * 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: Verify the following DML actions for an array->atomic index, with an additional atomic index:
+ * 1) Insert into an empty index (non bulk-load operation), additionally with two records that have no array-index qualifying entries.
+ * 2) Delete all-but-one entry from the index.
+ * 3) Upsert all *original* (all records have qualifying array-index entries now) entries into the index.
+ */
+
+DROP DATAVERSE TestYelp IF EXISTS;
+CREATE DATAVERSE TestYelp;
+USE TestYelp;
+
+CREATE TYPE CheckinType AS {
+ checkin_id: int
+};
+
+CREATE DATASET YelpCheckin(CheckinType) PRIMARY KEY checkin_id WITH {
+ "storage-format" : {"format" : "column"}
+};
+
+CREATE INDEX IdxYelpCheckinDates ON YelpCheckin (UNNEST dates : string ) EXCLUDE UNKNOWN KEY;
+CREATE INDEX IdxYelpCheckinBusinessID ON YelpCheckin (business_id : string ?);
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.02.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.02.update.sqlpp
new file mode 100644
index 0000000..8ee1570
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.02.update.sqlpp
@@ -0,0 +1,302 @@
+/*
+ * 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 TestYelp;
+
+INSERT INTO YelpCheckin (
+ [
+ {
+ "checkin_id": 1,
+ "business_id": "--1UhMGODdWsrMastO9DZw",
+ "dates": [
+ "2016-04-26 19:49:16",
+ "2016-08-30 18:36:57",
+ "2016-10-15 02:45:18",
+ "2016-11-18 01:54:50",
+ "2017-04-20 18:39:06",
+ "2017-05-03 17:58:02",
+ "2019-03-19 22:04:48"
+ ]
+ },
+ {
+ "checkin_id": 2,
+ "business_id": "--EF5N7P70J_UYBTPypYlA",
+ "dates": [
+ "2018-05-25 19:52:07",
+ "2018-09-18 16:09:44",
+ "2019-10-18 21:29:09"
+ ]
+ },
+ {
+ "checkin_id": 3,
+ "business_id": "--Ni3oJ4VOqfOEu7Sj2Vzg",
+ "dates": [
+ "2019-06-07 17:54:58"
+ ]
+ },
+ {
+ "checkin_id": 4,
+ "business_id": "--Y1Adl1YUWfYIRSd8vkmA",
+ "dates": [
+ "2011-05-03 20:54:05",
+ "2011-08-23 20:49:45",
+ "2014-12-04 06:13:01",
+ "2016-11-16 19:25:55"
+ ]
+ },
+ {
+ "checkin_id": 5,
+ "business_id": "--YPwqIlRJrhHkJcjY3eiA",
+ "dates": [
+ "2016-06-18 21:35:45",
+ "2016-10-15 18:17:51"
+ ]
+ },
+ {
+ "checkin_id": 6,
+ "business_id": "--e8PjCNhEz32pprnPhCwQ",
+ "dates": [
+ "2015-04-02 21:45:17"
+ ]
+ },
+ {
+ "checkin_id": 7,
+ "business_id": "--kinfHwmtdjz03g8B8z8Q",
+ "dates": [
+ "2014-08-27 17:49:18",
+ "2015-12-19 21:30:31",
+ "2018-11-27 15:53:50"
+ ]
+ },
+ {
+ "checkin_id": 8,
+ "business_id": "--q6datkI-f0EoVheXNEeQ",
+ "dates": [
+ "2014-01-28 20:56:04",
+ "2014-11-16 16:11:58",
+ "2015-11-15 19:21:53",
+ "2015-11-15 19:33:39"
+ ]
+ },
+ {
+ "checkin_id": 9,
+ "business_id": "--qvQS4MigHPykD2GV0-zw",
+ "dates": [
+ "2019-04-11 18:30:12"
+ ]
+ },
+ {
+ "checkin_id": 10,
+ "business_id": "--wIGbLEhlpl_UeAIyDmZQ",
+ "dates": [
+ "2015-06-06 20:01:06",
+ "2019-03-14 22:01:52"
+ ]
+ },
+ {
+ "checkin_id": 11,
+ "business_id": "-0FA-Qdi3SPYIoJz9UQw-A",
+ "dates": [
+ "2018-09-29 18:55:17",
+ "2018-10-20 16:48:05",
+ "2018-10-20 22:20:24"
+ ]
+ },
+ {
+ "checkin_id": 12,
+ "business_id": "-0Hj1hb_XW6ybWq2M7QhGA",
+ "dates": [
+ "2011-04-23 21:11:22",
+ "2014-05-04 19:42:48",
+ "2014-05-11 19:16:08",
+ "2014-06-04 19:14:18",
+ "2015-12-05 19:22:42",
+ "2017-05-15 23:19:00"
+ ]
+ },
+ {
+ "checkin_id": 13,
+ "business_id": "-0KMvRFwDWdVBeTpT11iHw",
+ "dates": [
+ "2012-07-13 21:43:57",
+ "2016-12-24 02:27:31",
+ "2017-08-31 00:35:26"
+ ]
+ },
+ {
+ "checkin_id": 14,
+ "business_id": "-0LPtgJC31FWMrMv317p0Q",
+ "dates": [
+ "2013-04-13 12:35:33",
+ "2013-08-19 23:35:49",
+ "2013-10-04 19:14:56"
+ ]
+ },
+ {
+ "checkin_id": 15,
+ "business_id": "-0M3o2uWBnQZwd3hmfEwuw",
+ "dates": [
+ "2016-09-10 19:26:19",
+ "2018-09-08 14:15:37",
+ "2019-09-13 22:47:25"
+ ]
+ },
+ {
+ "checkin_id": 16,
+ "business_id": "-0RRiWDtfnS16AKCtfvBZg",
+ "dates": [
+ "2017-05-19 14:30:16",
+ "2017-05-19 14:30:25",
+ "2017-08-28 15:49:37",
+ "2017-09-20 20:19:51",
+ "2017-10-01 16:31:05",
+ "2017-10-01 16:56:27",
+ "2017-12-27 23:33:20"
+ ]
+ },
+ {
+ "checkin_id": 17,
+ "business_id": "-0Soj75v-XoRcf2ERr8Bmg",
+ "dates": [
+ "2019-06-05 18:22:49"
+ ]
+ },
+ {
+ "checkin_id": 18,
+ "business_id": "-0ZumLlFjMh4ZW1z2nXGug",
+ "dates": [
+ "2011-09-24 21:37:32",
+ "2014-03-10 20:20:07",
+ "2015-05-27 00:40:24",
+ "2015-08-29 17:58:15",
+ "2018-03-16 15:03:26"
+ ]
+ },
+ {
+ "checkin_id": 19,
+ "business_id": "-0aOudcaAyac0VJbMX-L1g",
+ "dates": [
+ "2015-03-16 23:51:16",
+ "2015-12-21 04:48:01",
+ "2016-10-28 20:22:42",
+ "2016-10-28 20:23:00"
+ ]
+ },
+ {
+ "checkin_id": 20,
+ "business_id": "-0b86isaXMY0v4g-V8GZ9Q",
+ "dates": [
+ "2013-10-22 16:49:21",
+ "2014-11-21 17:39:24"
+ ]
+ },
+ {
+ "checkin_id": 21,
+ "business_id": "-0d-BfFSU0bwLcnMaGRxYw",
+ "dates": [
+ "2014-08-07 18:30:48",
+ "2014-09-16 20:41:45",
+ "2014-10-12 23:22:27",
+ "2015-07-21 20:43:56",
+ "2015-07-21 20:45:07"
+ ]
+ },
+ {
+ "checkin_id": 22,
+ "business_id": "-0jz6c3C6i7RG7Ag22K-Pg",
+ "dates": [
+ "2015-05-02 19:49:05",
+ "2015-05-06 03:52:18",
+ "2015-09-26 01:13:19"
+ ]
+ },
+ {
+ "checkin_id": 23,
+ "business_id": "-0y3MZU2oYP8r1ruDP1bfQ",
+ "dates": [
+ "2015-04-11 13:14:14",
+ "2015-11-21 16:05:56",
+ "2016-05-06 14:10:04",
+ "2017-08-09 15:15:10",
+ "2017-10-21 15:12:56"
+ ]
+ },
+ {
+ "checkin_id": 24,
+ "business_id": "-1BPe8UjF2_l3nVk-DFUjA",
+ "dates": [
+ "2015-12-03 18:44:00",
+ "2016-03-17 18:19:21",
+ "2016-11-02 15:58:38"
+ ]
+ },
+ {
+ "checkin_id": 25,
+ "business_id": "-1E2CQu_38mkghvmZgCCRw",
+ "dates": []
+ },
+ {
+ "checkin_id": 26,
+ "business_id": "-1wzk43IZ5D9Ysu6kzb5xA",
+ "dates": []
+ },
+ {
+ "checkin_id": 27,
+ "business_id": "-23R9P2eG7VTc6DVLjFKzA",
+ "dates": [
+ "2011-12-21 19:02:51",
+ "2012-04-15 04:21:39",
+ "2012-04-15 14:23:56",
+ "2013-06-30 22:39:51",
+ "2013-10-04 20:34:13",
+ "2014-07-16 02:28:40"
+ ]
+ },
+ {
+ "checkin_id": 28,
+ "business_id": "-26MGfikhJiTfCI-GqmzhQ",
+ "dates": [
+ "2018-06-13 20:16:07"
+ ]
+ },
+ {
+ "checkin_id": 29,
+ "business_id": "-2bLuJsMZ0WhI9daurVQNQ",
+ "dates": [
+ "2015-05-29 16:46:17",
+ "2015-06-01 15:03:53"
+ ]
+ },
+ {
+ "checkin_id": 30,
+ "business_id": "-2hDBMaza_ldqnZdiU06LQ",
+ "dates": [
+ "2011-10-08 12:02:23",
+ "2014-08-18 02:11:11",
+ "2016-01-07 05:27:51",
+ "2016-10-21 20:15:55",
+ "2016-12-01 03:57:10",
+ "2016-12-29 01:54:42",
+ "2018-07-22 19:55:31",
+ "2018-09-07 01:42:54",
+ "2019-03-08 03:41:06"
+ ]
+ }
+ ]
+);
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.03.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.03.query.sqlpp
new file mode 100644
index 0000000..69fe7cc
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.03.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.
+ */
+SET `compiler.arrayindex` "true";
+
+USE TestYelp;
+
+SELECT COUNT(*)
+FROM YelpCheckin C, C.dates D
+WHERE D > " ";
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.04.get.http b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.04.get.http
new file mode 100644
index 0000000..a55ce93
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.04.get.http
@@ -0,0 +1,19 @@
+/*
+ * 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.
+ */
+/connector?dataverseName=TestYelp&datasetName=YelpCheckin
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.05.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.05.query.sqlpp
new file mode 100644
index 0000000..69fe7cc
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.05.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.
+ */
+SET `compiler.arrayindex` "true";
+
+USE TestYelp;
+
+SELECT COUNT(*)
+FROM YelpCheckin C, C.dates D
+WHERE D > " ";
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.06.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.06.update.sqlpp
new file mode 100644
index 0000000..ea1dba3
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.06.update.sqlpp
@@ -0,0 +1,23 @@
+/*
+ * 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 TestYelp;
+
+DELETE FROM YelpCheckin C
+WHERE C.business_id != "--1UhMGODdWsrMastO9DZw";
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.07.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.07.query.sqlpp
new file mode 100644
index 0000000..69fe7cc
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.07.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.
+ */
+SET `compiler.arrayindex` "true";
+
+USE TestYelp;
+
+SELECT COUNT(*)
+FROM YelpCheckin C, C.dates D
+WHERE D > " ";
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.08.get.http b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.08.get.http
new file mode 100644
index 0000000..a55ce93
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.08.get.http
@@ -0,0 +1,19 @@
+/*
+ * 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.
+ */
+/connector?dataverseName=TestYelp&datasetName=YelpCheckin
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.09.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.09.query.sqlpp
new file mode 100644
index 0000000..69fe7cc
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.09.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.
+ */
+SET `compiler.arrayindex` "true";
+
+USE TestYelp;
+
+SELECT COUNT(*)
+FROM YelpCheckin C, C.dates D
+WHERE D > " ";
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.10.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.10.update.sqlpp
new file mode 100644
index 0000000..965ccc8
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.10.update.sqlpp
@@ -0,0 +1,306 @@
+/*
+ * 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 TestYelp;
+
+UPSERT INTO YelpCheckin (
+ [
+ {
+ "checkin_id": 1,
+ "business_id": "--1UhMGODdWsrMastO9DZw",
+ "dates": [
+ "2016-04-26 19:49:16",
+ "2016-08-30 18:36:57",
+ "2016-10-15 02:45:18",
+ "2016-11-18 01:54:50",
+ "2017-04-20 18:39:06",
+ "2017-05-03 17:58:02",
+ "2019-03-19 22:04:48"
+ ]
+ },
+ {
+ "checkin_id": 2,
+ "business_id": "--EF5N7P70J_UYBTPypYlA",
+ "dates": [
+ "2018-05-25 19:52:07",
+ "2018-09-18 16:09:44",
+ "2019-10-18 21:29:09"
+ ]
+ },
+ {
+ "checkin_id": 3,
+ "business_id": "--Ni3oJ4VOqfOEu7Sj2Vzg",
+ "dates": [
+ "2019-06-07 17:54:58"
+ ]
+ },
+ {
+ "checkin_id": 4,
+ "business_id": "--Y1Adl1YUWfYIRSd8vkmA",
+ "dates": [
+ "2011-05-03 20:54:05",
+ "2011-08-23 20:49:45",
+ "2014-12-04 06:13:01",
+ "2016-11-16 19:25:55"
+ ]
+ },
+ {
+ "checkin_id": 5,
+ "business_id": "--YPwqIlRJrhHkJcjY3eiA",
+ "dates": [
+ "2016-06-18 21:35:45",
+ "2016-10-15 18:17:51"
+ ]
+ },
+ {
+ "checkin_id": 6,
+ "business_id": "--e8PjCNhEz32pprnPhCwQ",
+ "dates": [
+ "2015-04-02 21:45:17"
+ ]
+ },
+ {
+ "checkin_id": 7,
+ "business_id": "--kinfHwmtdjz03g8B8z8Q",
+ "dates": [
+ "2014-08-27 17:49:18",
+ "2015-12-19 21:30:31",
+ "2018-11-27 15:53:50"
+ ]
+ },
+ {
+ "checkin_id": 8,
+ "business_id": "--q6datkI-f0EoVheXNEeQ",
+ "dates": [
+ "2014-01-28 20:56:04",
+ "2014-11-16 16:11:58",
+ "2015-11-15 19:21:53",
+ "2015-11-15 19:33:39"
+ ]
+ },
+ {
+ "checkin_id": 9,
+ "business_id": "--qvQS4MigHPykD2GV0-zw",
+ "dates": [
+ "2019-04-11 18:30:12"
+ ]
+ },
+ {
+ "checkin_id": 10,
+ "business_id": "--wIGbLEhlpl_UeAIyDmZQ",
+ "dates": [
+ "2015-06-06 20:01:06",
+ "2019-03-14 22:01:52"
+ ]
+ },
+ {
+ "checkin_id": 11,
+ "business_id": "-0FA-Qdi3SPYIoJz9UQw-A",
+ "dates": [
+ "2018-09-29 18:55:17",
+ "2018-10-20 16:48:05",
+ "2018-10-20 22:20:24"
+ ]
+ },
+ {
+ "checkin_id": 12,
+ "business_id": "-0Hj1hb_XW6ybWq2M7QhGA",
+ "dates": [
+ "2011-04-23 21:11:22",
+ "2014-05-04 19:42:48",
+ "2014-05-11 19:16:08",
+ "2014-06-04 19:14:18",
+ "2015-12-05 19:22:42",
+ "2017-05-15 23:19:00"
+ ]
+ },
+ {
+ "checkin_id": 13,
+ "business_id": "-0KMvRFwDWdVBeTpT11iHw",
+ "dates": [
+ "2012-07-13 21:43:57",
+ "2016-12-24 02:27:31",
+ "2017-08-31 00:35:26"
+ ]
+ },
+ {
+ "checkin_id": 14,
+ "business_id": "-0LPtgJC31FWMrMv317p0Q",
+ "dates": [
+ "2013-04-13 12:35:33",
+ "2013-08-19 23:35:49",
+ "2013-10-04 19:14:56"
+ ]
+ },
+ {
+ "checkin_id": 15,
+ "business_id": "-0M3o2uWBnQZwd3hmfEwuw",
+ "dates": [
+ "2016-09-10 19:26:19",
+ "2018-09-08 14:15:37",
+ "2019-09-13 22:47:25"
+ ]
+ },
+ {
+ "checkin_id": 16,
+ "business_id": "-0RRiWDtfnS16AKCtfvBZg",
+ "dates": [
+ "2017-05-19 14:30:16",
+ "2017-05-19 14:30:25",
+ "2017-08-28 15:49:37",
+ "2017-09-20 20:19:51",
+ "2017-10-01 16:31:05",
+ "2017-10-01 16:56:27",
+ "2017-12-27 23:33:20"
+ ]
+ },
+ {
+ "checkin_id": 17,
+ "business_id": "-0Soj75v-XoRcf2ERr8Bmg",
+ "dates": [
+ "2019-06-05 18:22:49"
+ ]
+ },
+ {
+ "checkin_id": 18,
+ "business_id": "-0ZumLlFjMh4ZW1z2nXGug",
+ "dates": [
+ "2011-09-24 21:37:32",
+ "2014-03-10 20:20:07",
+ "2015-05-27 00:40:24",
+ "2015-08-29 17:58:15",
+ "2018-03-16 15:03:26"
+ ]
+ },
+ {
+ "checkin_id": 19,
+ "business_id": "-0aOudcaAyac0VJbMX-L1g",
+ "dates": [
+ "2015-03-16 23:51:16",
+ "2015-12-21 04:48:01",
+ "2016-10-28 20:22:42",
+ "2016-10-28 20:23:00"
+ ]
+ },
+ {
+ "checkin_id": 20,
+ "business_id": "-0b86isaXMY0v4g-V8GZ9Q",
+ "dates": [
+ "2013-10-22 16:49:21",
+ "2014-11-21 17:39:24"
+ ]
+ },
+ {
+ "checkin_id": 21,
+ "business_id": "-0d-BfFSU0bwLcnMaGRxYw",
+ "dates": [
+ "2014-08-07 18:30:48",
+ "2014-09-16 20:41:45",
+ "2014-10-12 23:22:27",
+ "2015-07-21 20:43:56",
+ "2015-07-21 20:45:07"
+ ]
+ },
+ {
+ "checkin_id": 22,
+ "business_id": "-0jz6c3C6i7RG7Ag22K-Pg",
+ "dates": [
+ "2015-05-02 19:49:05",
+ "2015-05-06 03:52:18",
+ "2015-09-26 01:13:19"
+ ]
+ },
+ {
+ "checkin_id": 23,
+ "business_id": "-0y3MZU2oYP8r1ruDP1bfQ",
+ "dates": [
+ "2015-04-11 13:14:14",
+ "2015-11-21 16:05:56",
+ "2016-05-06 14:10:04",
+ "2017-08-09 15:15:10",
+ "2017-10-21 15:12:56"
+ ]
+ },
+ {
+ "checkin_id": 24,
+ "business_id": "-1BPe8UjF2_l3nVk-DFUjA",
+ "dates": [
+ "2015-12-03 18:44:00",
+ "2016-03-17 18:19:21",
+ "2016-11-02 15:58:38"
+ ]
+ },
+ {
+ "checkin_id": 25,
+ "business_id": "-1E2CQu_38mkghvmZgCCRw",
+ "dates": [
+ "2019-04-04 22:02:37"
+ ]
+ },
+ {
+ "checkin_id": 26,
+ "business_id": "-1wzk43IZ5D9Ysu6kzb5xA",
+ "dates": [
+ "2019-02-27 14:03:08"
+ ]
+ },
+ {
+ "checkin_id": 27,
+ "business_id": "-23R9P2eG7VTc6DVLjFKzA",
+ "dates": [
+ "2011-12-21 19:02:51",
+ "2012-04-15 04:21:39",
+ "2012-04-15 14:23:56",
+ "2013-06-30 22:39:51",
+ "2013-10-04 20:34:13",
+ "2014-07-16 02:28:40"
+ ]
+ },
+ {
+ "checkin_id": 28,
+ "business_id": "-26MGfikhJiTfCI-GqmzhQ",
+ "dates": [
+ "2018-06-13 20:16:07"
+ ]
+ },
+ {
+ "checkin_id": 29,
+ "business_id": "-2bLuJsMZ0WhI9daurVQNQ",
+ "dates": [
+ "2015-05-29 16:46:17",
+ "2015-06-01 15:03:53"
+ ]
+ },
+ {
+ "checkin_id": 30,
+ "business_id": "-2hDBMaza_ldqnZdiU06LQ",
+ "dates": [
+ "2011-10-08 12:02:23",
+ "2014-08-18 02:11:11",
+ "2016-01-07 05:27:51",
+ "2016-10-21 20:15:55",
+ "2016-12-01 03:57:10",
+ "2016-12-29 01:54:42",
+ "2018-07-22 19:55:31",
+ "2018-09-07 01:42:54",
+ "2019-03-08 03:41:06"
+ ]
+ }
+ ]
+);
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.11.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.11.query.sqlpp
new file mode 100644
index 0000000..69fe7cc
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.11.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.
+ */
+SET `compiler.arrayindex` "true";
+
+USE TestYelp;
+
+SELECT COUNT(*)
+FROM YelpCheckin C, C.dates D
+WHERE D > " ";
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.12.get.http b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.12.get.http
new file mode 100644
index 0000000..a55ce93
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.12.get.http
@@ -0,0 +1,19 @@
+/*
+ * 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.
+ */
+/connector?dataverseName=TestYelp&datasetName=YelpCheckin
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.13.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.13.query.sqlpp
new file mode 100644
index 0000000..69fe7cc
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.13.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.
+ */
+SET `compiler.arrayindex` "true";
+
+USE TestYelp;
+
+SELECT COUNT(*)
+FROM YelpCheckin C, C.dates D
+WHERE D > " ";
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-composite-sk/with-composite-sk.01.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-composite-sk/with-composite-sk.01.ddl.sqlpp
new file mode 100644
index 0000000..d0ae055
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-composite-sk/with-composite-sk.01.ddl.sqlpp
@@ -0,0 +1,41 @@
+/*
+ * 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: Verify the following DML actions for a composite array->atomic index:
+ * 1) Insert into an empty index (non bulk-load operation).
+ * 2) Delete all-but-one entry from the index.
+ * 3) Upsert all entries into the index.
+ */
+
+DROP DATAVERSE TestYelp IF EXISTS;
+CREATE DATAVERSE TestYelp;
+USE TestYelp;
+
+CREATE TYPE CheckinType AS {
+ checkin_id: int
+};
+
+CREATE DATASET YelpCheckin(CheckinType) PRIMARY KEY checkin_id WITH {
+ "storage-format" : {"format" : "column"}
+};
+
+CREATE INDEX IdxYelpCheckinDates
+ON YelpCheckin (UNNEST checkin_times SELECT date : string , time : string )
+EXCLUDE UNKNOWN KEY;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-composite-sk/with-composite-sk.02.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-composite-sk/with-composite-sk.02.update.sqlpp
new file mode 100644
index 0000000..2f7a9fd
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-composite-sk/with-composite-sk.02.update.sqlpp
@@ -0,0 +1,306 @@
+/*
+ * 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 TestYelp;
+
+INSERT INTO YelpCheckin (
+ [
+ {
+ "checkin_id": 1,
+ "business_id": "--1UhMGODdWsrMastO9DZw",
+ "checkin_times": [
+ {"date": "2016-04-26", "time": "19:49:16"},
+ {"date": "2016-08-30", "time": "18:36:57"},
+ {"date": "2016-10-15", "time": "02:45:18"},
+ {"date": "2016-11-18", "time": "01:54:50"},
+ {"date": "2017-04-20", "time": "18:39:06"},
+ {"date": "2017-05-03", "time": "17:58:02"},
+ {"date": "2019-03-19", "time": "22:04:48"}
+ ]
+ },
+ {
+ "checkin_id": 2,
+ "business_id": "--EF5N7P70J_UYBTPypYlA",
+ "checkin_times": [
+ {"date": "2018-05-25", "time": "19:52:07"},
+ {"date": "2018-09-18", "time": "16:09:44"},
+ {"date": "2019-10-18", "time": "21:29:09"}
+ ]
+ },
+ {
+ "checkin_id": 3,
+ "business_id": "--Ni3oJ4VOqfOEu7Sj2Vzg",
+ "checkin_times": [
+ {"date": "2019-06-07", "time": "17:54:58"}
+ ]
+ },
+ {
+ "checkin_id": 4,
+ "business_id": "--Y1Adl1YUWfYIRSd8vkmA",
+ "checkin_times": [
+ {"date": "2011-05-03", "time": "20:54:05"},
+ {"date": "2011-08-23", "time": "20:49:45"},
+ {"date": "2014-12-04", "time": "06:13:01"},
+ {"date": "2016-11-16", "time": "19:25:55"}
+ ]
+ },
+ {
+ "checkin_id": 5,
+ "business_id": "--YPwqIlRJrhHkJcjY3eiA",
+ "checkin_times": [
+ {"date": "2016-06-18", "time": "21:35:45"},
+ {"date": "2016-10-15", "time": "18:17:51"}
+ ]
+ },
+ {
+ "checkin_id": 6,
+ "business_id": "--e8PjCNhEz32pprnPhCwQ",
+ "checkin_times": [
+ {"date": "2015-04-02", "time": "21:45:17"}
+ ]
+ },
+ {
+ "checkin_id": 7,
+ "business_id": "--kinfHwmtdjz03g8B8z8Q",
+ "checkin_times": [
+ {"date": "2014-08-27", "time": "17:49:18"},
+ {"date": "2015-12-19", "time": "21:30:31"},
+ {"date": "2018-11-27", "time": "15:53:50"}
+ ]
+ },
+ {
+ "checkin_id": 8,
+ "business_id": "--q6datkI-f0EoVheXNEeQ",
+ "checkin_times": [
+ {"date": "2014-01-28", "time": "20:56:04"},
+ {"date": "2014-11-16", "time": "16:11:58"},
+ {"date": "2015-11-15", "time": "19:21:53"},
+ {"date": "2015-11-15", "time": "19:33:39"}
+ ]
+ },
+ {
+ "checkin_id": 9,
+ "business_id": "--qvQS4MigHPykD2GV0-zw",
+ "checkin_times": [
+ {"date": "2019-04-11", "time": "18:30:12"}
+ ]
+ },
+ {
+ "checkin_id": 10,
+ "business_id": "--wIGbLEhlpl_UeAIyDmZQ",
+ "checkin_times": [
+ {"date": "2015-06-06", "time": "20:01:06"},
+ {"date": "2019-03-14", "time": "22:01:52"}
+ ]
+ },
+ {
+ "checkin_id": 11,
+ "business_id": "-0FA-Qdi3SPYIoJz9UQw-A",
+ "checkin_times": [
+ {"date": "2018-09-29", "time": "18:55:17"},
+ {"date": "2018-10-20", "time": "16:48:05"},
+ {"date": "2018-10-20", "time": "22:20:24"}
+ ]
+ },
+ {
+ "checkin_id": 12,
+ "business_id": "-0Hj1hb_XW6ybWq2M7QhGA",
+ "checkin_times": [
+ {"date": "2011-04-23", "time": "21:11:22"},
+ {"date": "2014-05-04", "time": "19:42:48"},
+ {"date": "2014-05-11", "time": "19:16:08"},
+ {"date": "2014-06-04", "time": "19:14:18"},
+ {"date": "2015-12-05", "time": "19:22:42"},
+ {"date": "2017-05-15", "time": "23:19:00"}
+ ]
+ },
+ {
+ "checkin_id": 13,
+ "business_id": "-0KMvRFwDWdVBeTpT11iHw",
+ "checkin_times": [
+ {"date": "2012-07-13", "time": "21:43:57"},
+ {"date": "2016-12-24", "time": "02:27:31"},
+ {"date": "2017-08-31", "time": "00:35:26"}
+ ]
+ },
+ {
+ "checkin_id": 14,
+ "business_id": "-0LPtgJC31FWMrMv317p0Q",
+ "checkin_times": [
+ {"date": "2013-04-13", "time": "12:35:33"},
+ {"date": "2013-08-19", "time": "23:35:49"},
+ {"date": "2013-10-04", "time": "19:14:56"}
+ ]
+ },
+ {
+ "checkin_id": 15,
+ "business_id": "-0M3o2uWBnQZwd3hmfEwuw",
+ "checkin_times": [
+ {"date": "2016-09-10", "time": "19:26:19"},
+ {"date": "2018-09-08", "time": "14:15:37"},
+ {"date": "2019-09-13", "time": "22:47:25"}
+ ]
+ },
+ {
+ "checkin_id": 16,
+ "business_id": "-0RRiWDtfnS16AKCtfvBZg",
+ "checkin_times": [
+ {"date": "2017-05-19", "time": "14:30:16"},
+ {"date": "2017-05-19", "time": "14:30:25"},
+ {"date": "2017-08-28", "time": "15:49:37"},
+ {"date": "2017-09-20", "time": "20:19:51"},
+ {"date": "2017-10-01", "time": "16:31:05"},
+ {"date": "2017-10-01", "time": "16:56:27"},
+ {"date": "2017-12-27", "time": "23:33:20"}
+ ]
+ },
+ {
+ "checkin_id": 17,
+ "business_id": "-0Soj75v-XoRcf2ERr8Bmg",
+ "checkin_times": [
+ {"date": "2019-06-05", "time": "18:22:49"}
+ ]
+ },
+ {
+ "checkin_id": 18,
+ "business_id": "-0ZumLlFjMh4ZW1z2nXGug",
+ "checkin_times": [
+ {"date": "2011-09-24", "time": "21:37:32"},
+ {"date": "2014-03-10", "time": "20:20:07"},
+ {"date": "2015-05-27", "time": "00:40:24"},
+ {"date": "2015-08-29", "time": "17:58:15"},
+ {"date": "2018-03-16", "time": "15:03:26"}
+ ]
+ },
+ {
+ "checkin_id": 19,
+ "business_id": "-0aOudcaAyac0VJbMX-L1g",
+ "checkin_times": [
+ {"date": "2015-03-16", "time": "23:51:16"},
+ {"date": "2015-12-21", "time": "04:48:01"},
+ {"date": "2016-10-28", "time": "20:22:42"},
+ {"date": "2016-10-28", "time": "20:23:00"}
+ ]
+ },
+ {
+ "checkin_id": 20,
+ "business_id": "-0b86isaXMY0v4g-V8GZ9Q",
+ "checkin_times": [
+ {"date": "2013-10-22", "time": "16:49:21"},
+ {"date": "2014-11-21", "time": "17:39:24"}
+ ]
+ },
+ {
+ "checkin_id": 21,
+ "business_id": "-0d-BfFSU0bwLcnMaGRxYw",
+ "checkin_times": [
+ {"date": "2014-08-07", "time": "18:30:48"},
+ {"date": "2014-09-16", "time": "20:41:45"},
+ {"date": "2014-10-12", "time": "23:22:27"},
+ {"date": "2015-07-21", "time": "20:43:56"},
+ {"date": "2015-07-21", "time": "20:45:07"}
+ ]
+ },
+ {
+ "checkin_id": 22,
+ "business_id": "-0jz6c3C6i7RG7Ag22K-Pg",
+ "checkin_times": [
+ {"date": "2015-05-02", "time": "19:49:05"},
+ {"date": "2015-05-06", "time": "03:52:18"},
+ {"date": "2015-09-26", "time": "01:13:19"}
+ ]
+ },
+ {
+ "checkin_id": 23,
+ "business_id": "-0y3MZU2oYP8r1ruDP1bfQ",
+ "checkin_times": [
+ {"date": "2015-04-11", "time": "13:14:14"},
+ {"date": "2015-11-21", "time": "16:05:56"},
+ {"date": "2016-05-06", "time": "14:10:04"},
+ {"date": "2017-08-09", "time": "15:15:10"},
+ {"date": "2017-10-21", "time": "15:12:56"}
+ ]
+ },
+ {
+ "checkin_id": 24,
+ "business_id": "-1BPe8UjF2_l3nVk-DFUjA",
+ "checkin_times": [
+ {"date": "2015-12-03", "time": "18:44:00"},
+ {"date": "2016-03-17", "time": "18:19:21"},
+ {"date": "2016-11-02", "time": "15:58:38"}
+ ]
+ },
+ {
+ "checkin_id": 25,
+ "business_id": "-1E2CQu_38mkghvmZgCCRw",
+ "checkin_times": [
+ {"date": "2019-04-04", "time": "22:02:37"}
+ ]
+ },
+ {
+ "checkin_id": 26,
+ "business_id": "-1wzk43IZ5D9Ysu6kzb5xA",
+ "checkin_times": [
+ {"date": "2019-02-27", "time": "14:03:08"}
+ ]
+ },
+ {
+ "checkin_id": 27,
+ "business_id": "-23R9P2eG7VTc6DVLjFKzA",
+ "checkin_times": [
+ {"date": "2011-12-21", "time": "19:02:51"},
+ {"date": "2012-04-15", "time": "04:21:39"},
+ {"date": "2012-04-15", "time": "14:23:56"},
+ {"date": "2013-06-30", "time": "22:39:51"},
+ {"date": "2013-10-04", "time": "20:34:13"},
+ {"date": "2014-07-16", "time": "02:28:40"}
+ ]
+ },
+ {
+ "checkin_id": 28,
+ "business_id": "-26MGfikhJiTfCI-GqmzhQ",
+ "checkin_times": [
+ {"date": "2018-06-13", "time": "20:16:07"}
+ ]
+ },
+ {
+ "checkin_id": 29,
+ "business_id": "-2bLuJsMZ0WhI9daurVQNQ",
+ "checkin_times": [
+ {"date": "2015-05-29", "time": "16:46:17"},
+ {"date": "2015-06-01", "time": "15:03:53"}
+ ]
+ },
+ {
+ "checkin_id": 30,
+ "business_id": "-2hDBMaza_ldqnZdiU06LQ",
+ "checkin_times": [
+ {"date": "2011-10-08", "time": "12:02:23"},
+ {"date": "2014-08-18", "time": "02:11:11"},
+ {"date": "2016-01-07", "time": "05:27:51"},
+ {"date": "2016-10-21", "time": "20:15:55"},
+ {"date": "2016-12-01", "time": "03:57:10"},
+ {"date": "2016-12-29", "time": "01:54:42"},
+ {"date": "2018-07-22", "time": "19:55:31"},
+ {"date": "2018-09-07", "time": "01:42:54"},
+ {"date": "2019-03-08", "time": "03:41:06"}
+ ]
+ }
+ ]
+);
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-composite-sk/with-composite-sk.03.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-composite-sk/with-composite-sk.03.query.sqlpp
new file mode 100644
index 0000000..baf548c
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-composite-sk/with-composite-sk.03.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.
+ */
+SET `compiler.arrayindex` "true";
+
+USE TestYelp;
+
+SELECT COUNT(*)
+FROM YelpCheckin C, C.checkin_times D
+WHERE D.date > " " AND
+ D.time > " " AND
+ C.business_id > " ";
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-composite-sk/with-composite-sk.04.get.http b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-composite-sk/with-composite-sk.04.get.http
new file mode 100644
index 0000000..a55ce93
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-composite-sk/with-composite-sk.04.get.http
@@ -0,0 +1,19 @@
+/*
+ * 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.
+ */
+/connector?dataverseName=TestYelp&datasetName=YelpCheckin
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-composite-sk/with-composite-sk.05.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-composite-sk/with-composite-sk.05.query.sqlpp
new file mode 100644
index 0000000..baf548c
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-composite-sk/with-composite-sk.05.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.
+ */
+SET `compiler.arrayindex` "true";
+
+USE TestYelp;
+
+SELECT COUNT(*)
+FROM YelpCheckin C, C.checkin_times D
+WHERE D.date > " " AND
+ D.time > " " AND
+ C.business_id > " ";
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-composite-sk/with-composite-sk.06.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-composite-sk/with-composite-sk.06.update.sqlpp
new file mode 100644
index 0000000..ea1dba3
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-composite-sk/with-composite-sk.06.update.sqlpp
@@ -0,0 +1,23 @@
+/*
+ * 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 TestYelp;
+
+DELETE FROM YelpCheckin C
+WHERE C.business_id != "--1UhMGODdWsrMastO9DZw";
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-composite-sk/with-composite-sk.07.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-composite-sk/with-composite-sk.07.query.sqlpp
new file mode 100644
index 0000000..baf548c
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-composite-sk/with-composite-sk.07.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.
+ */
+SET `compiler.arrayindex` "true";
+
+USE TestYelp;
+
+SELECT COUNT(*)
+FROM YelpCheckin C, C.checkin_times D
+WHERE D.date > " " AND
+ D.time > " " AND
+ C.business_id > " ";
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-composite-sk/with-composite-sk.08.get.http b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-composite-sk/with-composite-sk.08.get.http
new file mode 100644
index 0000000..a55ce93
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-composite-sk/with-composite-sk.08.get.http
@@ -0,0 +1,19 @@
+/*
+ * 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.
+ */
+/connector?dataverseName=TestYelp&datasetName=YelpCheckin
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-composite-sk/with-composite-sk.09.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-composite-sk/with-composite-sk.09.query.sqlpp
new file mode 100644
index 0000000..baf548c
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-composite-sk/with-composite-sk.09.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.
+ */
+SET `compiler.arrayindex` "true";
+
+USE TestYelp;
+
+SELECT COUNT(*)
+FROM YelpCheckin C, C.checkin_times D
+WHERE D.date > " " AND
+ D.time > " " AND
+ C.business_id > " ";
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-composite-sk/with-composite-sk.10.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-composite-sk/with-composite-sk.10.update.sqlpp
new file mode 100644
index 0000000..5ec7879
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-composite-sk/with-composite-sk.10.update.sqlpp
@@ -0,0 +1,306 @@
+/*
+ * 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 TestYelp;
+
+UPSERT INTO YelpCheckin (
+ [
+ {
+ "checkin_id": 1,
+ "business_id": "--1UhMGODdWsrMastO9DZw",
+ "checkin_times": [
+ {"date": "2016-04-26", "time": "19:49:16"},
+ {"date": "2016-08-30", "time": "18:36:57"},
+ {"date": "2016-10-15", "time": "02:45:18"},
+ {"date": "2016-11-18", "time": "01:54:50"},
+ {"date": "2017-04-20", "time": "18:39:06"},
+ {"date": "2017-05-03", "time": "17:58:02"},
+ {"date": "2019-03-19", "time": "22:04:48"}
+ ]
+ },
+ {
+ "checkin_id": 2,
+ "business_id": "--EF5N7P70J_UYBTPypYlA",
+ "checkin_times": [
+ {"date": "2018-05-25", "time": "19:52:07"},
+ {"date": "2018-09-18", "time": "16:09:44"},
+ {"date": "2019-10-18", "time": "21:29:09"}
+ ]
+ },
+ {
+ "checkin_id": 3,
+ "business_id": "--Ni3oJ4VOqfOEu7Sj2Vzg",
+ "checkin_times": [
+ {"date": "2019-06-07", "time": "17:54:58"}
+ ]
+ },
+ {
+ "checkin_id": 4,
+ "business_id": "--Y1Adl1YUWfYIRSd8vkmA",
+ "checkin_times": [
+ {"date": "2011-05-03", "time": "20:54:05"},
+ {"date": "2011-08-23", "time": "20:49:45"},
+ {"date": "2014-12-04", "time": "06:13:01"},
+ {"date": "2016-11-16", "time": "19:25:55"}
+ ]
+ },
+ {
+ "checkin_id": 5,
+ "business_id": "--YPwqIlRJrhHkJcjY3eiA",
+ "checkin_times": [
+ {"date": "2016-06-18", "time": "21:35:45"},
+ {"date": "2016-10-15", "time": "18:17:51"}
+ ]
+ },
+ {
+ "checkin_id": 6,
+ "business_id": "--e8PjCNhEz32pprnPhCwQ",
+ "checkin_times": [
+ {"date": "2015-04-02", "time": "21:45:17"}
+ ]
+ },
+ {
+ "checkin_id": 7,
+ "business_id": "--kinfHwmtdjz03g8B8z8Q",
+ "checkin_times": [
+ {"date": "2014-08-27", "time": "17:49:18"},
+ {"date": "2015-12-19", "time": "21:30:31"},
+ {"date": "2018-11-27", "time": "15:53:50"}
+ ]
+ },
+ {
+ "checkin_id": 8,
+ "business_id": "--q6datkI-f0EoVheXNEeQ",
+ "checkin_times": [
+ {"date": "2014-01-28", "time": "20:56:04"},
+ {"date": "2014-11-16", "time": "16:11:58"},
+ {"date": "2015-11-15", "time": "19:21:53"},
+ {"date": "2015-11-15", "time": "19:33:39"}
+ ]
+ },
+ {
+ "checkin_id": 9,
+ "business_id": "--qvQS4MigHPykD2GV0-zw",
+ "checkin_times": [
+ {"date": "2019-04-11", "time": "18:30:12"}
+ ]
+ },
+ {
+ "checkin_id": 10,
+ "business_id": "--wIGbLEhlpl_UeAIyDmZQ",
+ "checkin_times": [
+ {"date": "2015-06-06", "time": "20:01:06"},
+ {"date": "2019-03-14", "time": "22:01:52"}
+ ]
+ },
+ {
+ "checkin_id": 11,
+ "business_id": "-0FA-Qdi3SPYIoJz9UQw-A",
+ "checkin_times": [
+ {"date": "2018-09-29", "time": "18:55:17"},
+ {"date": "2018-10-20", "time": "16:48:05"},
+ {"date": "2018-10-20", "time": "22:20:24"}
+ ]
+ },
+ {
+ "checkin_id": 12,
+ "business_id": "-0Hj1hb_XW6ybWq2M7QhGA",
+ "checkin_times": [
+ {"date": "2011-04-23", "time": "21:11:22"},
+ {"date": "2014-05-04", "time": "19:42:48"},
+ {"date": "2014-05-11", "time": "19:16:08"},
+ {"date": "2014-06-04", "time": "19:14:18"},
+ {"date": "2015-12-05", "time": "19:22:42"},
+ {"date": "2017-05-15", "time": "23:19:00"}
+ ]
+ },
+ {
+ "checkin_id": 13,
+ "business_id": "-0KMvRFwDWdVBeTpT11iHw",
+ "checkin_times": [
+ {"date": "2012-07-13", "time": "21:43:57"},
+ {"date": "2016-12-24", "time": "02:27:31"},
+ {"date": "2017-08-31", "time": "00:35:26"}
+ ]
+ },
+ {
+ "checkin_id": 14,
+ "business_id": "-0LPtgJC31FWMrMv317p0Q",
+ "checkin_times": [
+ {"date": "2013-04-13", "time": "12:35:33"},
+ {"date": "2013-08-19", "time": "23:35:49"},
+ {"date": "2013-10-04", "time": "19:14:56"}
+ ]
+ },
+ {
+ "checkin_id": 15,
+ "business_id": "-0M3o2uWBnQZwd3hmfEwuw",
+ "checkin_times": [
+ {"date": "2016-09-10", "time": "19:26:19"},
+ {"date": "2018-09-08", "time": "14:15:37"},
+ {"date": "2019-09-13", "time": "22:47:25"}
+ ]
+ },
+ {
+ "checkin_id": 16,
+ "business_id": "-0RRiWDtfnS16AKCtfvBZg",
+ "checkin_times": [
+ {"date": "2017-05-19", "time": "14:30:16"},
+ {"date": "2017-05-19", "time": "14:30:25"},
+ {"date": "2017-08-28", "time": "15:49:37"},
+ {"date": "2017-09-20", "time": "20:19:51"},
+ {"date": "2017-10-01", "time": "16:31:05"},
+ {"date": "2017-10-01", "time": "16:56:27"},
+ {"date": "2017-12-27", "time": "23:33:20"}
+ ]
+ },
+ {
+ "checkin_id": 17,
+ "business_id": "-0Soj75v-XoRcf2ERr8Bmg",
+ "checkin_times": [
+ {"date": "2019-06-05", "time": "18:22:49"}
+ ]
+ },
+ {
+ "checkin_id": 18,
+ "business_id": "-0ZumLlFjMh4ZW1z2nXGug",
+ "checkin_times": [
+ {"date": "2011-09-24", "time": "21:37:32"},
+ {"date": "2014-03-10", "time": "20:20:07"},
+ {"date": "2015-05-27", "time": "00:40:24"},
+ {"date": "2015-08-29", "time": "17:58:15"},
+ {"date": "2018-03-16", "time": "15:03:26"}
+ ]
+ },
+ {
+ "checkin_id": 19,
+ "business_id": "-0aOudcaAyac0VJbMX-L1g",
+ "checkin_times": [
+ {"date": "2015-03-16", "time": "23:51:16"},
+ {"date": "2015-12-21", "time": "04:48:01"},
+ {"date": "2016-10-28", "time": "20:22:42"},
+ {"date": "2016-10-28", "time": "20:23:00"}
+ ]
+ },
+ {
+ "checkin_id": 20,
+ "business_id": "-0b86isaXMY0v4g-V8GZ9Q",
+ "checkin_times": [
+ {"date": "2013-10-22", "time": "16:49:21"},
+ {"date": "2014-11-21", "time": "17:39:24"}
+ ]
+ },
+ {
+ "checkin_id": 21,
+ "business_id": "-0d-BfFSU0bwLcnMaGRxYw",
+ "checkin_times": [
+ {"date": "2014-08-07", "time": "18:30:48"},
+ {"date": "2014-09-16", "time": "20:41:45"},
+ {"date": "2014-10-12", "time": "23:22:27"},
+ {"date": "2015-07-21", "time": "20:43:56"},
+ {"date": "2015-07-21", "time": "20:45:07"}
+ ]
+ },
+ {
+ "checkin_id": 22,
+ "business_id": "-0jz6c3C6i7RG7Ag22K-Pg",
+ "checkin_times": [
+ {"date": "2015-05-02", "time": "19:49:05"},
+ {"date": "2015-05-06", "time": "03:52:18"},
+ {"date": "2015-09-26", "time": "01:13:19"}
+ ]
+ },
+ {
+ "checkin_id": 23,
+ "business_id": "-0y3MZU2oYP8r1ruDP1bfQ",
+ "checkin_times": [
+ {"date": "2015-04-11", "time": "13:14:14"},
+ {"date": "2015-11-21", "time": "16:05:56"},
+ {"date": "2016-05-06", "time": "14:10:04"},
+ {"date": "2017-08-09", "time": "15:15:10"},
+ {"date": "2017-10-21", "time": "15:12:56"}
+ ]
+ },
+ {
+ "checkin_id": 24,
+ "business_id": "-1BPe8UjF2_l3nVk-DFUjA",
+ "checkin_times": [
+ {"date": "2015-12-03", "time": "18:44:00"},
+ {"date": "2016-03-17", "time": "18:19:21"},
+ {"date": "2016-11-02", "time": "15:58:38"}
+ ]
+ },
+ {
+ "checkin_id": 25,
+ "business_id": "-1E2CQu_38mkghvmZgCCRw",
+ "checkin_times": [
+ {"date": "2019-04-04", "time": "22:02:37"}
+ ]
+ },
+ {
+ "checkin_id": 26,
+ "business_id": "-1wzk43IZ5D9Ysu6kzb5xA",
+ "checkin_times": [
+ {"date": "2019-02-27", "time": "14:03:08"}
+ ]
+ },
+ {
+ "checkin_id": 27,
+ "business_id": "-23R9P2eG7VTc6DVLjFKzA",
+ "checkin_times": [
+ {"date": "2011-12-21", "time": "19:02:51"},
+ {"date": "2012-04-15", "time": "04:21:39"},
+ {"date": "2012-04-15", "time": "14:23:56"},
+ {"date": "2013-06-30", "time": "22:39:51"},
+ {"date": "2013-10-04", "time": "20:34:13"},
+ {"date": "2014-07-16", "time": "02:28:40"}
+ ]
+ },
+ {
+ "checkin_id": 28,
+ "business_id": "-26MGfikhJiTfCI-GqmzhQ",
+ "checkin_times": [
+ {"date": "2018-06-13", "time": "20:16:07"}
+ ]
+ },
+ {
+ "checkin_id": 29,
+ "business_id": "-2bLuJsMZ0WhI9daurVQNQ",
+ "checkin_times": [
+ {"date": "2015-05-29", "time": "16:46:17"},
+ {"date": "2015-06-01", "time": "15:03:53"}
+ ]
+ },
+ {
+ "checkin_id": 30,
+ "business_id": "-2hDBMaza_ldqnZdiU06LQ",
+ "checkin_times": [
+ {"date": "2011-10-08", "time": "12:02:23"},
+ {"date": "2014-08-18", "time": "02:11:11"},
+ {"date": "2016-01-07", "time": "05:27:51"},
+ {"date": "2016-10-21", "time": "20:15:55"},
+ {"date": "2016-12-01", "time": "03:57:10"},
+ {"date": "2016-12-29", "time": "01:54:42"},
+ {"date": "2018-07-22", "time": "19:55:31"},
+ {"date": "2018-09-07", "time": "01:42:54"},
+ {"date": "2019-03-08", "time": "03:41:06"}
+ ]
+ }
+ ]
+);
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-composite-sk/with-composite-sk.11.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-composite-sk/with-composite-sk.11.query.sqlpp
new file mode 100644
index 0000000..baf548c
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-composite-sk/with-composite-sk.11.query.sqlpp
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+SET `compiler.arrayindex` "true";
+
+USE TestYelp;
+
+SELECT COUNT(*)
+FROM YelpCheckin C, C.checkin_times D
+WHERE D.date > " " AND
+ D.time > " " AND
+ C.business_id > " ";
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-composite-sk/with-composite-sk.12.get.http b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-composite-sk/with-composite-sk.12.get.http
new file mode 100644
index 0000000..a55ce93
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-composite-sk/with-composite-sk.12.get.http
@@ -0,0 +1,19 @@
+/*
+ * 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.
+ */
+/connector?dataverseName=TestYelp&datasetName=YelpCheckin
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-composite-sk/with-composite-sk.13.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-composite-sk/with-composite-sk.13.query.sqlpp
new file mode 100644
index 0000000..baf548c
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/array-index/with-composite-sk/with-composite-sk.13.query.sqlpp
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+SET `compiler.arrayindex` "true";
+
+USE TestYelp;
+
+SELECT COUNT(*)
+FROM YelpCheckin C, C.checkin_times D
+WHERE D.date > " " AND
+ D.time > " " AND
+ C.business_id > " ";
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-bulkload/after-bulkload.001.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-bulkload/after-bulkload.001.ddl.sqlpp
new file mode 100644
index 0000000..c25e7c2
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-bulkload/after-bulkload.001.ddl.sqlpp
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+DROP DATAVERSE TestYelp IF EXISTS;
+CREATE DATAVERSE TestYelp;
+USE TestYelp;
+
+CREATE TYPE CheckinType AS {
+ checkin_id: uuid
+};
+
+CREATE DATASET YelpCheckin(CheckinType)
+PRIMARY KEY checkin_id AUTOGENERATED WITH {
+ "storage-format" : {"format" : "column"}
+};
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-bulkload/after-bulkload.002.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-bulkload/after-bulkload.002.update.sqlpp
new file mode 100644
index 0000000..88a354a
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-bulkload/after-bulkload.002.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 TestYelp;
+
+LOAD DATASET YelpCheckin
+USING localfs (("path"="asterix_nc1://data/yelp-checkin/use-case-1.json"),
+ ("format"="json"));
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-bulkload/after-bulkload.003.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-bulkload/after-bulkload.003.query.sqlpp
new file mode 100644
index 0000000..5560372d
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-bulkload/after-bulkload.003.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.
+ */
+
+SET `compiler.arrayindex` "true";
+
+USE TestYelp;
+
+SELECT C.business_id
+FROM YelpCheckin C, C.dates D
+WHERE "2016-04-26 19:49:16" = D;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-bulkload/after-bulkload.004.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-bulkload/after-bulkload.004.query.sqlpp
new file mode 100644
index 0000000..bc53b2a
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-bulkload/after-bulkload.004.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 TestYelp;
+
+SELECT VALUE C.dates
+FROM YelpCheckin C
+WHERE "-0y3MZU2oYP8r1ruDP1bfQ" = C.business_id;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-bulkload/after-bulkload.005.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-bulkload/after-bulkload.005.ddl.sqlpp
new file mode 100644
index 0000000..0ef51a1
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-bulkload/after-bulkload.005.ddl.sqlpp
@@ -0,0 +1,23 @@
+/*
+ * 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 TestYelp;
+
+CREATE INDEX IdxYelpCheckinDates ON YelpCheckin (UNNEST dates:string) EXCLUDE UNKNOWN KEY;
+CREATE INDEX IdxYelpCheckinBusinessId ON YelpCheckin (business_id:string);
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-bulkload/after-bulkload.006.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-bulkload/after-bulkload.006.query.sqlpp
new file mode 100644
index 0000000..5560372d
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-bulkload/after-bulkload.006.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.
+ */
+
+SET `compiler.arrayindex` "true";
+
+USE TestYelp;
+
+SELECT C.business_id
+FROM YelpCheckin C, C.dates D
+WHERE "2016-04-26 19:49:16" = D;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-bulkload/after-bulkload.007.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-bulkload/after-bulkload.007.query.sqlpp
new file mode 100644
index 0000000..bc53b2a
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-bulkload/after-bulkload.007.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 TestYelp;
+
+SELECT VALUE C.dates
+FROM YelpCheckin C
+WHERE "-0y3MZU2oYP8r1ruDP1bfQ" = C.business_id;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-insert/after-insert.001.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-insert/after-insert.001.ddl.sqlpp
new file mode 100644
index 0000000..1dd2d6f
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-insert/after-insert.001.ddl.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.
+ */
+
+DROP DATAVERSE TestYelp IF EXISTS;
+CREATE DATAVERSE TestYelp;
+USE TestYelp;
+
+CREATE TYPE CheckinType AS {
+ checkin_id: uuid
+};
+
+CREATE DATASET YelpCheckin(CheckinType) PRIMARY KEY checkin_id AUTOGENERATED WITH {
+ "storage-format" : {"format" : "column"}
+};
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-insert/after-insert.002.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-insert/after-insert.002.update.sqlpp
new file mode 100644
index 0000000..ba9a31b
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-insert/after-insert.002.update.sqlpp
@@ -0,0 +1,272 @@
+/*
+ * 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 TestYelp;
+
+INSERT INTO YelpCheckin (
+ [
+ {
+ "business_id": "--1UhMGODdWsrMastO9DZw",
+ "dates": [
+ "2016-04-26 19:49:16",
+ "2016-08-30 18:36:57",
+ "2016-10-15 02:45:18",
+ "2016-11-18 01:54:50",
+ "2017-04-20 18:39:06",
+ "2017-05-03 17:58:02",
+ "2019-03-19 22:04:48"
+ ]
+ },
+ {
+ "business_id": "--EF5N7P70J_UYBTPypYlA",
+ "dates": [
+ "2018-05-25 19:52:07",
+ "2018-09-18 16:09:44",
+ "2019-10-18 21:29:09"
+ ]
+ },
+ {
+ "business_id": "--Ni3oJ4VOqfOEu7Sj2Vzg",
+ "dates": [
+ "2019-06-07 17:54:58"
+ ]
+ },
+ {
+ "business_id": "--Y1Adl1YUWfYIRSd8vkmA",
+ "dates": [
+ "2011-05-03 20:54:05",
+ "2011-08-23 20:49:45",
+ "2014-12-04 06:13:01",
+ "2016-11-16 19:25:55"
+ ]
+ },
+ {
+ "business_id": "--YPwqIlRJrhHkJcjY3eiA",
+ "dates": [
+ "2016-06-18 21:35:45",
+ "2016-10-15 18:17:51"
+ ]
+ },
+ {
+ "business_id": "--e8PjCNhEz32pprnPhCwQ",
+ "dates": [
+ "2015-04-02 21:45:17"
+ ]
+ },
+ {
+ "business_id": "--kinfHwmtdjz03g8B8z8Q",
+ "dates": [
+ "2014-08-27 17:49:18",
+ "2015-12-19 21:30:31",
+ "2018-11-27 15:53:50"
+ ]
+ },
+ {
+ "business_id": "--q6datkI-f0EoVheXNEeQ",
+ "dates": [
+ "2014-01-28 20:56:04",
+ "2014-11-16 16:11:58",
+ "2015-11-15 19:21:53",
+ "2015-11-15 19:33:39"
+ ]
+ },
+ {
+ "business_id": "--qvQS4MigHPykD2GV0-zw",
+ "dates": [
+ "2019-04-11 18:30:12"
+ ]
+ },
+ {
+ "business_id": "--wIGbLEhlpl_UeAIyDmZQ",
+ "dates": [
+ "2015-06-06 20:01:06",
+ "2019-03-14 22:01:52"
+ ]
+ },
+ {
+ "business_id": "-0FA-Qdi3SPYIoJz9UQw-A",
+ "dates": [
+ "2018-09-29 18:55:17",
+ "2018-10-20 16:48:05",
+ "2018-10-20 22:20:24"
+ ]
+ },
+ {
+ "business_id": "-0Hj1hb_XW6ybWq2M7QhGA",
+ "dates": [
+ "2011-04-23 21:11:22",
+ "2014-05-04 19:42:48",
+ "2014-05-11 19:16:08",
+ "2014-06-04 19:14:18",
+ "2015-12-05 19:22:42",
+ "2017-05-15 23:19:00"
+ ]
+ },
+ {
+ "business_id": "-0KMvRFwDWdVBeTpT11iHw",
+ "dates": [
+ "2012-07-13 21:43:57",
+ "2016-12-24 02:27:31",
+ "2017-08-31 00:35:26"
+ ]
+ },
+ {
+ "business_id": "-0LPtgJC31FWMrMv317p0Q",
+ "dates": [
+ "2013-04-13 12:35:33",
+ "2013-08-19 23:35:49",
+ "2013-10-04 19:14:56"
+ ]
+ },
+ {
+ "business_id": "-0M3o2uWBnQZwd3hmfEwuw",
+ "dates": [
+ "2016-09-10 19:26:19",
+ "2018-09-08 14:15:37",
+ "2019-09-13 22:47:25"
+ ]
+ },
+ {
+ "business_id": "-0RRiWDtfnS16AKCtfvBZg",
+ "dates": [
+ "2017-05-19 14:30:16",
+ "2017-05-19 14:30:25",
+ "2017-08-28 15:49:37",
+ "2017-09-20 20:19:51",
+ "2017-10-01 16:31:05",
+ "2017-10-01 16:56:27",
+ "2017-12-27 23:33:20"
+ ]
+ },
+ {
+ "business_id": "-0Soj75v-XoRcf2ERr8Bmg",
+ "dates": [
+ "2019-06-05 18:22:49"
+ ]
+ },
+ {
+ "business_id": "-0ZumLlFjMh4ZW1z2nXGug",
+ "dates": [
+ "2011-09-24 21:37:32",
+ "2014-03-10 20:20:07",
+ "2015-05-27 00:40:24",
+ "2015-08-29 17:58:15",
+ "2018-03-16 15:03:26"
+ ]
+ },
+ {
+ "business_id": "-0aOudcaAyac0VJbMX-L1g",
+ "dates": [
+ "2015-03-16 23:51:16",
+ "2015-12-21 04:48:01",
+ "2016-10-28 20:22:42",
+ "2016-10-28 20:23:00"
+ ]
+ },
+ {
+ "business_id": "-0b86isaXMY0v4g-V8GZ9Q",
+ "dates": [
+ "2013-10-22 16:49:21",
+ "2014-11-21 17:39:24"
+ ]
+ },
+ {
+ "business_id": "-0d-BfFSU0bwLcnMaGRxYw",
+ "dates": [
+ "2014-08-07 18:30:48",
+ "2014-09-16 20:41:45",
+ "2014-10-12 23:22:27",
+ "2015-07-21 20:43:56",
+ "2015-07-21 20:45:07"
+ ]
+ },
+ {
+ "business_id": "-0jz6c3C6i7RG7Ag22K-Pg",
+ "dates": [
+ "2015-05-02 19:49:05",
+ "2015-05-06 03:52:18",
+ "2015-09-26 01:13:19"
+ ]
+ },
+ {
+ "business_id": "-0y3MZU2oYP8r1ruDP1bfQ",
+ "dates": [
+ "2015-04-11 13:14:14",
+ "2015-11-21 16:05:56",
+ "2016-05-06 14:10:04",
+ "2017-08-09 15:15:10",
+ "2017-10-21 15:12:56"
+ ]
+ },
+ {
+ "business_id": "-1BPe8UjF2_l3nVk-DFUjA",
+ "dates": [
+ "2015-12-03 18:44:00",
+ "2016-03-17 18:19:21",
+ "2016-11-02 15:58:38"
+ ]
+ },
+ {
+ "business_id": "-1E2CQu_38mkghvmZgCCRw",
+ "dates": []
+ },
+ {
+ "business_id": "-1wzk43IZ5D9Ysu6kzb5xA",
+ "dates": []
+ },
+ {
+ "business_id": "-23R9P2eG7VTc6DVLjFKzA",
+ "dates": [
+ "2011-12-21 19:02:51",
+ "2012-04-15 04:21:39",
+ "2012-04-15 14:23:56",
+ "2013-06-30 22:39:51",
+ "2013-10-04 20:34:13",
+ "2014-07-16 02:28:40"
+ ]
+ },
+ {
+ "business_id": "-26MGfikhJiTfCI-GqmzhQ",
+ "dates": [
+ "2018-06-13 20:16:07"
+ ]
+ },
+ {
+ "business_id": "-2bLuJsMZ0WhI9daurVQNQ",
+ "dates": [
+ "2015-05-29 16:46:17",
+ "2015-06-01 15:03:53"
+ ]
+ },
+ {
+ "business_id": "-2hDBMaza_ldqnZdiU06LQ",
+ "dates": [
+ "2011-10-08 12:02:23",
+ "2014-08-18 02:11:11",
+ "2016-01-07 05:27:51",
+ "2016-10-21 20:15:55",
+ "2016-12-01 03:57:10",
+ "2016-12-29 01:54:42",
+ "2018-07-22 19:55:31",
+ "2018-09-07 01:42:54",
+ "2019-03-08 03:41:06"
+ ]
+ }
+ ]
+);
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-insert/after-insert.003.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-insert/after-insert.003.query.sqlpp
new file mode 100644
index 0000000..5560372d
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-insert/after-insert.003.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.
+ */
+
+SET `compiler.arrayindex` "true";
+
+USE TestYelp;
+
+SELECT C.business_id
+FROM YelpCheckin C, C.dates D
+WHERE "2016-04-26 19:49:16" = D;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-insert/after-insert.004.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-insert/after-insert.004.query.sqlpp
new file mode 100644
index 0000000..bc53b2a
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-insert/after-insert.004.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 TestYelp;
+
+SELECT VALUE C.dates
+FROM YelpCheckin C
+WHERE "-0y3MZU2oYP8r1ruDP1bfQ" = C.business_id;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-insert/after-insert.005.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-insert/after-insert.005.ddl.sqlpp
new file mode 100644
index 0000000..0ef51a1
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-insert/after-insert.005.ddl.sqlpp
@@ -0,0 +1,23 @@
+/*
+ * 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 TestYelp;
+
+CREATE INDEX IdxYelpCheckinDates ON YelpCheckin (UNNEST dates:string) EXCLUDE UNKNOWN KEY;
+CREATE INDEX IdxYelpCheckinBusinessId ON YelpCheckin (business_id:string);
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-insert/after-insert.006.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-insert/after-insert.006.query.sqlpp
new file mode 100644
index 0000000..5560372d
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-insert/after-insert.006.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.
+ */
+
+SET `compiler.arrayindex` "true";
+
+USE TestYelp;
+
+SELECT C.business_id
+FROM YelpCheckin C, C.dates D
+WHERE "2016-04-26 19:49:16" = D;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-insert/after-insert.007.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-insert/after-insert.007.query.sqlpp
new file mode 100644
index 0000000..bc53b2a
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-insert/after-insert.007.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 TestYelp;
+
+SELECT VALUE C.dates
+FROM YelpCheckin C
+WHERE "-0y3MZU2oYP8r1ruDP1bfQ" = C.business_id;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-upsert-with-meta/after-insert-with-meta.001.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-upsert-with-meta/after-insert-with-meta.001.ddl.sqlpp
new file mode 100644
index 0000000..ccaea7e
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-upsert-with-meta/after-insert-with-meta.001.ddl.sqlpp
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+DROP DATAVERSE test if exists;
+CREATE DATAVERSE test;
+USE test;
+
+CREATE TYPE DataType AS {
+ name:string,
+ age:int,
+ hobby:string
+};
+
+CREATE TYPE MetaType AS {
+ id:int
+};
+
+CREATE DATASET DS(DataType) WITH META(MetaType)
+PRIMARY KEY META().id WITH {
+ "storage-format": {"format" : "column"}
+};
+
+CREATE FEED DsStream WITH {
+ "adapter-name" : "localfs",
+ "reader" : "localfs",
+ "parser" : "record-with-metadata",
+ "type-name" : "DataType",
+ "meta-type-name" : "MetaType",
+ "path" : "asterix_nc1://data/csv/people.csv",
+ "format" : "csv",
+ "delimiter" : ",",
+ "record-format" : "adm",
+ "record-index" : "1",
+ "key-indexes" : "0",
+ "key-indicators" : "1",
+ "header" : "false"
+};
+
+CREATE FEED DsStream2 WITH {
+ "adapter-name" : "localfs",
+ "reader" : "localfs",
+ "parser" : "record-with-metadata",
+ "type-name" : "DataType",
+ "meta-type-name" : "MetaType",
+ "path" : "asterix_nc1://data/csv/people3.csv",
+ "format" : "csv",
+ "delimiter" : ",",
+ "record-format" : "adm",
+ "record-index" : "1",
+ "key-indexes" : "0",
+ "key-indicators" : "1",
+ "header" : "false"
+};
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.002.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.002.update.sqlpp
new file mode 100644
index 0000000..55e842c
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.002.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;
+
+SET `wait-for-completion-feed` "true";
+CONNECT FEED DsStream TO DATASET DS;
+START FEED DsStream;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.003.get.http b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.003.get.http
new file mode 100644
index 0000000..e6efaa0
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.003.get.http
@@ -0,0 +1,19 @@
+/*
+ * 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.
+ */
+/connector?dataverseName=test&datasetName=DS
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.004.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.004.ddl.sqlpp
new file mode 100644
index 0000000..369f3ab
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.004.ddl.sqlpp
@@ -0,0 +1,23 @@
+/*
+ * 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;
+
+CREATE INDEX age_idx ON DS(age);
+CREATE INDEX hobby_age_idx ON DS(name, age);
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.005.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.005.query.sqlpp
new file mode 100644
index 0000000..9e6b11f
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.005.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 META().id, d.age, d.name
+FROM DS d
+WHERE d.age BETWEEN 20 AND 30
+ORDER BY META().id
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.006.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.006.query.sqlpp
new file mode 100644
index 0000000..a6b1153
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.006.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 META().id, d.age, d.name
+FROM DS d
+WHERE d.hobby = "basketball"
+ORDER BY META().id
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.007.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.007.update.sqlpp
new file mode 100644
index 0000000..08652aa
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.007.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;
+
+SET `wait-for-completion-feed` "true";
+CONNECT FEED DsStream2 TO DATASET DS;
+START FEED DsStream2;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.008.get.http b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.008.get.http
new file mode 100644
index 0000000..e6efaa0
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.008.get.http
@@ -0,0 +1,19 @@
+/*
+ * 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.
+ */
+/connector?dataverseName=test&datasetName=DS
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.009.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.009.query.sqlpp
new file mode 100644
index 0000000..9e6b11f
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.009.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 META().id, d.age, d.name
+FROM DS d
+WHERE d.age BETWEEN 20 AND 30
+ORDER BY META().id
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.010.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.010.query.sqlpp
new file mode 100644
index 0000000..a6b1153
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.010.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 META().id, d.age, d.name
+FROM DS d
+WHERE d.hobby = "basketball"
+ORDER BY META().id
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.011.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.011.update.sqlpp
new file mode 100644
index 0000000..1ab4c1c
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.011.update.sqlpp
@@ -0,0 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+USE test;
+
+COMPACT DATASET DS;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.012.get.http b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.012.get.http
new file mode 100644
index 0000000..e6efaa0
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.012.get.http
@@ -0,0 +1,19 @@
+/*
+ * 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.
+ */
+/connector?dataverseName=test&datasetName=DS
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.013.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.013.query.sqlpp
new file mode 100644
index 0000000..9e6b11f
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.013.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 META().id, d.age, d.name
+FROM DS d
+WHERE d.age BETWEEN 20 AND 30
+ORDER BY META().id
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.014.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.014.query.sqlpp
new file mode 100644
index 0000000..a6b1153
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.014.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 META().id, d.age, d.name
+FROM DS d
+WHERE d.hobby = "basketball"
+ORDER BY META().id
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.001.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.001.ddl.sqlpp
new file mode 100644
index 0000000..1780402
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.001.ddl.sqlpp
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+DROP DATAVERSE test if exists;
+CREATE DATAVERSE test;
+USE test;
+
+CREATE TYPE DataType AS {
+ name:string,
+ age:int,
+ hobby:string
+};
+
+CREATE TYPE MetaType AS {
+ id:int
+};
+
+CREATE DATASET DS(DataType) WITH META(MetaType)
+PRIMARY KEY META().id WITH {
+ "storage-format": {"format" : "column"}
+};
+
+CREATE FEED DsStream WITH {
+ "adapter-name" : "localfs",
+ "reader" : "localfs",
+ "parser" : "record-with-metadata",
+ "type-name" : "DataType",
+ "meta-type-name" : "MetaType",
+ "path" : "asterix_nc1://data/csv/people.csv",
+ "format" : "csv",
+ "delimiter" : ",",
+ "record-format" : "adm",
+ "record-index" : "1",
+ "key-indexes" : "0",
+ "key-indicators" : "1",
+ "header" : "false"
+};
+
+CREATE FEED DsStream2 WITH {
+ "adapter-name" : "localfs",
+ "reader" : "localfs",
+ "parser" : "record-with-metadata",
+ "type-name" : "DataType",
+ "meta-type-name" : "MetaType",
+ "path" : "asterix_nc1://data/csv/people3.csv",
+ "format" : "csv",
+ "delimiter" : ",",
+ "record-format" : "adm",
+ "record-index" : "1",
+ "key-indexes" : "0",
+ "key-indicators" : "1",
+ "header" : "false"
+};
+
+CREATE INDEX age_idx ON DS(age);
+CREATE INDEX hobby_age_idx ON DS(name, age);
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.002.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.002.update.sqlpp
new file mode 100644
index 0000000..55e842c
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.002.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;
+
+SET `wait-for-completion-feed` "true";
+CONNECT FEED DsStream TO DATASET DS;
+START FEED DsStream;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.003.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.003.query.sqlpp
new file mode 100644
index 0000000..9e6b11f
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.003.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 META().id, d.age, d.name
+FROM DS d
+WHERE d.age BETWEEN 20 AND 30
+ORDER BY META().id
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.004.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.004.query.sqlpp
new file mode 100644
index 0000000..d5b902a
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.004.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 META().id, d.age, d.name
+FROM DS d
+WHERE d.age > 29
+ORDER BY META().id
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.005.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.005.query.sqlpp
new file mode 100644
index 0000000..6a585ca
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.005.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 META().id, d.age, d.name
+FROM DS d
+WHERE d.age >= 29
+ORDER BY META().id
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.006.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.006.query.sqlpp
new file mode 100644
index 0000000..eaff1ad
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.006.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 META().id, d.age, d.name
+FROM DS d
+WHERE d.age < 29
+ORDER BY META().id
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.007.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.007.query.sqlpp
new file mode 100644
index 0000000..d6a6c08
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.007.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 META().id, d.age, d.name
+FROM DS d
+WHERE d.age <= 29
+ORDER BY META().id
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.008.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.008.query.sqlpp
new file mode 100644
index 0000000..69be129
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.008.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 META().id, d.age, d.name
+FROM DS d
+WHERE d.hobby = "reading"
+ORDER BY META().id
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.009.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.009.query.sqlpp
new file mode 100644
index 0000000..961ac70
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.009.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 META().id, d.age, d.name
+FROM DS d
+WHERE d.hobby = "reading"
+ AND d.age = 29
+ORDER BY META().id
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.010.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.010.query.sqlpp
new file mode 100644
index 0000000..327e345
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.010.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 META().id, d.age, d.name
+FROM DS d
+WHERE d.hobby = "reading"
+ AND d.age > 29
+ORDER BY META().id
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.011.get.http b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.011.get.http
new file mode 100644
index 0000000..e6efaa0
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.011.get.http
@@ -0,0 +1,19 @@
+/*
+ * 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.
+ */
+/connector?dataverseName=test&datasetName=DS
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.012.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.012.query.sqlpp
new file mode 100644
index 0000000..9e6b11f
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.012.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 META().id, d.age, d.name
+FROM DS d
+WHERE d.age BETWEEN 20 AND 30
+ORDER BY META().id
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.013.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.013.query.sqlpp
new file mode 100644
index 0000000..d5b902a
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.013.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 META().id, d.age, d.name
+FROM DS d
+WHERE d.age > 29
+ORDER BY META().id
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.014.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.014.query.sqlpp
new file mode 100644
index 0000000..6a585ca
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.014.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 META().id, d.age, d.name
+FROM DS d
+WHERE d.age >= 29
+ORDER BY META().id
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.015.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.015.query.sqlpp
new file mode 100644
index 0000000..eaff1ad
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.015.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 META().id, d.age, d.name
+FROM DS d
+WHERE d.age < 29
+ORDER BY META().id
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.016.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.016.query.sqlpp
new file mode 100644
index 0000000..d6a6c08
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.016.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 META().id, d.age, d.name
+FROM DS d
+WHERE d.age <= 29
+ORDER BY META().id
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.017.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.017.query.sqlpp
new file mode 100644
index 0000000..69be129
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.017.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 META().id, d.age, d.name
+FROM DS d
+WHERE d.hobby = "reading"
+ORDER BY META().id
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.018.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.018.query.sqlpp
new file mode 100644
index 0000000..961ac70
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.018.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 META().id, d.age, d.name
+FROM DS d
+WHERE d.hobby = "reading"
+ AND d.age = 29
+ORDER BY META().id
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.019.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.019.query.sqlpp
new file mode 100644
index 0000000..327e345
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.019.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 META().id, d.age, d.name
+FROM DS d
+WHERE d.hobby = "reading"
+ AND d.age > 29
+ORDER BY META().id
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.020.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.020.update.sqlpp
new file mode 100644
index 0000000..08652aa
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.020.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;
+
+SET `wait-for-completion-feed` "true";
+CONNECT FEED DsStream2 TO DATASET DS;
+START FEED DsStream2;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.021.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.021.query.sqlpp
new file mode 100644
index 0000000..7ff4f8c
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.021.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 META().id, d.age, d.name
+FROM DS d
+WHERE d.age = 35
+ORDER BY META().id
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.022.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.022.query.sqlpp
new file mode 100644
index 0000000..ee52cb9
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.022.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 META().id, d.age, d.name
+FROM DS d
+WHERE d.hobby = "soccer"
+ORDER BY META().id
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.023.get.http b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.023.get.http
new file mode 100644
index 0000000..e6efaa0
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.023.get.http
@@ -0,0 +1,19 @@
+/*
+ * 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.
+ */
+/connector?dataverseName=test&datasetName=DS
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.024.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.024.query.sqlpp
new file mode 100644
index 0000000..7ff4f8c
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.024.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 META().id, d.age, d.name
+FROM DS d
+WHERE d.age = 35
+ORDER BY META().id
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.025.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.025.query.sqlpp
new file mode 100644
index 0000000..ee52cb9
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/secondary-index/index-with-meta/index-with-meta.025.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 META().id, d.age, d.name
+FROM DS d
+WHERE d.hobby = "soccer"
+ORDER BY META().id
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/upsert.001.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/001/001.001.ddl.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/upsert.001.ddl.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/001/001.001.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/upsert.002.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/001/001.002.update.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/upsert.002.update.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/001/001.002.update.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/upsert.003.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/001/001.003.query.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/upsert.003.query.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/001/001.003.query.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/upsert.004.get.http b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/001/001.004.get.http
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/upsert.004.get.http
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/001/001.004.get.http
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/upsert.005.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/001/001.005.query.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/upsert.005.query.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/001/001.005.query.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/upsert.006.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/001/001.006.update.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/upsert.006.update.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/001/001.006.update.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/upsert.007.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/001/001.007.query.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/upsert.007.query.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/001/001.007.query.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/upsert.008.get.http b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/001/001.008.get.http
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/upsert.008.get.http
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/001/001.008.get.http
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/upsert.009.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/001/001.009.query.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/upsert.009.query.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/001/001.009.query.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/upsert.010.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/001/001.010.update.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/upsert.010.update.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/001/001.010.update.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/upsert.011.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/001/001.011.query.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/upsert.011.query.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/001/001.011.query.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/upsert.012.get.http b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/001/001.012.get.http
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/upsert.012.get.http
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/001/001.012.get.http
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/upsert.013.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/001/001.013.query.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/upsert.013.query.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/001/001.013.query.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/upsert.0014.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/001/001.014.update.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/upsert.0014.update.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/001/001.014.update.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/upsert.015.get.http b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/001/001.015.get.http
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/upsert.015.get.http
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/001/001.015.get.http
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/upsert.016.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/001/001.016.query.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/upsert.016.query.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/001/001.016.query.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/upsert.001.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/002/002.001.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/upsert.001.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/002/002.001.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/002/002.002.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/002/002.002.update.sqlpp
new file mode 100644
index 0000000..976ff3d
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/002/002.002.update.sqlpp
@@ -0,0 +1,28 @@
+/*
+ * 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;
+
+INSERT INTO ColumnDataset (
+ {"id":10, "a":[1, 2]},
+ {"id":20, "a":[3, 4]},
+ {"id":30, "a":[5, 6]},
+ {"id":40, "a":[7, 8]},
+ {"id":50, "a":[9, 10]}
+);
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/upsert.003.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/002/002.003.query.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/upsert.003.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/002/002.003.query.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/upsert.004.get.http b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/002/002.004.get.http
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/upsert.004.get.http
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/002/002.004.get.http
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/upsert.005.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/002/002.005.query.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/upsert.005.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/002/002.005.query.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/002/002.006.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/002/002.006.update.sqlpp
new file mode 100644
index 0000000..6ac2ae6
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/002/002.006.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;
+
+-- Upsert the record with id = 10, the length of the arrays are not the same
+UPSERT INTO ColumnDataset (
+ {"id":10, "a":[100, 100, 100, 100]}
+);
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/002/002.007.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/002/002.007.query.sqlpp
new file mode 100644
index 0000000..6bdb5fa
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/002/002.007.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;
+
+-- a newer record with id = 10 is in memory and should replace the older record with the same id
+SELECT VALUE d
+FROM ColumnDataset d
+ORDER BY d.id;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/upsert.008.get.http b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/002/002.008.get.http
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/upsert.008.get.http
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/002/002.008.get.http
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/002/002.009.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/002/002.009.query.sqlpp
new file mode 100644
index 0000000..e1f485d
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/002/002.009.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;
+
+-- Now, we have two on-disk components and both have records with id = 10. The new record should be returned
+SELECT VALUE d
+FROM ColumnDataset d
+ORDER BY d.id;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/upsert.0014.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/002/002.010.update.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/upsert.0014.update.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/002/002.010.update.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/upsert.016.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/002/002.011.query.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/upsert.016.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/002/002.011.query.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/rebalance/rebalance.03.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/rebalance/rebalance.03.adm
new file mode 100644
index 0000000..5e38c96
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/rebalance/rebalance.03.adm
@@ -0,0 +1,5 @@
+{ "order_priority": "1-URGENT", "count": 9 }
+{ "order_priority": "2-HIGH", "count": 7 }
+{ "order_priority": "3-MEDIUM", "count": 9 }
+{ "order_priority": "4-NOT SPECIFIED", "count": 8 }
+{ "order_priority": "5-LOW", "count": 12 }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/rebalance/rebalance.04.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/rebalance/rebalance.04.adm
new file mode 100644
index 0000000..4b9eb7d
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/rebalance/rebalance.04.adm
@@ -0,0 +1 @@
+{"results":"successful"}
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/rebalance/rebalance.05.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/rebalance/rebalance.05.adm
new file mode 100644
index 0000000..af9759b
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/rebalance/rebalance.05.adm
@@ -0,0 +1 @@
+{"keys":"l_orderkey,l_linenumber","type":{"type":"org.apache.asterix.om.types.ARecordType","name":"LineItemType","open":false,"fields":[{"l_orderkey":{"type":"AInt64"}},{"l_partkey":{"type":"AInt64"}},{"l_suppkey":{"type":"AInt64"}},{"l_linenumber":{"type":"AInt64"}},{"l_quantity":{"type":"ADouble"}},{"l_extendedprice":{"type":"ADouble"}},{"l_discount":{"type":"ADouble"}},{"l_tax":{"type":"ADouble"}},{"l_returnflag":{"type":"AString"}},{"l_linestatus":{"type":"AString"}},{"l_shipdate":{"type":"AString"}},{"l_commitdate":{"type":"AString"}},{"l_receiptdate":{"type":"AString"}},{"l_shipinstruct":{"type":"AString"}},{"l_shipmode":{"type":"AString"}},{"l_comment":{"type":"AString"}}]},"splits":[{"ip":"127.0.0.1","path":"storage/partition_0/tpch1/LineItem/1/LineItem"},{"ip":"127.0.0.1","path":"storage/partition_1/tpch1/LineItem/1/LineItem"}]}
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/rebalance/rebalance.06.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/rebalance/rebalance.06.adm
new file mode 100644
index 0000000..0003101
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/rebalance/rebalance.06.adm
@@ -0,0 +1 @@
+{"keys":"o_orderkey","type":{"type":"org.apache.asterix.om.types.ARecordType","name":"OrderType","open":false,"fields":[{"o_orderkey":{"type":"AInt64"}},{"o_custkey":{"type":"AInt64"}},{"o_orderstatus":{"type":"AString"}},{"o_totalprice":{"type":"ADouble"}},{"o_orderdate":{"type":"AString"}},{"o_orderpriority":{"type":"AString"}},{"o_clerk":{"type":"AString"}},{"o_shippriority":{"type":"AInt64"}},{"o_comment":{"type":"AString"}}]},"splits":[{"ip":"127.0.0.1","path":"storage/partition_0/tpch2/Orders/1/Orders"},{"ip":"127.0.0.1","path":"storage/partition_1/tpch2/Orders/1/Orders"}]}
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/rebalance/rebalance.07.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/rebalance/rebalance.07.adm
new file mode 100644
index 0000000..5e38c96
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/rebalance/rebalance.07.adm
@@ -0,0 +1,5 @@
+{ "order_priority": "1-URGENT", "count": 9 }
+{ "order_priority": "2-HIGH", "count": 7 }
+{ "order_priority": "3-MEDIUM", "count": 9 }
+{ "order_priority": "4-NOT SPECIFIED", "count": 8 }
+{ "order_priority": "5-LOW", "count": 12 }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/rebalance/rebalance.08.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/rebalance/rebalance.08.adm
new file mode 100644
index 0000000..356deeb
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/rebalance/rebalance.08.adm
@@ -0,0 +1 @@
+{ "DatasetName": "LineItem", "GroupName": "tpch1.LineItem_1", "rebalanceCount": 1 }
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/rebalance/rebalance.09.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/rebalance/rebalance.09.adm
new file mode 100644
index 0000000..0f829fa
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/rebalance/rebalance.09.adm
@@ -0,0 +1 @@
+{ "DatasetName": "Orders", "GroupName": "tpch2.Orders_1", "rebalanceCount": 1 }
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/rebalance/rebalance.10.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/rebalance/rebalance.10.adm
new file mode 100644
index 0000000..4b9eb7d
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/rebalance/rebalance.10.adm
@@ -0,0 +1 @@
+{"results":"successful"}
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/rebalance/rebalance.11.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/rebalance/rebalance.11.adm
new file mode 100644
index 0000000..d970119
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/rebalance/rebalance.11.adm
@@ -0,0 +1 @@
+{"keys":"l_orderkey,l_linenumber","type":{"type":"org.apache.asterix.om.types.ARecordType","name":"LineItemType","open":false,"fields":[{"l_orderkey":{"type":"AInt64"}},{"l_partkey":{"type":"AInt64"}},{"l_suppkey":{"type":"AInt64"}},{"l_linenumber":{"type":"AInt64"}},{"l_quantity":{"type":"ADouble"}},{"l_extendedprice":{"type":"ADouble"}},{"l_discount":{"type":"ADouble"}},{"l_tax":{"type":"ADouble"}},{"l_returnflag":{"type":"AString"}},{"l_linestatus":{"type":"AString"}},{"l_shipdate":{"type":"AString"}},{"l_commitdate":{"type":"AString"}},{"l_receiptdate":{"type":"AString"}},{"l_shipinstruct":{"type":"AString"}},{"l_shipmode":{"type":"AString"}},{"l_comment":{"type":"AString"}}]},"splits":[{"ip":"127.0.0.1","path":"storage/partition_0/tpch1/LineItem/2/LineItem"},{"ip":"127.0.0.1","path":"storage/partition_1/tpch1/LineItem/2/LineItem"},{"ip":"127.0.0.1","path":"storage/partition_2/tpch1/LineItem/2/LineItem"},{"ip":"127.0.0.1","path":"storage/partition_3/tpch1/LineItem/2/LineItem"}]}
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/rebalance/rebalance.12.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/rebalance/rebalance.12.adm
new file mode 100644
index 0000000..38d2eac
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/rebalance/rebalance.12.adm
@@ -0,0 +1 @@
+{"keys":"o_orderkey","type":{"type":"org.apache.asterix.om.types.ARecordType","name":"OrderType","open":false,"fields":[{"o_orderkey":{"type":"AInt64"}},{"o_custkey":{"type":"AInt64"}},{"o_orderstatus":{"type":"AString"}},{"o_totalprice":{"type":"ADouble"}},{"o_orderdate":{"type":"AString"}},{"o_orderpriority":{"type":"AString"}},{"o_clerk":{"type":"AString"}},{"o_shippriority":{"type":"AInt64"}},{"o_comment":{"type":"AString"}}]},"splits":[{"ip":"127.0.0.1","path":"storage/partition_0/tpch2/Orders/2/Orders"},{"ip":"127.0.0.1","path":"storage/partition_1/tpch2/Orders/2/Orders"},{"ip":"127.0.0.1","path":"storage/partition_2/tpch2/Orders/2/Orders"},{"ip":"127.0.0.1","path":"storage/partition_3/tpch2/Orders/2/Orders"}]}
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/rebalance/rebalance.13.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/rebalance/rebalance.13.adm
new file mode 100644
index 0000000..4405aa0
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/rebalance/rebalance.13.adm
@@ -0,0 +1,5 @@
+{ "order_priority": "1-URGENT", "count": 9 }
+{ "order_priority": "2-HIGH", "count": 7 }
+{ "order_priority": "3-MEDIUM", "count": 9 }
+{ "order_priority": "4-NOT SPECIFIED", "count": 8 }
+{ "order_priority": "5-LOW", "count": 12 }
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/rebalance/rebalance.14.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/rebalance/rebalance.14.adm
new file mode 100644
index 0000000..3c8a3de
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/rebalance/rebalance.14.adm
@@ -0,0 +1 @@
+{ "DatasetName": "LineItem", "GroupName": "tpch1.LineItem_2", "rebalanceCount": 2 }
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/rebalance/rebalance.15.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/rebalance/rebalance.15.adm
new file mode 100644
index 0000000..06a2a13
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/rebalance/rebalance.15.adm
@@ -0,0 +1 @@
+{ "DatasetName": "Orders", "GroupName": "tpch2.Orders_2", "rebalanceCount": 2 }
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/rebalance/rebalance.16.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/rebalance/rebalance.16.adm
new file mode 100644
index 0000000..6083575
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/rebalance/rebalance.16.adm
@@ -0,0 +1 @@
+{ "DatasetName": "Dataset", "GroupName": "MetadataGroup" }
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-1/use-case-1.03.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-1/use-case-1.03.adm
new file mode 100644
index 0000000..fcc26c8
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-1/use-case-1.03.adm
@@ -0,0 +1 @@
+{ "$1": 99 }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-1/use-case-1.04.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-1/use-case-1.04.adm
new file mode 100644
index 0000000..f9dd3d2
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-1/use-case-1.04.adm
@@ -0,0 +1 @@
+{"keys":"business_id","type":{"type":"org.apache.asterix.om.types.ARecordType","name":"CheckinType","open":true,"fields":[{"business_id":{"type":"AString"}}]},"splits":[{"ip":"127.0.0.1","path":"storage/partition_0/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_1/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_2/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_3/TestYelp/YelpCheckin/0/YelpCheckin"}]}
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-1/use-case-1.05.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-1/use-case-1.05.adm
new file mode 100644
index 0000000..fcc26c8
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-1/use-case-1.05.adm
@@ -0,0 +1 @@
+{ "$1": 99 }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-1/use-case-1.07.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-1/use-case-1.07.adm
new file mode 100644
index 0000000..3e1a847
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-1/use-case-1.07.adm
@@ -0,0 +1 @@
+{ "$1": 7 }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-1/use-case-1.08.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-1/use-case-1.08.adm
new file mode 100644
index 0000000..f9dd3d2
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-1/use-case-1.08.adm
@@ -0,0 +1 @@
+{"keys":"business_id","type":{"type":"org.apache.asterix.om.types.ARecordType","name":"CheckinType","open":true,"fields":[{"business_id":{"type":"AString"}}]},"splits":[{"ip":"127.0.0.1","path":"storage/partition_0/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_1/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_2/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_3/TestYelp/YelpCheckin/0/YelpCheckin"}]}
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-1/use-case-1.09.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-1/use-case-1.09.adm
new file mode 100644
index 0000000..3e1a847
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-1/use-case-1.09.adm
@@ -0,0 +1 @@
+{ "$1": 7 }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-1/use-case-1.11.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-1/use-case-1.11.adm
new file mode 100644
index 0000000..dc7ba8b
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-1/use-case-1.11.adm
@@ -0,0 +1 @@
+{ "$1": 101 }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-1/use-case-1.12.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-1/use-case-1.12.adm
new file mode 100644
index 0000000..f9dd3d2
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-1/use-case-1.12.adm
@@ -0,0 +1 @@
+{"keys":"business_id","type":{"type":"org.apache.asterix.om.types.ARecordType","name":"CheckinType","open":true,"fields":[{"business_id":{"type":"AString"}}]},"splits":[{"ip":"127.0.0.1","path":"storage/partition_0/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_1/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_2/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_3/TestYelp/YelpCheckin/0/YelpCheckin"}]}
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-1/use-case-1.13.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-1/use-case-1.13.adm
new file mode 100644
index 0000000..dc7ba8b
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-1/use-case-1.13.adm
@@ -0,0 +1 @@
+{ "$1": 101 }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-2/use-case-2.03.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-2/use-case-2.03.adm
new file mode 100644
index 0000000..dc7ba8b
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-2/use-case-2.03.adm
@@ -0,0 +1 @@
+{ "$1": 101 }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-2/use-case-2.04.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-2/use-case-2.04.adm
new file mode 100644
index 0000000..f9dd3d2
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-2/use-case-2.04.adm
@@ -0,0 +1 @@
+{"keys":"business_id","type":{"type":"org.apache.asterix.om.types.ARecordType","name":"CheckinType","open":true,"fields":[{"business_id":{"type":"AString"}}]},"splits":[{"ip":"127.0.0.1","path":"storage/partition_0/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_1/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_2/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_3/TestYelp/YelpCheckin/0/YelpCheckin"}]}
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-2/use-case-2.05.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-2/use-case-2.05.adm
new file mode 100644
index 0000000..dc7ba8b
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-2/use-case-2.05.adm
@@ -0,0 +1 @@
+{ "$1": 101 }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-2/use-case-2.07.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-2/use-case-2.07.adm
new file mode 100644
index 0000000..3e1a847
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-2/use-case-2.07.adm
@@ -0,0 +1 @@
+{ "$1": 7 }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-2/use-case-2.08.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-2/use-case-2.08.adm
new file mode 100644
index 0000000..f9dd3d2
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-2/use-case-2.08.adm
@@ -0,0 +1 @@
+{"keys":"business_id","type":{"type":"org.apache.asterix.om.types.ARecordType","name":"CheckinType","open":true,"fields":[{"business_id":{"type":"AString"}}]},"splits":[{"ip":"127.0.0.1","path":"storage/partition_0/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_1/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_2/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_3/TestYelp/YelpCheckin/0/YelpCheckin"}]}
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-2/use-case-2.09.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-2/use-case-2.09.adm
new file mode 100644
index 0000000..3e1a847
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-2/use-case-2.09.adm
@@ -0,0 +1 @@
+{ "$1": 7 }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-2/use-case-2.11.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-2/use-case-2.11.adm
new file mode 100644
index 0000000..dc7ba8b
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-2/use-case-2.11.adm
@@ -0,0 +1 @@
+{ "$1": 101 }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-2/use-case-2.12.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-2/use-case-2.12.adm
new file mode 100644
index 0000000..f9dd3d2
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-2/use-case-2.12.adm
@@ -0,0 +1 @@
+{"keys":"business_id","type":{"type":"org.apache.asterix.om.types.ARecordType","name":"CheckinType","open":true,"fields":[{"business_id":{"type":"AString"}}]},"splits":[{"ip":"127.0.0.1","path":"storage/partition_0/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_1/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_2/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_3/TestYelp/YelpCheckin/0/YelpCheckin"}]}
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-2/use-case-2.13.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-2/use-case-2.13.adm
new file mode 100644
index 0000000..dc7ba8b
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-2/use-case-2.13.adm
@@ -0,0 +1 @@
+{ "$1": 101 }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-3/use-case-3.03.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-3/use-case-3.03.adm
new file mode 100644
index 0000000..dc7ba8b
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-3/use-case-3.03.adm
@@ -0,0 +1 @@
+{ "$1": 101 }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-3/use-case-3.04.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-3/use-case-3.04.adm
new file mode 100644
index 0000000..f9dd3d2
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-3/use-case-3.04.adm
@@ -0,0 +1 @@
+{"keys":"business_id","type":{"type":"org.apache.asterix.om.types.ARecordType","name":"CheckinType","open":true,"fields":[{"business_id":{"type":"AString"}}]},"splits":[{"ip":"127.0.0.1","path":"storage/partition_0/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_1/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_2/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_3/TestYelp/YelpCheckin/0/YelpCheckin"}]}
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-3/use-case-3.05.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-3/use-case-3.05.adm
new file mode 100644
index 0000000..dc7ba8b
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-3/use-case-3.05.adm
@@ -0,0 +1 @@
+{ "$1": 101 }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-3/use-case-3.07.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-3/use-case-3.07.adm
new file mode 100644
index 0000000..3e1a847
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-3/use-case-3.07.adm
@@ -0,0 +1 @@
+{ "$1": 7 }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-3/use-case-3.08.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-3/use-case-3.08.adm
new file mode 100644
index 0000000..f9dd3d2
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-3/use-case-3.08.adm
@@ -0,0 +1 @@
+{"keys":"business_id","type":{"type":"org.apache.asterix.om.types.ARecordType","name":"CheckinType","open":true,"fields":[{"business_id":{"type":"AString"}}]},"splits":[{"ip":"127.0.0.1","path":"storage/partition_0/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_1/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_2/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_3/TestYelp/YelpCheckin/0/YelpCheckin"}]}
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-3/use-case-3.09.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-3/use-case-3.09.adm
new file mode 100644
index 0000000..3e1a847
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-3/use-case-3.09.adm
@@ -0,0 +1 @@
+{ "$1": 7 }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-3/use-case-3.11.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-3/use-case-3.11.adm
new file mode 100644
index 0000000..dc7ba8b
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-3/use-case-3.11.adm
@@ -0,0 +1 @@
+{ "$1": 101 }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-3/use-case-3.12.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-3/use-case-3.12.adm
new file mode 100644
index 0000000..f9dd3d2
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-3/use-case-3.12.adm
@@ -0,0 +1 @@
+{"keys":"business_id","type":{"type":"org.apache.asterix.om.types.ARecordType","name":"CheckinType","open":true,"fields":[{"business_id":{"type":"AString"}}]},"splits":[{"ip":"127.0.0.1","path":"storage/partition_0/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_1/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_2/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_3/TestYelp/YelpCheckin/0/YelpCheckin"}]}
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-3/use-case-3.13.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-3/use-case-3.13.adm
new file mode 100644
index 0000000..dc7ba8b
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-3/use-case-3.13.adm
@@ -0,0 +1 @@
+{ "$1": 101 }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-4/use-case-4.03.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-4/use-case-4.03.adm
new file mode 100644
index 0000000..dc7ba8b
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-4/use-case-4.03.adm
@@ -0,0 +1 @@
+{ "$1": 101 }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-4/use-case-4.04.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-4/use-case-4.04.adm
new file mode 100644
index 0000000..f9dd3d2
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-4/use-case-4.04.adm
@@ -0,0 +1 @@
+{"keys":"business_id","type":{"type":"org.apache.asterix.om.types.ARecordType","name":"CheckinType","open":true,"fields":[{"business_id":{"type":"AString"}}]},"splits":[{"ip":"127.0.0.1","path":"storage/partition_0/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_1/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_2/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_3/TestYelp/YelpCheckin/0/YelpCheckin"}]}
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-4/use-case-4.05.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-4/use-case-4.05.adm
new file mode 100644
index 0000000..dc7ba8b
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-4/use-case-4.05.adm
@@ -0,0 +1 @@
+{ "$1": 101 }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-4/use-case-4.07.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-4/use-case-4.07.adm
new file mode 100644
index 0000000..3e1a847
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-4/use-case-4.07.adm
@@ -0,0 +1 @@
+{ "$1": 7 }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-4/use-case-4.08.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-4/use-case-4.08.adm
new file mode 100644
index 0000000..f9dd3d2
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-4/use-case-4.08.adm
@@ -0,0 +1 @@
+{"keys":"business_id","type":{"type":"org.apache.asterix.om.types.ARecordType","name":"CheckinType","open":true,"fields":[{"business_id":{"type":"AString"}}]},"splits":[{"ip":"127.0.0.1","path":"storage/partition_0/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_1/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_2/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_3/TestYelp/YelpCheckin/0/YelpCheckin"}]}
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-4/use-case-4.09.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-4/use-case-4.09.adm
new file mode 100644
index 0000000..3e1a847
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-4/use-case-4.09.adm
@@ -0,0 +1 @@
+{ "$1": 7 }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-4/use-case-4.11.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-4/use-case-4.11.adm
new file mode 100644
index 0000000..dc7ba8b
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-4/use-case-4.11.adm
@@ -0,0 +1 @@
+{ "$1": 101 }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-4/use-case-4.12.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-4/use-case-4.12.adm
new file mode 100644
index 0000000..f9dd3d2
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-4/use-case-4.12.adm
@@ -0,0 +1 @@
+{"keys":"business_id","type":{"type":"org.apache.asterix.om.types.ARecordType","name":"CheckinType","open":true,"fields":[{"business_id":{"type":"AString"}}]},"splits":[{"ip":"127.0.0.1","path":"storage/partition_0/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_1/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_2/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_3/TestYelp/YelpCheckin/0/YelpCheckin"}]}
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-4/use-case-4.13.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-4/use-case-4.13.adm
new file mode 100644
index 0000000..dc7ba8b
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/use-case-4/use-case-4.13.adm
@@ -0,0 +1 @@
+{ "$1": 101 }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.03.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.03.adm
new file mode 100644
index 0000000..fcc26c8
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.03.adm
@@ -0,0 +1 @@
+{ "$1": 99 }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.04.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.04.adm
new file mode 100644
index 0000000..e9774d4
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.04.adm
@@ -0,0 +1 @@
+{"keys":"checkin_id","type":{"type":"org.apache.asterix.om.types.ARecordType","name":"CheckinType","open":true,"fields":[{"checkin_id":{"type":"AInt64"}}]},"splits":[{"ip":"127.0.0.1","path":"storage/partition_0/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_1/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_2/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_3/TestYelp/YelpCheckin/0/YelpCheckin"}]}
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.05.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.05.adm
new file mode 100644
index 0000000..fcc26c8
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.05.adm
@@ -0,0 +1 @@
+{ "$1": 99 }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.07.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.07.adm
new file mode 100644
index 0000000..3e1a847
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.07.adm
@@ -0,0 +1 @@
+{ "$1": 7 }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.08.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.08.adm
new file mode 100644
index 0000000..e9774d4
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.08.adm
@@ -0,0 +1 @@
+{"keys":"checkin_id","type":{"type":"org.apache.asterix.om.types.ARecordType","name":"CheckinType","open":true,"fields":[{"checkin_id":{"type":"AInt64"}}]},"splits":[{"ip":"127.0.0.1","path":"storage/partition_0/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_1/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_2/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_3/TestYelp/YelpCheckin/0/YelpCheckin"}]}
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.09.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.09.adm
new file mode 100644
index 0000000..3e1a847
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.09.adm
@@ -0,0 +1 @@
+{ "$1": 7 }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.11.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.11.adm
new file mode 100644
index 0000000..dc7ba8b
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.11.adm
@@ -0,0 +1 @@
+{ "$1": 101 }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.12.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.12.adm
new file mode 100644
index 0000000..e9774d4
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.12.adm
@@ -0,0 +1 @@
+{"keys":"checkin_id","type":{"type":"org.apache.asterix.om.types.ARecordType","name":"CheckinType","open":true,"fields":[{"checkin_id":{"type":"AInt64"}}]},"splits":[{"ip":"127.0.0.1","path":"storage/partition_0/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_1/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_2/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_3/TestYelp/YelpCheckin/0/YelpCheckin"}]}
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.13.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.13.adm
new file mode 100644
index 0000000..dc7ba8b
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-additional-atomic-index/with-additional-atomic-index.13.adm
@@ -0,0 +1 @@
+{ "$1": 101 }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-composite-sk/with-composite-sk.03.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-composite-sk/with-composite-sk.03.adm
new file mode 100644
index 0000000..dc7ba8b
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-composite-sk/with-composite-sk.03.adm
@@ -0,0 +1 @@
+{ "$1": 101 }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-composite-sk/with-composite-sk.04.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-composite-sk/with-composite-sk.04.adm
new file mode 100644
index 0000000..e9774d4
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-composite-sk/with-composite-sk.04.adm
@@ -0,0 +1 @@
+{"keys":"checkin_id","type":{"type":"org.apache.asterix.om.types.ARecordType","name":"CheckinType","open":true,"fields":[{"checkin_id":{"type":"AInt64"}}]},"splits":[{"ip":"127.0.0.1","path":"storage/partition_0/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_1/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_2/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_3/TestYelp/YelpCheckin/0/YelpCheckin"}]}
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-composite-sk/with-composite-sk.05.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-composite-sk/with-composite-sk.05.adm
new file mode 100644
index 0000000..dc7ba8b
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-composite-sk/with-composite-sk.05.adm
@@ -0,0 +1 @@
+{ "$1": 101 }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-composite-sk/with-composite-sk.07.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-composite-sk/with-composite-sk.07.adm
new file mode 100644
index 0000000..3e1a847
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-composite-sk/with-composite-sk.07.adm
@@ -0,0 +1 @@
+{ "$1": 7 }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-composite-sk/with-composite-sk.08.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-composite-sk/with-composite-sk.08.adm
new file mode 100644
index 0000000..e9774d4
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-composite-sk/with-composite-sk.08.adm
@@ -0,0 +1 @@
+{"keys":"checkin_id","type":{"type":"org.apache.asterix.om.types.ARecordType","name":"CheckinType","open":true,"fields":[{"checkin_id":{"type":"AInt64"}}]},"splits":[{"ip":"127.0.0.1","path":"storage/partition_0/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_1/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_2/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_3/TestYelp/YelpCheckin/0/YelpCheckin"}]}
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-composite-sk/with-composite-sk.09.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-composite-sk/with-composite-sk.09.adm
new file mode 100644
index 0000000..3e1a847
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-composite-sk/with-composite-sk.09.adm
@@ -0,0 +1 @@
+{ "$1": 7 }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-composite-sk/with-composite-sk.11.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-composite-sk/with-composite-sk.11.adm
new file mode 100644
index 0000000..dc7ba8b
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-composite-sk/with-composite-sk.11.adm
@@ -0,0 +1 @@
+{ "$1": 101 }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-composite-sk/with-composite-sk.12.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-composite-sk/with-composite-sk.12.adm
new file mode 100644
index 0000000..e9774d4
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-composite-sk/with-composite-sk.12.adm
@@ -0,0 +1 @@
+{"keys":"checkin_id","type":{"type":"org.apache.asterix.om.types.ARecordType","name":"CheckinType","open":true,"fields":[{"checkin_id":{"type":"AInt64"}}]},"splits":[{"ip":"127.0.0.1","path":"storage/partition_0/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_1/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_2/TestYelp/YelpCheckin/0/YelpCheckin"},{"ip":"127.0.0.1","path":"storage/partition_3/TestYelp/YelpCheckin/0/YelpCheckin"}]}
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-composite-sk/with-composite-sk.13.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-composite-sk/with-composite-sk.13.adm
new file mode 100644
index 0000000..dc7ba8b
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/array-index/with-composite-sk/with-composite-sk.13.adm
@@ -0,0 +1 @@
+{ "$1": 101 }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-bulkload/after-bulkload.003.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-bulkload/after-bulkload.003.adm
new file mode 100644
index 0000000..6fa1293
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-bulkload/after-bulkload.003.adm
@@ -0,0 +1 @@
+{ "business_id": "--1UhMGODdWsrMastO9DZw" }
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-bulkload/after-bulkload.004.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-bulkload/after-bulkload.004.adm
new file mode 100644
index 0000000..062a359
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-bulkload/after-bulkload.004.adm
@@ -0,0 +1 @@
+[ "2015-04-11 13:14:14", "2015-11-21 16:05:56", "2016-05-06 14:10:04", "2017-08-09 15:15:10", "2017-10-21 15:12:56" ]
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-bulkload/after-bulkload.006.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-bulkload/after-bulkload.006.adm
new file mode 100644
index 0000000..6fa1293
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-bulkload/after-bulkload.006.adm
@@ -0,0 +1 @@
+{ "business_id": "--1UhMGODdWsrMastO9DZw" }
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-bulkload/after-bulkload.007.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-bulkload/after-bulkload.007.adm
new file mode 100644
index 0000000..062a359
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-bulkload/after-bulkload.007.adm
@@ -0,0 +1 @@
+[ "2015-04-11 13:14:14", "2015-11-21 16:05:56", "2016-05-06 14:10:04", "2017-08-09 15:15:10", "2017-10-21 15:12:56" ]
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-insert/after-insert.003.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-insert/after-insert.003.adm
new file mode 100644
index 0000000..6fa1293
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-insert/after-insert.003.adm
@@ -0,0 +1 @@
+{ "business_id": "--1UhMGODdWsrMastO9DZw" }
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-insert/after-insert.004.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-insert/after-insert.004.adm
new file mode 100644
index 0000000..062a359
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-insert/after-insert.004.adm
@@ -0,0 +1 @@
+[ "2015-04-11 13:14:14", "2015-11-21 16:05:56", "2016-05-06 14:10:04", "2017-08-09 15:15:10", "2017-10-21 15:12:56" ]
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-insert/after-insert.006.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-insert/after-insert.006.adm
new file mode 100644
index 0000000..6fa1293
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-insert/after-insert.006.adm
@@ -0,0 +1 @@
+{ "business_id": "--1UhMGODdWsrMastO9DZw" }
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-insert/after-insert.007.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-insert/after-insert.007.adm
new file mode 100644
index 0000000..062a359
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-insert/after-insert.007.adm
@@ -0,0 +1 @@
+[ "2015-04-11 13:14:14", "2015-11-21 16:05:56", "2016-05-06 14:10:04", "2017-08-09 15:15:10", "2017-10-21 15:12:56" ]
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.003.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.003.adm
new file mode 100644
index 0000000..c7dc23c
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.003.adm
@@ -0,0 +1 @@
+{"keys":"id","type":{"type":"org.apache.asterix.om.types.ARecordType","name":"DataType","open":true,"fields":[{"name":{"type":"AString"}},{"age":{"type":"AInt64"}},{"hobby":{"type":"AString"}}]},"splits":[{"ip":"127.0.0.1","path":"storage/partition_0/test/DS/0/DS"},{"ip":"127.0.0.1","path":"storage/partition_1/test/DS/0/DS"},{"ip":"127.0.0.1","path":"storage/partition_2/test/DS/0/DS"},{"ip":"127.0.0.1","path":"storage/partition_3/test/DS/0/DS"}]}
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.005.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.005.adm
new file mode 100644
index 0000000..707fae0
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.005.adm
@@ -0,0 +1,4 @@
+{ "id": 13071782, "age": 24, "name": "Joe Dana" }
+{ "id": 26237702, "age": 28, "name": "Watson Jordon" }
+{ "id": 52037425, "age": 30, "name": "Scott Scott" }
+{ "id": 76041664, "age": 29, "name": "John Mad" }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.006.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.006.adm
new file mode 100644
index 0000000..7f83f16
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.006.adm
@@ -0,0 +1 @@
+{ "id": 26237702, "age": 28, "name": "Watson Jordon" }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.008.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.008.adm
new file mode 100644
index 0000000..c7dc23c
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.008.adm
@@ -0,0 +1 @@
+{"keys":"id","type":{"type":"org.apache.asterix.om.types.ARecordType","name":"DataType","open":true,"fields":[{"name":{"type":"AString"}},{"age":{"type":"AInt64"}},{"hobby":{"type":"AString"}}]},"splits":[{"ip":"127.0.0.1","path":"storage/partition_0/test/DS/0/DS"},{"ip":"127.0.0.1","path":"storage/partition_1/test/DS/0/DS"},{"ip":"127.0.0.1","path":"storage/partition_2/test/DS/0/DS"},{"ip":"127.0.0.1","path":"storage/partition_3/test/DS/0/DS"}]}
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.009.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.009.adm
new file mode 100644
index 0000000..870dbf0
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.009.adm
@@ -0,0 +1,5 @@
+{ "id": 5, "age": 28, "name": "Watson Jordon" }
+{ "id": 13071782, "age": 24, "name": "Joe Dana" }
+{ "id": 26237702, "age": 28, "name": "Watson Jordon" }
+{ "id": 52037425, "age": 30, "name": "Scott Scott" }
+{ "id": 76041664, "age": 29, "name": "John Mad" }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.010.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.010.adm
new file mode 100644
index 0000000..a47f9db
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.010.adm
@@ -0,0 +1,2 @@
+{ "id": 5, "age": 28, "name": "Watson Jordon" }
+{ "id": 26237702, "age": 28, "name": "Watson Jordon" }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.012.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.012.adm
new file mode 100644
index 0000000..c7dc23c
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.012.adm
@@ -0,0 +1 @@
+{"keys":"id","type":{"type":"org.apache.asterix.om.types.ARecordType","name":"DataType","open":true,"fields":[{"name":{"type":"AString"}},{"age":{"type":"AInt64"}},{"hobby":{"type":"AString"}}]},"splits":[{"ip":"127.0.0.1","path":"storage/partition_0/test/DS/0/DS"},{"ip":"127.0.0.1","path":"storage/partition_1/test/DS/0/DS"},{"ip":"127.0.0.1","path":"storage/partition_2/test/DS/0/DS"},{"ip":"127.0.0.1","path":"storage/partition_3/test/DS/0/DS"}]}
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.013.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.013.adm
new file mode 100644
index 0000000..870dbf0
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.013.adm
@@ -0,0 +1,5 @@
+{ "id": 5, "age": 28, "name": "Watson Jordon" }
+{ "id": 13071782, "age": 24, "name": "Joe Dana" }
+{ "id": 26237702, "age": 28, "name": "Watson Jordon" }
+{ "id": 52037425, "age": 30, "name": "Scott Scott" }
+{ "id": 76041664, "age": 29, "name": "John Mad" }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.014.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.014.adm
new file mode 100644
index 0000000..a47f9db
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/create-index/after-upsert-with-meta/after-upsert-with-meta.014.adm
@@ -0,0 +1,2 @@
+{ "id": 5, "age": 28, "name": "Watson Jordon" }
+{ "id": 26237702, "age": 28, "name": "Watson Jordon" }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.003.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.003.adm
new file mode 100644
index 0000000..707fae0
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.003.adm
@@ -0,0 +1,4 @@
+{ "id": 13071782, "age": 24, "name": "Joe Dana" }
+{ "id": 26237702, "age": 28, "name": "Watson Jordon" }
+{ "id": 52037425, "age": 30, "name": "Scott Scott" }
+{ "id": 76041664, "age": 29, "name": "John Mad" }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.004.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.004.adm
new file mode 100644
index 0000000..5fd0ed4
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.004.adm
@@ -0,0 +1,6 @@
+{ "id": 32571888, "age": 45, "name": "Mat Steve" }
+{ "id": 39225791, "age": 35, "name": "Sandy Donald" }
+{ "id": 45962603, "age": 40, "name": "Dan David" }
+{ "id": 51041435, "age": 32, "name": "Robert Moore" }
+{ "id": 52037425, "age": 30, "name": "Scott Scott" }
+{ "id": 86897761, "age": 36, "name": "Sandra Pec" }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.005.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.005.adm
new file mode 100644
index 0000000..69955d6
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.005.adm
@@ -0,0 +1,7 @@
+{ "id": 32571888, "age": 45, "name": "Mat Steve" }
+{ "id": 39225791, "age": 35, "name": "Sandy Donald" }
+{ "id": 45962603, "age": 40, "name": "Dan David" }
+{ "id": 51041435, "age": 32, "name": "Robert Moore" }
+{ "id": 52037425, "age": 30, "name": "Scott Scott" }
+{ "id": 76041664, "age": 29, "name": "John Mad" }
+{ "id": 86897761, "age": 36, "name": "Sandra Pec" }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.006.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.006.adm
new file mode 100644
index 0000000..ae31219
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.006.adm
@@ -0,0 +1,2 @@
+{ "id": 13071782, "age": 24, "name": "Joe Dana" }
+{ "id": 26237702, "age": 28, "name": "Watson Jordon" }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.007.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.007.adm
new file mode 100644
index 0000000..49002dc
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.007.adm
@@ -0,0 +1,3 @@
+{ "id": 13071782, "age": 24, "name": "Joe Dana" }
+{ "id": 26237702, "age": 28, "name": "Watson Jordon" }
+{ "id": 76041664, "age": 29, "name": "John Mad" }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.008.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.008.adm
new file mode 100644
index 0000000..14874ed
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.008.adm
@@ -0,0 +1,2 @@
+{ "id": 51041435, "age": 32, "name": "Robert Moore" }
+{ "id": 76041664, "age": 29, "name": "John Mad" }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.009.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.009.adm
new file mode 100644
index 0000000..84eebd9
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.009.adm
@@ -0,0 +1 @@
+{ "id": 76041664, "age": 29, "name": "John Mad" }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.010.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.010.adm
new file mode 100644
index 0000000..9995269
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.010.adm
@@ -0,0 +1 @@
+{ "id": 51041435, "age": 32, "name": "Robert Moore" }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.011.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.011.adm
new file mode 100644
index 0000000..c7dc23c
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.011.adm
@@ -0,0 +1 @@
+{"keys":"id","type":{"type":"org.apache.asterix.om.types.ARecordType","name":"DataType","open":true,"fields":[{"name":{"type":"AString"}},{"age":{"type":"AInt64"}},{"hobby":{"type":"AString"}}]},"splits":[{"ip":"127.0.0.1","path":"storage/partition_0/test/DS/0/DS"},{"ip":"127.0.0.1","path":"storage/partition_1/test/DS/0/DS"},{"ip":"127.0.0.1","path":"storage/partition_2/test/DS/0/DS"},{"ip":"127.0.0.1","path":"storage/partition_3/test/DS/0/DS"}]}
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.012.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.012.adm
new file mode 100644
index 0000000..707fae0
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.012.adm
@@ -0,0 +1,4 @@
+{ "id": 13071782, "age": 24, "name": "Joe Dana" }
+{ "id": 26237702, "age": 28, "name": "Watson Jordon" }
+{ "id": 52037425, "age": 30, "name": "Scott Scott" }
+{ "id": 76041664, "age": 29, "name": "John Mad" }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.013.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.013.adm
new file mode 100644
index 0000000..5fd0ed4
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.013.adm
@@ -0,0 +1,6 @@
+{ "id": 32571888, "age": 45, "name": "Mat Steve" }
+{ "id": 39225791, "age": 35, "name": "Sandy Donald" }
+{ "id": 45962603, "age": 40, "name": "Dan David" }
+{ "id": 51041435, "age": 32, "name": "Robert Moore" }
+{ "id": 52037425, "age": 30, "name": "Scott Scott" }
+{ "id": 86897761, "age": 36, "name": "Sandra Pec" }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.014.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.014.adm
new file mode 100644
index 0000000..69955d6
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.014.adm
@@ -0,0 +1,7 @@
+{ "id": 32571888, "age": 45, "name": "Mat Steve" }
+{ "id": 39225791, "age": 35, "name": "Sandy Donald" }
+{ "id": 45962603, "age": 40, "name": "Dan David" }
+{ "id": 51041435, "age": 32, "name": "Robert Moore" }
+{ "id": 52037425, "age": 30, "name": "Scott Scott" }
+{ "id": 76041664, "age": 29, "name": "John Mad" }
+{ "id": 86897761, "age": 36, "name": "Sandra Pec" }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.015.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.015.adm
new file mode 100644
index 0000000..ae31219
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.015.adm
@@ -0,0 +1,2 @@
+{ "id": 13071782, "age": 24, "name": "Joe Dana" }
+{ "id": 26237702, "age": 28, "name": "Watson Jordon" }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.016.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.016.adm
new file mode 100644
index 0000000..49002dc
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.016.adm
@@ -0,0 +1,3 @@
+{ "id": 13071782, "age": 24, "name": "Joe Dana" }
+{ "id": 26237702, "age": 28, "name": "Watson Jordon" }
+{ "id": 76041664, "age": 29, "name": "John Mad" }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.017.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.017.adm
new file mode 100644
index 0000000..14874ed
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.017.adm
@@ -0,0 +1,2 @@
+{ "id": 51041435, "age": 32, "name": "Robert Moore" }
+{ "id": 76041664, "age": 29, "name": "John Mad" }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.018.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.018.adm
new file mode 100644
index 0000000..84eebd9
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.018.adm
@@ -0,0 +1 @@
+{ "id": 76041664, "age": 29, "name": "John Mad" }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.019.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.019.adm
new file mode 100644
index 0000000..9995269
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.019.adm
@@ -0,0 +1 @@
+{ "id": 51041435, "age": 32, "name": "Robert Moore" }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.021.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.021.adm
new file mode 100644
index 0000000..ee1749d
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.021.adm
@@ -0,0 +1,2 @@
+{ "id": 7, "age": 35, "name": "Sandy Donald" }
+{ "id": 39225791, "age": 35, "name": "Sandy Donald" }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.022.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.022.adm
new file mode 100644
index 0000000..ee1749d
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.022.adm
@@ -0,0 +1,2 @@
+{ "id": 7, "age": 35, "name": "Sandy Donald" }
+{ "id": 39225791, "age": 35, "name": "Sandy Donald" }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.023.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.023.adm
new file mode 100644
index 0000000..c7dc23c
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.023.adm
@@ -0,0 +1 @@
+{"keys":"id","type":{"type":"org.apache.asterix.om.types.ARecordType","name":"DataType","open":true,"fields":[{"name":{"type":"AString"}},{"age":{"type":"AInt64"}},{"hobby":{"type":"AString"}}]},"splits":[{"ip":"127.0.0.1","path":"storage/partition_0/test/DS/0/DS"},{"ip":"127.0.0.1","path":"storage/partition_1/test/DS/0/DS"},{"ip":"127.0.0.1","path":"storage/partition_2/test/DS/0/DS"},{"ip":"127.0.0.1","path":"storage/partition_3/test/DS/0/DS"}]}
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.024.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.024.adm
new file mode 100644
index 0000000..ee1749d
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.024.adm
@@ -0,0 +1,2 @@
+{ "id": 7, "age": 35, "name": "Sandy Donald" }
+{ "id": 39225791, "age": 35, "name": "Sandy Donald" }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.025.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.025.adm
new file mode 100644
index 0000000..ee1749d
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/secondary-index/index-with-meta/index-with-meta.025.adm
@@ -0,0 +1,2 @@
+{ "id": 7, "age": 35, "name": "Sandy Donald" }
+{ "id": 39225791, "age": 35, "name": "Sandy Donald" }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/upsert.003.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/001/upsert.003.adm
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/upsert.003.adm
rename to asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/001/upsert.003.adm
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/upsert.004.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/001/upsert.004.adm
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/upsert.004.adm
rename to asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/001/upsert.004.adm
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/upsert.005.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/001/upsert.005.adm
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/upsert.005.adm
rename to asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/001/upsert.005.adm
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/upsert.007.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/001/upsert.007.adm
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/upsert.007.adm
rename to asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/001/upsert.007.adm
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/upsert.008.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/001/upsert.008.adm
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/upsert.008.adm
rename to asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/001/upsert.008.adm
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/upsert.009.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/001/upsert.009.adm
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/upsert.009.adm
rename to asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/001/upsert.009.adm
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/upsert.011.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/001/upsert.011.adm
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/upsert.011.adm
rename to asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/001/upsert.011.adm
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/upsert.012.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/001/upsert.012.adm
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/upsert.012.adm
rename to asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/001/upsert.012.adm
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/upsert.013.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/001/upsert.013.adm
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/upsert.013.adm
rename to asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/001/upsert.013.adm
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/upsert.015.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/001/upsert.015.adm
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/upsert.015.adm
rename to asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/001/upsert.015.adm
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/upsert.016.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/001/upsert.016.adm
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/upsert.016.adm
rename to asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/001/upsert.016.adm
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/002/upsert.003.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/002/upsert.003.adm
new file mode 100644
index 0000000..cd33c4d
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/002/upsert.003.adm
@@ -0,0 +1,5 @@
+{ "id": 10, "a": [ 1, 2 ] }
+{ "id": 20, "a": [ 3, 4 ] }
+{ "id": 30, "a": [ 5, 6 ] }
+{ "id": 40, "a": [ 7, 8 ] }
+{ "id": 50, "a": [ 9, 10 ] }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/upsert.004.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/002/upsert.004.adm
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/upsert.004.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/002/upsert.004.adm
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/002/upsert.005.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/002/upsert.005.adm
new file mode 100644
index 0000000..cd33c4d
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/002/upsert.005.adm
@@ -0,0 +1,5 @@
+{ "id": 10, "a": [ 1, 2 ] }
+{ "id": 20, "a": [ 3, 4 ] }
+{ "id": 30, "a": [ 5, 6 ] }
+{ "id": 40, "a": [ 7, 8 ] }
+{ "id": 50, "a": [ 9, 10 ] }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/002/upsert.007.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/002/upsert.007.adm
new file mode 100644
index 0000000..606b98a
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/002/upsert.007.adm
@@ -0,0 +1,5 @@
+{ "id": 10, "a": [ 100, 100, 100, 100 ] }
+{ "id": 20, "a": [ 3, 4 ] }
+{ "id": 30, "a": [ 5, 6 ] }
+{ "id": 40, "a": [ 7, 8 ] }
+{ "id": 50, "a": [ 9, 10 ] }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/upsert.008.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/002/upsert.008.adm
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/upsert.008.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/002/upsert.008.adm
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/002/upsert.009.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/002/upsert.009.adm
new file mode 100644
index 0000000..606b98a
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/002/upsert.009.adm
@@ -0,0 +1,5 @@
+{ "id": 10, "a": [ 100, 100, 100, 100 ] }
+{ "id": 20, "a": [ 3, 4 ] }
+{ "id": 30, "a": [ 5, 6 ] }
+{ "id": 40, "a": [ 7, 8 ] }
+{ "id": 50, "a": [ 9, 10 ] }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/002/upsert.011.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/002/upsert.011.adm
new file mode 100644
index 0000000..606b98a
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/002/upsert.011.adm
@@ -0,0 +1,5 @@
+{ "id": 10, "a": [ 100, 100, 100, 100 ] }
+{ "id": 20, "a": [ 3, 4 ] }
+{ "id": 30, "a": [ 5, 6 ] }
+{ "id": 40, "a": [ 7, 8 ] }
+{ "id": 50, "a": [ 9, 10 ] }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
index 241e65e..fc121ad 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
@@ -16134,8 +16134,13 @@
</compilation-unit>
</test-case>
<test-case FilePath="column">
- <compilation-unit name="upsert">
- <output-dir compare="Text">upsert</output-dir>
+ <compilation-unit name="upsert/001">
+ <output-dir compare="Text">upsert/001</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="column">
+ <compilation-unit name="upsert/002">
+ <output-dir compare="Text">upsert/002</output-dir>
</compilation-unit>
</test-case>
<test-case FilePath="column" check-warnings="true">
@@ -16161,5 +16166,60 @@
<output-dir compare="Text">big-object</output-dir>
</compilation-unit>
</test-case>
+ <test-case FilePath="column">
+ <compilation-unit name="secondary-index/array-index/use-case-1">
+ <output-dir compare="Text">secondary-index/array-index/use-case-1</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="column">
+ <compilation-unit name="secondary-index/array-index/use-case-2">
+ <output-dir compare="Text">secondary-index/array-index/use-case-2</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="column">
+ <compilation-unit name="secondary-index/array-index/use-case-3">
+ <output-dir compare="Text">secondary-index/array-index/use-case-3</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="column">
+ <compilation-unit name="secondary-index/array-index/use-case-4">
+ <output-dir compare="Text">secondary-index/array-index/use-case-4</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="column">
+ <compilation-unit name="secondary-index/array-index/with-additional-atomic-index">
+ <output-dir compare="Text">secondary-index/array-index/with-additional-atomic-index</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="column">
+ <compilation-unit name="secondary-index/array-index/with-composite-sk">
+ <output-dir compare="Text">secondary-index/array-index/with-composite-sk</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="column">
+ <compilation-unit name="secondary-index/index-with-meta">
+ <output-dir compare="Text">secondary-index/index-with-meta</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="column">
+ <compilation-unit name="secondary-index/create-index/after-bulkload">
+ <output-dir compare="Text">secondary-index/create-index/after-bulkload</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="column">
+ <compilation-unit name="secondary-index/create-index/after-insert">
+ <output-dir compare="Text">secondary-index/create-index/after-insert</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="column">
+ <compilation-unit name="secondary-index/create-index/after-upsert-with-meta">
+ <output-dir compare="Text">secondary-index/create-index/after-upsert-with-meta</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="column">
+ <compilation-unit name="rebalance">
+ <output-dir compare="Text">rebalance</output-dir>
+ </compilation-unit>
+ </test-case>
</test-group>
</test-suite>
diff --git a/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/ColumnManagerFactory.java b/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/ColumnManagerFactory.java
index 8e35416..0b76216 100644
--- a/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/ColumnManagerFactory.java
+++ b/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/ColumnManagerFactory.java
@@ -20,6 +20,7 @@
import java.util.ArrayList;
import java.util.List;
+import java.util.Objects;
import org.apache.asterix.column.operation.lsm.flush.FlushColumnTupleReaderWriterFactory;
import org.apache.asterix.column.operation.lsm.load.LoadColumnTupleReaderWriterFactory;
@@ -53,7 +54,7 @@
this.tolerance = tolerance;
this.datasetType = datasetType;
- if (keySourceIndicator.size() != 1) {
+ if (containsSplitKeys(keySourceIndicator)) {
throw new UnsupportedOperationException(
"Primary keys split between meta-type and datasetType is not supported");
}
@@ -128,7 +129,7 @@
List<String> primaryKey = new ArrayList<>();
ArrayNode primaryKeyNode = (ArrayNode) primaryKeysNode.get(i);
for (int j = 0; j < primaryKeyNode.size(); j++) {
- primaryKey.add(primaryKeyNode.get(i).asText());
+ primaryKey.add(primaryKeyNode.get(j).asText());
}
primaryKeys.add(primaryKey);
}
@@ -143,4 +144,17 @@
tolerance);
}
+ private static boolean containsSplitKeys(List<Integer> keySourceIndicator) {
+ if (keySourceIndicator.size() == 1) {
+ return false;
+ }
+ Integer value = keySourceIndicator.get(0);
+ for (int i = 1; i < keySourceIndicator.size(); i++) {
+ if (!Objects.equals(value, keySourceIndicator.get(i))) {
+ return true;
+ }
+ }
+ return false;
+ }
+
}
diff --git a/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/operation/lsm/secondary/create/PrimaryScanColumnTupleProjector.java b/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/operation/lsm/secondary/create/PrimaryScanColumnTupleProjector.java
new file mode 100644
index 0000000..b993582
--- /dev/null
+++ b/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/operation/lsm/secondary/create/PrimaryScanColumnTupleProjector.java
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.asterix.column.operation.lsm.secondary.create;
+
+import java.io.DataOutput;
+import java.io.IOException;
+import java.util.Collections;
+
+import org.apache.asterix.column.operation.query.QueryColumnTupleProjector;
+import org.apache.asterix.column.values.reader.filter.evaluator.NoOpColumnFilterEvaluatorFactory;
+import org.apache.asterix.common.exceptions.NoOpWarningCollector;
+import org.apache.asterix.om.types.ARecordType;
+import org.apache.hyracks.api.exceptions.HyracksDataException;
+import org.apache.hyracks.data.std.api.IValueReference;
+import org.apache.hyracks.dataflow.common.comm.io.ArrayTupleBuilder;
+import org.apache.hyracks.dataflow.common.data.accessors.ITupleReference;
+import org.apache.hyracks.storage.am.lsm.btree.column.api.projection.IColumnProjectionInfo;
+import org.apache.hyracks.storage.am.lsm.btree.column.api.projection.IColumnTupleProjector;
+
+final class PrimaryScanColumnTupleProjector implements IColumnTupleProjector {
+ private final QueryColumnTupleProjector projector;
+
+ public PrimaryScanColumnTupleProjector(ARecordType datasetType, int numberOfPrimaryKeys,
+ ARecordType requestedType) {
+ projector = new QueryColumnTupleProjector(datasetType, numberOfPrimaryKeys, requestedType,
+ Collections.emptyMap(), NoOpColumnFilterEvaluatorFactory.INSTANCE, NoOpWarningCollector.INSTANCE);
+ }
+
+ @Override
+ public IColumnProjectionInfo createProjectionInfo(IValueReference serializedMetadata) throws HyracksDataException {
+ return projector.createProjectionInfo(serializedMetadata);
+ }
+
+ @Override
+ public ITupleReference project(ITupleReference tuple, DataOutput dos, ArrayTupleBuilder tb) throws IOException {
+ return projector.project(tuple, dos, tb);
+ }
+}
diff --git a/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/operation/lsm/secondary/create/PrimaryScanColumnTupleProjectorFactory.java b/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/operation/lsm/secondary/create/PrimaryScanColumnTupleProjectorFactory.java
new file mode 100644
index 0000000..91c3616
--- /dev/null
+++ b/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/operation/lsm/secondary/create/PrimaryScanColumnTupleProjectorFactory.java
@@ -0,0 +1,50 @@
+/*
+ * 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.column.operation.lsm.secondary.create;
+
+import org.apache.asterix.om.types.ARecordType;
+import org.apache.hyracks.api.context.IHyracksTaskContext;
+import org.apache.hyracks.api.exceptions.HyracksDataException;
+import org.apache.hyracks.storage.common.projection.ITupleProjector;
+import org.apache.hyracks.storage.common.projection.ITupleProjectorFactory;
+
+public class PrimaryScanColumnTupleProjectorFactory implements ITupleProjectorFactory {
+ private static final long serialVersionUID = -2320917202024130839L;
+ private final ARecordType datasetType;
+ private final ARecordType metaType;
+ private final int numberOfPrimaryKeys;
+ private final ARecordType requestedType;
+
+ public PrimaryScanColumnTupleProjectorFactory(ARecordType datasetType, ARecordType metaType,
+ int numberOfPrimaryKeys, ARecordType requestedType) {
+ this.datasetType = datasetType;
+ this.metaType = metaType;
+ this.numberOfPrimaryKeys = numberOfPrimaryKeys;
+ this.requestedType = requestedType;
+ }
+
+ @Override
+ public ITupleProjector createTupleProjector(IHyracksTaskContext context) throws HyracksDataException {
+ if (metaType != null) {
+ return new PrimaryScanColumnTupleWithMetaProjector(datasetType, metaType, numberOfPrimaryKeys,
+ requestedType);
+ }
+ return new PrimaryScanColumnTupleProjector(datasetType, numberOfPrimaryKeys, requestedType);
+ }
+}
diff --git a/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/operation/lsm/secondary/create/PrimaryScanColumnTupleWithMetaProjector.java b/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/operation/lsm/secondary/create/PrimaryScanColumnTupleWithMetaProjector.java
new file mode 100644
index 0000000..0933049
--- /dev/null
+++ b/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/operation/lsm/secondary/create/PrimaryScanColumnTupleWithMetaProjector.java
@@ -0,0 +1,55 @@
+/*
+ * 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.column.operation.lsm.secondary.create;
+
+import java.io.DataOutput;
+import java.io.IOException;
+import java.util.Collections;
+
+import org.apache.asterix.column.operation.query.QueryColumnWithMetaTupleProjector;
+import org.apache.asterix.column.values.reader.filter.evaluator.NoOpColumnFilterEvaluatorFactory;
+import org.apache.asterix.common.exceptions.NoOpWarningCollector;
+import org.apache.asterix.om.types.ARecordType;
+import org.apache.hyracks.api.exceptions.HyracksDataException;
+import org.apache.hyracks.data.std.api.IValueReference;
+import org.apache.hyracks.dataflow.common.comm.io.ArrayTupleBuilder;
+import org.apache.hyracks.dataflow.common.data.accessors.ITupleReference;
+import org.apache.hyracks.storage.am.lsm.btree.column.api.projection.IColumnProjectionInfo;
+import org.apache.hyracks.storage.am.lsm.btree.column.api.projection.IColumnTupleProjector;
+
+final class PrimaryScanColumnTupleWithMetaProjector implements IColumnTupleProjector {
+ private final QueryColumnWithMetaTupleProjector projector;
+
+ public PrimaryScanColumnTupleWithMetaProjector(ARecordType datasetType, ARecordType metaType,
+ int numberOfPrimaryKeys, ARecordType requestedType) {
+ projector = new QueryColumnWithMetaTupleProjector(datasetType, metaType, numberOfPrimaryKeys, requestedType,
+ Collections.emptyMap(), metaType, Collections.emptyMap(), NoOpColumnFilterEvaluatorFactory.INSTANCE,
+ NoOpWarningCollector.INSTANCE);
+ }
+
+ @Override
+ public IColumnProjectionInfo createProjectionInfo(IValueReference serializedMetadata) throws HyracksDataException {
+ return projector.createProjectionInfo(serializedMetadata);
+ }
+
+ @Override
+ public ITupleReference project(ITupleReference tuple, DataOutput dos, ArrayTupleBuilder tb) throws IOException {
+ return projector.project(tuple, dos, tb);
+ }
+}
diff --git a/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/operation/lsm/secondary/upsert/UpsertPreviousColumnTupleProjector.java b/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/operation/lsm/secondary/upsert/UpsertPreviousColumnTupleProjector.java
new file mode 100644
index 0000000..b245785
--- /dev/null
+++ b/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/operation/lsm/secondary/upsert/UpsertPreviousColumnTupleProjector.java
@@ -0,0 +1,57 @@
+/*
+ * 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.column.operation.lsm.secondary.upsert;
+
+import java.io.DataOutput;
+import java.io.IOException;
+import java.util.Collections;
+
+import org.apache.asterix.column.operation.query.QueryColumnTupleProjector;
+import org.apache.asterix.column.values.reader.filter.evaluator.NoOpColumnFilterEvaluatorFactory;
+import org.apache.asterix.common.exceptions.NoOpWarningCollector;
+import org.apache.asterix.om.types.ARecordType;
+import org.apache.hyracks.api.exceptions.HyracksDataException;
+import org.apache.hyracks.data.std.api.IValueReference;
+import org.apache.hyracks.dataflow.common.comm.io.ArrayTupleBuilder;
+import org.apache.hyracks.dataflow.common.data.accessors.ITupleReference;
+import org.apache.hyracks.storage.am.lsm.btree.column.api.projection.IColumnProjectionInfo;
+import org.apache.hyracks.storage.am.lsm.btree.column.api.projection.IColumnTupleProjector;
+
+final class UpsertPreviousColumnTupleProjector implements IColumnTupleProjector {
+ private final ArrayTupleBuilder builder;
+ private final QueryColumnTupleProjector projector;
+
+ public UpsertPreviousColumnTupleProjector(ARecordType datasetType, int numberOfPrimaryKeys,
+ ARecordType requestedType) {
+ builder = new ArrayTupleBuilder(numberOfPrimaryKeys + 1);
+ projector = new QueryColumnTupleProjector(datasetType, numberOfPrimaryKeys, requestedType,
+ Collections.emptyMap(), NoOpColumnFilterEvaluatorFactory.INSTANCE, NoOpWarningCollector.INSTANCE);
+ }
+
+ @Override
+ public IColumnProjectionInfo createProjectionInfo(IValueReference serializedMetadata) throws HyracksDataException {
+ return projector.createProjectionInfo(serializedMetadata);
+ }
+
+ @Override
+ public ITupleReference project(ITupleReference tuple, DataOutput dos, ArrayTupleBuilder tb) throws IOException {
+ builder.reset();
+ return projector.project(tuple, builder.getDataOutput(), builder);
+ }
+}
diff --git a/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/operation/lsm/secondary/upsert/UpsertPreviousColumnTupleProjectorFactory.java b/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/operation/lsm/secondary/upsert/UpsertPreviousColumnTupleProjectorFactory.java
new file mode 100644
index 0000000..643eebc
--- /dev/null
+++ b/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/operation/lsm/secondary/upsert/UpsertPreviousColumnTupleProjectorFactory.java
@@ -0,0 +1,50 @@
+/*
+ * 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.column.operation.lsm.secondary.upsert;
+
+import org.apache.asterix.om.types.ARecordType;
+import org.apache.hyracks.api.context.IHyracksTaskContext;
+import org.apache.hyracks.api.exceptions.HyracksDataException;
+import org.apache.hyracks.storage.common.projection.ITupleProjector;
+import org.apache.hyracks.storage.common.projection.ITupleProjectorFactory;
+
+public class UpsertPreviousColumnTupleProjectorFactory implements ITupleProjectorFactory {
+ private static final long serialVersionUID = -2320917202024130839L;
+ private final ARecordType datasetType;
+ private final ARecordType metaType;
+ private final int numberOfPrimaryKeys;
+ private final ARecordType requestedType;
+
+ public UpsertPreviousColumnTupleProjectorFactory(ARecordType datasetType, ARecordType metaType,
+ int numberOfPrimaryKeys, ARecordType requestedType) {
+ this.datasetType = datasetType;
+ this.metaType = metaType;
+ this.numberOfPrimaryKeys = numberOfPrimaryKeys;
+ this.requestedType = requestedType;
+ }
+
+ @Override
+ public ITupleProjector createTupleProjector(IHyracksTaskContext context) throws HyracksDataException {
+ if (metaType != null) {
+ return new UpsertPreviousColumnTupleWithMetaProjector(datasetType, metaType, numberOfPrimaryKeys,
+ requestedType);
+ }
+ return new UpsertPreviousColumnTupleProjector(datasetType, numberOfPrimaryKeys, requestedType);
+ }
+}
diff --git a/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/operation/lsm/secondary/upsert/UpsertPreviousColumnTupleWithMetaProjector.java b/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/operation/lsm/secondary/upsert/UpsertPreviousColumnTupleWithMetaProjector.java
new file mode 100644
index 0000000..d6285dc
--- /dev/null
+++ b/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/operation/lsm/secondary/upsert/UpsertPreviousColumnTupleWithMetaProjector.java
@@ -0,0 +1,59 @@
+/*
+ * 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.column.operation.lsm.secondary.upsert;
+
+import java.io.DataOutput;
+import java.io.IOException;
+import java.util.Collections;
+
+import org.apache.asterix.column.operation.query.QueryColumnWithMetaTupleProjector;
+import org.apache.asterix.column.values.reader.filter.evaluator.NoOpColumnFilterEvaluatorFactory;
+import org.apache.asterix.common.exceptions.NoOpWarningCollector;
+import org.apache.asterix.om.types.ARecordType;
+import org.apache.hyracks.api.exceptions.HyracksDataException;
+import org.apache.hyracks.data.std.api.IValueReference;
+import org.apache.hyracks.dataflow.common.comm.io.ArrayTupleBuilder;
+import org.apache.hyracks.dataflow.common.data.accessors.ITupleReference;
+import org.apache.hyracks.storage.am.lsm.btree.column.api.projection.IColumnProjectionInfo;
+import org.apache.hyracks.storage.am.lsm.btree.column.api.projection.IColumnTupleProjector;
+
+final class UpsertPreviousColumnTupleWithMetaProjector implements IColumnTupleProjector {
+ private final ArrayTupleBuilder builder;
+ private final QueryColumnWithMetaTupleProjector projector;
+
+ public UpsertPreviousColumnTupleWithMetaProjector(ARecordType datasetType, ARecordType metaType,
+ int numberOfPrimaryKeys, ARecordType requestedType) {
+ // +2 one for the record and one for meta
+ builder = new ArrayTupleBuilder(numberOfPrimaryKeys + 2);
+ projector = new QueryColumnWithMetaTupleProjector(datasetType, metaType, numberOfPrimaryKeys, requestedType,
+ Collections.emptyMap(), metaType, Collections.emptyMap(), NoOpColumnFilterEvaluatorFactory.INSTANCE,
+ NoOpWarningCollector.INSTANCE);
+ }
+
+ @Override
+ public IColumnProjectionInfo createProjectionInfo(IValueReference serializedMetadata) throws HyracksDataException {
+ return projector.createProjectionInfo(serializedMetadata);
+ }
+
+ @Override
+ public ITupleReference project(ITupleReference tuple, DataOutput dos, ArrayTupleBuilder tb) throws IOException {
+ builder.reset();
+ return projector.project(tuple, builder.getDataOutput(), builder);
+ }
+}
diff --git a/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/operation/query/QueryColumnMetadata.java b/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/operation/query/QueryColumnMetadata.java
index 6c51240..f2407d3 100644
--- a/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/operation/query/QueryColumnMetadata.java
+++ b/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/operation/query/QueryColumnMetadata.java
@@ -47,6 +47,7 @@
import org.apache.hyracks.data.std.api.IValueReference;
import org.apache.hyracks.data.std.primitive.IntegerPointable;
import org.apache.hyracks.storage.am.lsm.btree.column.api.AbstractColumnTupleReader;
+import org.apache.hyracks.util.LogRedactionUtil;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -172,7 +173,7 @@
if (LOGGER.isInfoEnabled() && filterEvaluator != TrueColumnFilterEvaluator.INSTANCE) {
String filterString = filterEvaluator == FalseColumnFilterEvaluator.INSTANCE ? "SKIP_ALL"
- : filterEvaluatorFactory.toString();
+ : LogRedactionUtil.userData(filterEvaluatorFactory.toString());
LOGGER.info("Filter: {}", filterString);
}
diff --git a/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/operation/query/QueryColumnTupleProjector.java b/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/operation/query/QueryColumnTupleProjector.java
index 8865b13..08efc2b 100644
--- a/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/operation/query/QueryColumnTupleProjector.java
+++ b/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/operation/query/QueryColumnTupleProjector.java
@@ -37,7 +37,7 @@
import org.apache.hyracks.storage.am.lsm.btree.column.api.projection.IColumnProjectionInfo;
import org.apache.hyracks.storage.am.lsm.btree.column.api.projection.IColumnTupleProjector;
-class QueryColumnTupleProjector implements IColumnTupleProjector {
+public class QueryColumnTupleProjector implements IColumnTupleProjector {
protected final ARecordType datasetType;
protected final ARecordType requestedType;
protected final int numberOfPrimaryKeys;
@@ -46,7 +46,7 @@
protected final IColumnFilterEvaluatorFactory filterEvaluator;
private final AssembledTupleReference assembledTupleReference;
- QueryColumnTupleProjector(ARecordType datasetType, int numberOfPrimaryKeys, ARecordType requestedType,
+ public QueryColumnTupleProjector(ARecordType datasetType, int numberOfPrimaryKeys, ARecordType requestedType,
Map<String, FunctionCallInformation> functionCallInfoMap, IColumnFilterEvaluatorFactory filterEvaluator,
IWarningCollector warningCollector) {
this.datasetType = datasetType;
diff --git a/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/operation/query/QueryColumnWithMetaTupleProjector.java b/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/operation/query/QueryColumnWithMetaTupleProjector.java
index e8f9045..b3deb46 100644
--- a/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/operation/query/QueryColumnWithMetaTupleProjector.java
+++ b/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/operation/query/QueryColumnWithMetaTupleProjector.java
@@ -35,12 +35,12 @@
import org.apache.hyracks.dataflow.common.data.accessors.ITupleReference;
import org.apache.hyracks.storage.am.lsm.btree.column.api.projection.IColumnProjectionInfo;
-class QueryColumnWithMetaTupleProjector extends QueryColumnTupleProjector {
+public class QueryColumnWithMetaTupleProjector extends QueryColumnTupleProjector {
private final ARecordType metaType;
private final ARecordType requestedMetaType;
private final Map<String, FunctionCallInformation> metaFunctionCallInfoMap;
- QueryColumnWithMetaTupleProjector(ARecordType datasetType, ARecordType metaType, int numberOfPrimaryKeys,
+ public QueryColumnWithMetaTupleProjector(ARecordType datasetType, ARecordType metaType, int numberOfPrimaryKeys,
ARecordType requestedType, Map<String, FunctionCallInformation> functionCallInfoMap,
ARecordType requestedMetaType, Map<String, FunctionCallInformation> metaFunctionCallInfoMap,
IColumnFilterEvaluatorFactory filterEvaluator, IWarningCollector warningCollector) {
diff --git a/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/util/ColumnSecondaryIndexSchemaUtil.java b/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/util/ColumnSecondaryIndexSchemaUtil.java
new file mode 100644
index 0000000..87c111f
--- /dev/null
+++ b/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/util/ColumnSecondaryIndexSchemaUtil.java
@@ -0,0 +1,118 @@
+/*
+ * 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.column.util;
+
+import java.util.List;
+
+import org.apache.asterix.om.typecomputer.impl.RecordMergeTypeComputer;
+import org.apache.asterix.om.types.AOrderedListType;
+import org.apache.asterix.om.types.ARecordType;
+import org.apache.asterix.om.types.BuiltinType;
+import org.apache.asterix.om.types.IAType;
+import org.apache.asterix.runtime.projection.DataProjectionFiltrationInfo;
+import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
+
+public class ColumnSecondaryIndexSchemaUtil {
+ private ColumnSecondaryIndexSchemaUtil() {
+ }
+
+ /**
+ * Get the expected type for a value index
+ *
+ * @param paths the path to the indexed value
+ * @return expected type
+ */
+ public static ARecordType getRecordType(List<List<String>> paths) throws AlgebricksException {
+ ARecordType result = DataProjectionFiltrationInfo.EMPTY_TYPE;
+ for (List<String> path : paths) {
+ ARecordType type = getRecordType(path, "root", 0, BuiltinType.ANY);
+ result = (ARecordType) RecordMergeTypeComputer.merge(result, type);
+ }
+
+ // Rename
+ return new ARecordType("root", result.getFieldNames(), result.getFieldTypes(), true);
+ }
+
+ /**
+ * Get the expected type for an array index
+ *
+ * @param unnest the unnest path (UNNEST)
+ * @param project the project path (SELECT)
+ * @return the expected type
+ */
+ public static ARecordType getRecordType(List<List<String>> unnest, List<List<String>> project)
+ throws AlgebricksException {
+ IAType result = getLeafType(project);
+ for (int i = unnest.size() - 1; i >= 0; i--) {
+ List<String> path = unnest.get(i);
+ result = getRecordType(path, "parent_" + i, 0, new AOrderedListType(result, "array_" + i));
+ }
+ return (ARecordType) result;
+ }
+
+ /**
+ * Merge all types into a single one
+ *
+ * @param types the list of type for indexed fields
+ * @return a single type that encompasses all indexed fields
+ */
+ public static ARecordType merge(List<ARecordType> types) throws AlgebricksException {
+ ARecordType result = types.get(0);
+ for (int i = 1; i < types.size(); i++) {
+ result = (ARecordType) RecordMergeTypeComputer.merge(result, types.get(i));
+ }
+
+ // Rename
+ return new ARecordType("root", result.getFieldNames(), result.getFieldTypes(), true);
+ }
+
+ private static IAType getType(String typeName, List<String> path, int fieldIndex, IAType leafType) {
+ if (fieldIndex == path.size()) {
+ return leafType;
+ }
+ return getRecordType(path, typeName, fieldIndex, leafType);
+ }
+
+ private static ARecordType getRecordType(List<String> path, String typeName, int fieldIndex, IAType leafType) {
+ String[] fieldNames = new String[1];
+ IAType[] fieldTypes = new IAType[1];
+
+ String fieldName = path.get(fieldIndex);
+ fieldNames[0] = fieldName;
+ fieldTypes[0] = getType(getTypeName(fieldName), path, fieldIndex + 1, leafType);
+ return new ARecordType(typeName, fieldNames, fieldTypes, true);
+ }
+
+ private static IAType getLeafType(List<List<String>> project) throws AlgebricksException {
+ IAType itemType;
+ // Sometimes 'project' contains a single null value
+ if (project.isEmpty() || project.get(0) == null) {
+ itemType = BuiltinType.ANY;
+ } else {
+ itemType = getRecordType(project);
+ }
+
+ return itemType;
+ }
+
+ private static String getTypeName(String fieldName) {
+ return fieldName + "_Type";
+ }
+
+}
diff --git a/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/values/reader/RepeatedPrimitiveColumnValuesReader.java b/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/values/reader/RepeatedPrimitiveColumnValuesReader.java
index 0fb98be..673aa98 100644
--- a/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/values/reader/RepeatedPrimitiveColumnValuesReader.java
+++ b/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/values/reader/RepeatedPrimitiveColumnValuesReader.java
@@ -129,4 +129,16 @@
}
delimiterIndex = levelToDelimiterMap[level];
}
+
+ @Override
+ public void skip(int count) throws HyracksDataException {
+ for (int i = 0; i < count; i++) {
+ next();
+ if (isRepeatedValue()) {
+ while (!isLastDelimiter()) {
+ next();
+ }
+ }
+ }
+ }
}
diff --git a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/entities/Index.java b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/entities/Index.java
index 6b12bf8..bb1fdd9 100644
--- a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/entities/Index.java
+++ b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/entities/Index.java
@@ -20,11 +20,13 @@
package org.apache.asterix.metadata.entities;
import java.io.Serializable;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
+import org.apache.asterix.column.util.ColumnSecondaryIndexSchemaUtil;
import org.apache.asterix.common.config.DatasetConfig.IndexType;
import org.apache.asterix.common.exceptions.AsterixException;
import org.apache.asterix.common.exceptions.CompilationException;
@@ -223,10 +225,7 @@
if (!datasetName.equals(otherIndex.getDatasetName())) {
return false;
}
- if (!dataverseName.equals(otherIndex.getDataverseName())) {
- return false;
- }
- return true;
+ return dataverseName.equals(otherIndex.getDataverseName());
}
@Override
@@ -415,6 +414,10 @@
public boolean isOverridingKeyFieldTypes() {
return overrideKeyFieldTypes;
}
+
+ public ARecordType getIndexExpectedType() throws AlgebricksException {
+ return ColumnSecondaryIndexSchemaUtil.getRecordType(getKeyFieldNames());
+ }
}
public static final class TextIndexDetails extends AbstractIndexDetails {
@@ -504,6 +507,15 @@
public boolean isOverridingKeyFieldTypes() {
return overrideKeyFieldTypes;
}
+
+ public ARecordType getIndexExpectedType() throws AlgebricksException {
+ List<ARecordType> types = new ArrayList<>();
+ for (Index.ArrayIndexElement element : elementList) {
+ types.add(ColumnSecondaryIndexSchemaUtil.getRecordType(element.getUnnestList(),
+ element.getProjectList()));
+ }
+ return ColumnSecondaryIndexSchemaUtil.merge(types);
+ }
}
public static final class ArrayIndexElement implements Serializable {
diff --git a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/utils/DatasetUtil.java b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/utils/DatasetUtil.java
index 6529794..083b964 100644
--- a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/utils/DatasetUtil.java
+++ b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/utils/DatasetUtil.java
@@ -30,6 +30,8 @@
import org.apache.asterix.builders.IARecordBuilder;
import org.apache.asterix.builders.RecordBuilder;
+import org.apache.asterix.column.util.ColumnSecondaryIndexSchemaUtil;
+import org.apache.asterix.common.config.DatasetConfig;
import org.apache.asterix.common.config.DatasetConfig.DatasetType;
import org.apache.asterix.common.context.CorrelatedPrefixMergePolicyFactory;
import org.apache.asterix.common.context.IStorageComponentProvider;
@@ -60,7 +62,9 @@
import org.apache.asterix.om.types.ARecordType;
import org.apache.asterix.om.types.BuiltinType;
import org.apache.asterix.om.types.IAType;
+import org.apache.asterix.om.types.visitor.SimpleStringBuilderForIATypeVisitor;
import org.apache.asterix.runtime.operators.LSMPrimaryUpsertOperatorDescriptor;
+import org.apache.asterix.runtime.projection.DataProjectionFiltrationInfo;
import org.apache.asterix.runtime.utils.RuntimeUtils;
import org.apache.asterix.transaction.management.opcallbacks.PrimaryIndexInstantSearchOperationCallbackFactory;
import org.apache.hyracks.algebricks.common.constraints.AlgebricksPartitionConstraint;
@@ -90,10 +94,13 @@
import org.apache.hyracks.storage.am.common.dataflow.IndexCreateOperatorDescriptor;
import org.apache.hyracks.storage.am.common.dataflow.IndexDataflowHelperFactory;
import org.apache.hyracks.storage.am.common.dataflow.IndexDropOperatorDescriptor;
+import org.apache.hyracks.storage.am.common.impls.DefaultTupleProjectorFactory;
import org.apache.hyracks.storage.am.common.ophelpers.IndexOperation;
import org.apache.hyracks.storage.am.lsm.common.api.ILSMMergePolicyFactory;
import org.apache.hyracks.storage.am.lsm.common.dataflow.LSMTreeIndexCompactOperatorDescriptor;
import org.apache.hyracks.storage.common.IResourceFactory;
+import org.apache.hyracks.storage.common.projection.ITupleProjectorFactory;
+import org.apache.hyracks.util.LogRedactionUtil;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -222,12 +229,9 @@
* e.g. if the field name happens to be equal to the key name but the field is coming from the data record while
* the key is coming from the meta record.
*
- * @param keySourceIndicator
- * indicates where the key is coming from, 1 from meta record, 0 from data record
- * @param keyIndex
- * the key index we're checking the field against
- * @param fieldFromMeta
- * whether the field is coming from the meta record or the data record
+ * @param keySourceIndicator indicates where the key is coming from, 1 from meta record, 0 from data record
+ * @param keyIndex the key index we're checking the field against
+ * @param fieldFromMeta whether the field is coming from the meta record or the data record
* @return true if the key source matches the field source. Otherwise, false.
*/
private static boolean keySourceMatches(List<Integer> keySourceIndicator, int keyIndex, boolean fieldFromMeta) {
@@ -347,7 +351,7 @@
for (int i = 0; i < fs.length; i++) {
sb.append(fs[i] + " ");
}
- LOGGER.info("CREATING File Splits: " + sb.toString());
+ LOGGER.info("CREATING File Splits: " + sb);
Pair<ILSMMergePolicyFactory, Map<String, String>> compactionInfo =
DatasetUtil.getMergePolicyFactory(dataset, metadataProvider.getMetadataTxnContext());
// prepare a LocalResourceMetadata which will be stored in NC's local resource
@@ -389,17 +393,19 @@
/**
* Creates a primary index scan operator for a given dataset.
*
- * @param spec,
- * the job specification.
- * @param metadataProvider,
- * the metadata provider.
- * @param dataset,
- * the dataset to scan.
+ * @param spec, the job specification.
+ * @param metadataProvider, the metadata provider.
+ * @param dataset, the dataset to scan.
* @return a primary index scan operator.
* @throws AlgebricksException
*/
public static IOperatorDescriptor createPrimaryIndexScanOp(JobSpecification spec, MetadataProvider metadataProvider,
Dataset dataset) throws AlgebricksException {
+ return createPrimaryIndexScanOp(spec, metadataProvider, dataset, DefaultTupleProjectorFactory.INSTANCE);
+ }
+
+ public static IOperatorDescriptor createPrimaryIndexScanOp(JobSpecification spec, MetadataProvider metadataProvider,
+ Dataset dataset, ITupleProjectorFactory projectorFactory) throws AlgebricksException {
Pair<IFileSplitProvider, AlgebricksPartitionConstraint> primarySplitsAndConstraint =
metadataProvider.getSplitProviderAndConstraints(dataset);
IFileSplitProvider primaryFileSplitProvider = primarySplitsAndConstraint.first;
@@ -414,9 +420,10 @@
IRecoveryManager.ResourceType.LSM_BTREE);
IndexDataflowHelperFactory indexHelperFactory = new IndexDataflowHelperFactory(
metadataProvider.getStorageComponentProvider().getStorageManager(), primaryFileSplitProvider);
- BTreeSearchOperatorDescriptor primarySearchOp = new BTreeSearchOperatorDescriptor(spec,
- dataset.getPrimaryRecordDescriptor(metadataProvider), lowKeyFields, highKeyFields, true, true,
- indexHelperFactory, false, false, null, searchCallbackFactory, null, null, false, null);
+ BTreeSearchOperatorDescriptor primarySearchOp =
+ new BTreeSearchOperatorDescriptor(spec, dataset.getPrimaryRecordDescriptor(metadataProvider),
+ lowKeyFields, highKeyFields, true, true, indexHelperFactory, false, false, null,
+ searchCallbackFactory, null, null, false, null, null, -1, false, null, null, projectorFactory);
AlgebricksPartitionConstraintHelper.setPartitionConstraintInJobSpec(spec, primarySearchOp,
primaryPartitionConstraint);
return primarySearchOp;
@@ -425,18 +432,12 @@
/**
* Creates a primary index upsert operator for a given dataset.
*
- * @param spec,
- * the job specification.
- * @param metadataProvider,
- * the metadata provider.
- * @param dataset,
- * the dataset to upsert.
- * @param inputRecordDesc,the
- * record descriptor for an input tuple.
- * @param fieldPermutation,
- * the field permutation according to the input.
- * @param missingWriterFactory,
- * the factory for customizing missing value serialization.
+ * @param spec, the job specification.
+ * @param metadataProvider, the metadata provider.
+ * @param dataset, the dataset to upsert.
+ * @param inputRecordDesc,the record descriptor for an input tuple.
+ * @param fieldPermutation, the field permutation according to the input.
+ * @param missingWriterFactory, the factory for customizing missing value serialization.
* @return a primary index scan operator and its location constraints.
* @throws AlgebricksException
*/
@@ -515,22 +516,73 @@
outputSerDes[j + f] = inputRecordDesc.getFields()[j];
}
RecordDescriptor outputRecordDesc = new RecordDescriptor(outputSerDes, outputTypeTraits);
+
+ // This allows to project only the indexed fields instead of the entirety of the record
+ ARecordType requestedType = getPrevRecordType(metadataProvider, dataset, itemType);
+ ITupleProjectorFactory projectorFactory = IndexUtil.createUpsertTupleProjectorFactory(
+ dataset.getDatasetFormatInfo(), requestedType, itemType, metaItemType, numKeys);
+
op = new LSMPrimaryUpsertOperatorDescriptor(spec, outputRecordDesc, fieldPermutation, idfh,
missingWriterFactory, modificationCallbackFactory, searchCallbackFactory,
dataset.getFrameOpCallbackFactory(metadataProvider), numKeys, filterSourceIndicator, filterItemType,
- fieldIdx, hasSecondaries);
+ fieldIdx, hasSecondaries, projectorFactory);
return new Pair<>(op, splitsAndConstraint.second);
}
/**
+ * Returns a type that contains indexed fields for columnar datasets.
+ * The type is used retrieve the previous record with only the indexed fields -- minimizing the
+ * I/O cost for point lookups.
+ *
+ * @param metadataProvider metadata provider
+ * @param dataset the dataset to upsert to
+ * @param itemType dataset type
+ * @return a type with the requested fields
+ */
+ private static ARecordType getPrevRecordType(MetadataProvider metadataProvider, Dataset dataset,
+ ARecordType itemType) throws AlgebricksException {
+ if (dataset.getDatasetFormatInfo().getFormat() == DatasetConfig.DatasetFormat.ROW) {
+ return itemType;
+ }
+
+ // Column
+ List<Index> secondaryIndexes =
+ metadataProvider.getDatasetIndexes(dataset.getDataverseName(), dataset.getDatasetName());
+ List<ARecordType> indexPaths = new ArrayList<>();
+
+ for (Index index : secondaryIndexes) {
+ if (!index.isSecondaryIndex() || index.isPrimaryKeyIndex() || index.isSampleIndex()) {
+ continue;
+ }
+
+ if (index.getIndexType() == DatasetConfig.IndexType.BTREE) {
+ Index.ValueIndexDetails indexDetails = (Index.ValueIndexDetails) index.getIndexDetails();
+ indexPaths.add(indexDetails.getIndexExpectedType());
+ } else if (index.getIndexType() == DatasetConfig.IndexType.ARRAY) {
+ Index.ArrayIndexDetails indexDetails = (Index.ArrayIndexDetails) index.getIndexDetails();
+ indexPaths.add(indexDetails.getIndexExpectedType());
+ }
+ }
+
+ ARecordType result = indexPaths.isEmpty() ? DataProjectionFiltrationInfo.EMPTY_TYPE
+ : ColumnSecondaryIndexSchemaUtil.merge(indexPaths);
+
+ if (LOGGER.isInfoEnabled() && result != DataProjectionFiltrationInfo.EMPTY_TYPE) {
+ SimpleStringBuilderForIATypeVisitor schemaPrinter = new SimpleStringBuilderForIATypeVisitor();
+ StringBuilder builder = new StringBuilder();
+ result.accept(schemaPrinter, builder);
+ LOGGER.info("Upsert previous tuple schema: {}", LogRedactionUtil.userData(builder.toString()));
+ }
+
+ return result;
+ }
+
+ /**
* Creates a dummy key provider operator for the primary index scan.
*
- * @param spec,
- * the job specification.
- * @param dataset,
- * the dataset to scan.
- * @param metadataProvider,
- * the metadata provider.
+ * @param spec, the job specification.
+ * @param dataset, the dataset to scan.
+ * @param metadataProvider, the metadata provider.
* @return a dummy key provider operator.
* @throws AlgebricksException
*/
@@ -613,7 +665,7 @@
appCtx.getMetadataLockManager().acquireNodeGroupWriteLock(metadataProvider.getLocks(), nodeGroup);
NodeGroup ng = MetadataManager.INSTANCE.getNodegroup(mdTxnCtx, nodeGroup);
if (ng != null) {
- nodeGroup = nodeGroup + "_" + UUID.randomUUID().toString();
+ nodeGroup = nodeGroup + "_" + UUID.randomUUID();
appCtx.getMetadataLockManager().acquireNodeGroupWriteLock(metadataProvider.getLocks(), nodeGroup);
}
MetadataManager.INSTANCE.addNodegroup(mdTxnCtx, NodeGroup.createOrdered(nodeGroup, new ArrayList<>(ncNames)));
diff --git a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/utils/IndexUtil.java b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/utils/IndexUtil.java
index fc8fdb6..4580a8d 100644
--- a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/utils/IndexUtil.java
+++ b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/utils/IndexUtil.java
@@ -26,6 +26,8 @@
import java.util.Map;
import java.util.Set;
+import org.apache.asterix.column.operation.lsm.secondary.create.PrimaryScanColumnTupleProjectorFactory;
+import org.apache.asterix.column.operation.lsm.secondary.upsert.UpsertPreviousColumnTupleProjectorFactory;
import org.apache.asterix.column.operation.query.QueryColumnTupleProjectorFactory;
import org.apache.asterix.column.values.reader.filter.IColumnFilterEvaluatorFactory;
import org.apache.asterix.column.values.reader.filter.evaluator.NoOpColumnFilterEvaluatorFactory;
@@ -56,6 +58,7 @@
import org.apache.hyracks.api.job.IJobletEventListenerFactory;
import org.apache.hyracks.api.job.JobSpecification;
import org.apache.hyracks.storage.am.common.impls.DefaultTupleProjectorFactory;
+import org.apache.hyracks.storage.am.common.impls.NoOpTupleProjectorFactory;
import org.apache.hyracks.storage.common.projection.ITupleProjectorFactory;
import org.apache.hyracks.util.OptionalBoolean;
@@ -297,4 +300,26 @@
filterEvaluator);
}
+ public static ITupleProjectorFactory createUpsertTupleProjectorFactory(DatasetFormatInfo datasetFormatInfo,
+ ARecordType datasetRequestedType, ARecordType datasetType, ARecordType metaItemType,
+ int numberOfPrimaryKeys) {
+ if (datasetFormatInfo.getFormat() == DatasetConfig.DatasetFormat.ROW) {
+ return NoOpTupleProjectorFactory.INSTANCE;
+ }
+
+ return new UpsertPreviousColumnTupleProjectorFactory(datasetType, metaItemType, numberOfPrimaryKeys,
+ datasetRequestedType);
+ }
+
+ public static ITupleProjectorFactory createPrimaryIndexScanTupleProjectorFactory(
+ DatasetFormatInfo datasetFormatInfo, ARecordType datasetRequestedType, ARecordType datasetType,
+ ARecordType metaItemType, int numberOfPrimaryKeys) {
+ if (datasetFormatInfo.getFormat() == DatasetConfig.DatasetFormat.ROW) {
+ return DefaultTupleProjectorFactory.INSTANCE;
+ }
+
+ return new PrimaryScanColumnTupleProjectorFactory(datasetType, metaItemType, numberOfPrimaryKeys,
+ datasetRequestedType);
+ }
+
}
diff --git a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/utils/SecondaryArrayIndexBTreeOperationsHelper.java b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/utils/SecondaryArrayIndexBTreeOperationsHelper.java
index c8a7ee1..a6dc65d 100644
--- a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/utils/SecondaryArrayIndexBTreeOperationsHelper.java
+++ b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/utils/SecondaryArrayIndexBTreeOperationsHelper.java
@@ -76,6 +76,7 @@
import org.apache.hyracks.dataflow.std.group.preclustered.PreclusteredGroupOperatorDescriptor;
import org.apache.hyracks.storage.am.common.dataflow.IIndexDataflowHelperFactory;
import org.apache.hyracks.storage.am.common.dataflow.IndexDataflowHelperFactory;
+import org.apache.hyracks.storage.common.projection.ITupleProjectorFactory;
public class SecondaryArrayIndexBTreeOperationsHelper extends SecondaryTreeIndexOperationsHelper {
private final int numAtomicSecondaryKeys, numArraySecondaryKeys, numTotalSecondaryKeys;
@@ -263,7 +264,12 @@
// Start the job spec. Create a key provider and connect this to a primary index scan.
IOperatorDescriptor sourceOp = DatasetUtil.createDummyKeyProviderOp(spec, dataset, metadataProvider);
- IOperatorDescriptor targetOp = DatasetUtil.createPrimaryIndexScanOp(spec, metadataProvider, dataset);
+ // if format == column, then project only the indexed fields
+ ITupleProjectorFactory projectorFactory =
+ IndexUtil.createPrimaryIndexScanTupleProjectorFactory(dataset.getDatasetFormatInfo(),
+ arrayIndexDetails.getIndexExpectedType(), itemType, metaType, numPrimaryKeys);
+ IOperatorDescriptor targetOp =
+ DatasetUtil.createPrimaryIndexScanOp(spec, metadataProvider, dataset, projectorFactory);
spec.connect(new OneToOneConnectorDescriptor(spec), sourceOp, 0, targetOp, 0);
sourceOp = targetOp;
diff --git a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/utils/SecondaryBTreeOperationsHelper.java b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/utils/SecondaryBTreeOperationsHelper.java
index 3d4fb16..5a9753c 100644
--- a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/utils/SecondaryBTreeOperationsHelper.java
+++ b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/utils/SecondaryBTreeOperationsHelper.java
@@ -53,6 +53,7 @@
import org.apache.hyracks.dataflow.std.sort.ExternalSortOperatorDescriptor;
import org.apache.hyracks.storage.am.common.dataflow.IIndexDataflowHelperFactory;
import org.apache.hyracks.storage.am.common.dataflow.IndexDataflowHelperFactory;
+import org.apache.hyracks.storage.common.projection.ITupleProjectorFactory;
public class SecondaryBTreeOperationsHelper extends SecondaryTreeIndexOperationsHelper {
@@ -126,9 +127,14 @@
// key provider -> primary idx scan -> cast assign -> (select)? -> (sort)? -> bulk load -> sink
IndexUtil.bindJobEventListener(spec, metadataProvider);
+ // if format == column, then project only the indexed fields
+ ITupleProjectorFactory projectorFactory =
+ IndexUtil.createPrimaryIndexScanTupleProjectorFactory(dataset.getDatasetFormatInfo(),
+ indexDetails.getIndexExpectedType(), itemType, metaType, numPrimaryKeys);
// dummy key provider ----> primary index scan
IOperatorDescriptor sourceOp = DatasetUtil.createDummyKeyProviderOp(spec, dataset, metadataProvider);
- IOperatorDescriptor targetOp = DatasetUtil.createPrimaryIndexScanOp(spec, metadataProvider, dataset);
+ IOperatorDescriptor targetOp =
+ DatasetUtil.createPrimaryIndexScanOp(spec, metadataProvider, dataset, projectorFactory);
spec.connect(new OneToOneConnectorDescriptor(spec), sourceOp, 0, targetOp, 0);
sourceOp = targetOp;
@@ -178,21 +184,21 @@
}
/**
- * ======
- * | SK | Bloom filter
- * ======
- * ====== ======
- * | SK | PK | comparators, type traits
- * ====== ======
- * ====== ........
- * | SK | Filter | field access evaluators
- * ====== ........
- * ====== ====== ........
- * | SK | PK | Filter | record fields
- * ====== ====== ........
- * ====== ========= ........ ........
- * | PK | Payload | Meta | Filter | enforced record
- * ====== ========= ........ ........
+ * ======
+ * | SK | Bloom filter
+ * ======
+ * ====== ======
+ * | SK | PK | comparators, type traits
+ * ====== ======
+ * ====== ........
+ * | SK | Filter | field access evaluators
+ * ====== ........
+ * ====== ====== ........
+ * | SK | PK | Filter | record fields
+ * ====== ====== ........
+ * ====== ========= ........ ........
+ * | PK | Payload | Meta | Filter | enforced record
+ * ====== ========= ........ ........
*/
@Override
protected void setSecondaryRecDescAndComparators() throws AlgebricksException {
diff --git a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/utils/SecondaryIndexOperationsHelper.java b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/utils/SecondaryIndexOperationsHelper.java
index 694b153..c8fd546 100644
--- a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/utils/SecondaryIndexOperationsHelper.java
+++ b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/utils/SecondaryIndexOperationsHelper.java
@@ -193,12 +193,16 @@
return indexOperationsHelper;
}
+ @Override
public abstract JobSpecification buildCreationJobSpec() throws AlgebricksException;
+ @Override
public abstract JobSpecification buildLoadingJobSpec() throws AlgebricksException;
+ @Override
public abstract JobSpecification buildCompactJobSpec() throws AlgebricksException;
+ @Override
public abstract JobSpecification buildDropJobSpec(Set<DropOption> options) throws AlgebricksException;
protected abstract void setSecondaryRecDescAndComparators() throws AlgebricksException;
@@ -369,9 +373,7 @@
}
IScalarEvaluatorFactory[] sefs = new IScalarEvaluatorFactory[secondaryFieldAccessEvalFactories.length];
- for (int i = 0; i < secondaryFieldAccessEvalFactories.length; ++i) {
- sefs[i] = secondaryFieldAccessEvalFactories[i];
- }
+ System.arraycopy(secondaryFieldAccessEvalFactories, 0, sefs, 0, secondaryFieldAccessEvalFactories.length);
AssignRuntimeFactory assign = new AssignRuntimeFactory(outColumns, sefs, projectionList);
assign.setSourceLocation(sourceLoc);
AlgebricksMetaOperatorDescriptor asterixAssignOp = new AlgebricksMetaOperatorDescriptor(spec, 1, 1,
@@ -557,9 +559,7 @@
}
IScalarEvaluatorFactory[] sefs = new IScalarEvaluatorFactory[secondaryFieldAccessEvalFactories.length];
- for (int i = 0; i < secondaryFieldAccessEvalFactories.length; ++i) {
- sefs[i] = secondaryFieldAccessEvalFactories[i];
- }
+ System.arraycopy(secondaryFieldAccessEvalFactories, 0, sefs, 0, secondaryFieldAccessEvalFactories.length);
//add External RIDs to the projection list
for (int i = 0; i < numPrimaryKeys; i++) {
projectionList[numSecondaryKeys + i] = i + 1;
@@ -601,18 +601,22 @@
this.externalFiles = externalFiles;
}
+ @Override
public RecordDescriptor getSecondaryRecDesc() {
return secondaryRecDesc;
}
+ @Override
public IBinaryComparatorFactory[] getSecondaryComparatorFactories() {
return secondaryComparatorFactories;
}
+ @Override
public IFileSplitProvider getSecondaryFileSplitProvider() {
return secondaryFileSplitProvider;
}
+ @Override
public AlgebricksPartitionConstraint getSecondaryPartitionConstraint() {
return secondaryPartitionConstraint;
}
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/typecomputer/impl/RecordMergeTypeComputer.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/typecomputer/impl/RecordMergeTypeComputer.java
index 9985a4c..0696205 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/typecomputer/impl/RecordMergeTypeComputer.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/typecomputer/impl/RecordMergeTypeComputer.java
@@ -43,6 +43,7 @@
import org.apache.hyracks.util.LogRedactionUtil;
public class RecordMergeTypeComputer implements IResultTypeComputer {
+ private static final SourceLocation DUMMY_LOCATION = new SourceLocation(0, 0);
public static final RecordMergeTypeComputer INSTANCE = new RecordMergeTypeComputer(false);
public static final RecordMergeTypeComputer INSTANCE_IGNORE_DUPLICATES = new RecordMergeTypeComputer(true);
@@ -72,10 +73,18 @@
throw new TypeMismatchException(f.getSourceLocation(), funcId, 1, t1.getTypeTag(), ATypeTag.OBJECT);
}
+ return merge(recType0, recType1, isIgnoreDuplicates, unknownable, f.getSourceLocation());
+ }
+
+ public static IAType merge(ARecordType recType0, ARecordType recType1) throws AlgebricksException {
+ return merge(recType0, recType1, true, false, DUMMY_LOCATION);
+ }
+
+ private static IAType merge(ARecordType recType0, ARecordType recType1, boolean isIgnoreDuplicates,
+ boolean unknownable, SourceLocation sourceLocation) throws AlgebricksException {
+
List<String> resultFieldNames = new ArrayList<>();
- for (String fieldName : recType0.getFieldNames()) {
- resultFieldNames.add(fieldName);
- }
+ Collections.addAll(resultFieldNames, recType0.getFieldNames());
Collections.sort(resultFieldNames);
List<IAType> resultFieldTypes = new ArrayList<>();
@@ -109,17 +118,17 @@
if (isIgnoreDuplicates) {
continue;
}
- // If the ignore duplicates flag is not set, we throw a duplicate field exception
+ // If ignore duplicates flag is not set, we throw a duplicate field exception
else {
- throw new CompilationException(ErrorCode.COMPILATION_DUPLICATE_FIELD_NAME,
- f.getSourceLocation(), LogRedactionUtil.userData(fieldNames[i]));
+ throw new CompilationException(ErrorCode.COMPILATION_DUPLICATE_FIELD_NAME, sourceLocation,
+ LogRedactionUtil.userData(fieldNames[i]));
}
}
// This is for fields with matching names, matching types, type ARecord, do nested merge
if (fieldTypes[i].getTypeTag() == ATypeTag.OBJECT) {
resultFieldTypes.set(pos,
- mergedNestedType(fieldNames[i], fieldTypes[i], resultFieldType, f.getSourceLocation()));
+ mergedNestedType(fieldNames[i], fieldTypes[i], resultFieldType, sourceLocation));
}
} else {
// If no field was found with a matching name, we simply add the field to be merged
@@ -142,8 +151,8 @@
return resultType;
}
- private IAType mergedNestedType(String fieldName, IAType fieldType1, IAType fieldType0, SourceLocation sourceLoc)
- throws AlgebricksException {
+ private static IAType mergedNestedType(String fieldName, IAType fieldType1, IAType fieldType0,
+ SourceLocation sourceLoc) throws AlgebricksException {
if (fieldType1.getTypeTag() != ATypeTag.OBJECT || fieldType0.getTypeTag() != ATypeTag.OBJECT) {
throw new CompilationException(ErrorCode.COMPILATION_DUPLICATE_FIELD_NAME, sourceLoc,
LogRedactionUtil.userData(fieldName));
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/LSMPrimaryUpsertOperatorDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/LSMPrimaryUpsertOperatorDescriptor.java
index 2adad12..3f1cd15 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/LSMPrimaryUpsertOperatorDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/LSMPrimaryUpsertOperatorDescriptor.java
@@ -32,10 +32,11 @@
import org.apache.hyracks.storage.am.common.dataflow.IIndexDataflowHelperFactory;
import org.apache.hyracks.storage.am.common.ophelpers.IndexOperation;
import org.apache.hyracks.storage.am.lsm.common.api.IFrameOperationCallbackFactory;
+import org.apache.hyracks.storage.common.projection.ITupleProjectorFactory;
public class LSMPrimaryUpsertOperatorDescriptor extends LSMTreeInsertDeleteOperatorDescriptor {
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = 2L;
protected final IFrameOperationCallbackFactory frameOpCallbackFactory;
protected final Integer filterSourceIndicator;
protected final ARecordType filterItemType;
@@ -44,6 +45,7 @@
protected final int numPrimaryKeys;
protected final IMissingWriterFactory missingWriterFactory;
protected final boolean hasSecondaries;
+ private final ITupleProjectorFactory projectorFactory;
public LSMPrimaryUpsertOperatorDescriptor(IOperatorDescriptorRegistry spec, RecordDescriptor outRecDesc,
int[] fieldPermutation, IIndexDataflowHelperFactory indexHelperFactory,
@@ -51,7 +53,8 @@
IModificationOperationCallbackFactory modificationOpCallbackFactory,
ISearchOperationCallbackFactory searchOpCallbackFactory,
IFrameOperationCallbackFactory frameOpCallbackFactory, int numPrimaryKeys, Integer filterSourceIndicator,
- ARecordType filterItemType, int filterIndex, boolean hasSecondaries) {
+ ARecordType filterItemType, int filterIndex, boolean hasSecondaries,
+ ITupleProjectorFactory projectorFactory) {
super(spec, outRecDesc, fieldPermutation, IndexOperation.UPSERT, indexHelperFactory, null, true,
modificationOpCallbackFactory);
this.frameOpCallbackFactory = frameOpCallbackFactory;
@@ -62,6 +65,7 @@
this.filterItemType = filterItemType;
this.filterIndex = filterIndex;
this.hasSecondaries = hasSecondaries;
+ this.projectorFactory = projectorFactory;
}
@Override
@@ -70,6 +74,7 @@
RecordDescriptor intputRecDesc = recordDescProvider.getInputRecordDescriptor(getActivityId(), 0);
return new LSMPrimaryUpsertOperatorNodePushable(ctx, partition, indexHelperFactory, fieldPermutation,
intputRecDesc, modCallbackFactory, searchOpCallbackFactory, numPrimaryKeys, filterSourceIndicator,
- filterItemType, filterIndex, frameOpCallbackFactory, missingWriterFactory, hasSecondaries);
+ filterItemType, filterIndex, frameOpCallbackFactory, missingWriterFactory, hasSecondaries,
+ projectorFactory);
}
}
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/LSMPrimaryUpsertOperatorNodePushable.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/LSMPrimaryUpsertOperatorNodePushable.java
index 1e7f4b7..5172cde 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/LSMPrimaryUpsertOperatorNodePushable.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/LSMPrimaryUpsertOperatorNodePushable.java
@@ -45,6 +45,7 @@
import org.apache.hyracks.api.dataflow.value.RecordDescriptor;
import org.apache.hyracks.api.exceptions.HyracksDataException;
import org.apache.hyracks.api.util.CleanupUtils;
+import org.apache.hyracks.api.util.HyracksConstants;
import org.apache.hyracks.dataflow.common.comm.io.ArrayTupleBuilder;
import org.apache.hyracks.dataflow.common.comm.io.ArrayTupleReference;
import org.apache.hyracks.dataflow.common.comm.io.FrameTupleAccessor;
@@ -72,6 +73,8 @@
import org.apache.hyracks.storage.common.IIndexAccessParameters;
import org.apache.hyracks.storage.common.IIndexCursor;
import org.apache.hyracks.storage.common.MultiComparator;
+import org.apache.hyracks.storage.common.projection.ITupleProjector;
+import org.apache.hyracks.storage.common.projection.ITupleProjectorFactory;
import org.apache.hyracks.util.trace.ITracer;
import org.apache.hyracks.util.trace.ITracer.Scope;
import org.apache.hyracks.util.trace.TraceUtils;
@@ -116,6 +119,7 @@
protected LSMTreeIndexAccessor lsmAccessor;
private final ITracer tracer;
private final long traceCategory;
+ private final ITupleProjector tupleProjector;
private long lastRecordInTimeStamp = 0L;
public LSMPrimaryUpsertOperatorNodePushable(IHyracksTaskContext ctx, int partition,
@@ -123,7 +127,8 @@
IModificationOperationCallbackFactory modCallbackFactory,
ISearchOperationCallbackFactory searchCallbackFactory, int numOfPrimaryKeys, Integer filterSourceIndicator,
ARecordType filterItemType, int filterFieldIndex, IFrameOperationCallbackFactory frameOpCallbackFactory,
- IMissingWriterFactory missingWriterFactory, final boolean hasSecondaries) throws HyracksDataException {
+ IMissingWriterFactory missingWriterFactory, boolean hasSecondaries, ITupleProjectorFactory projectorFactory)
+ throws HyracksDataException {
super(ctx, partition, indexHelperFactory, fieldPermutation, inputRecDesc, IndexOperation.UPSERT,
modCallbackFactory, null);
this.key = new PermutingFrameTupleReference();
@@ -132,9 +137,7 @@
this.frameOpCallbackFactory = frameOpCallbackFactory;
missingWriter = missingWriterFactory.createMissingWriter();
int[] searchKeyPermutations = new int[numOfPrimaryKeys];
- for (int i = 0; i < searchKeyPermutations.length; i++) {
- searchKeyPermutations[i] = fieldPermutation[i];
- }
+ System.arraycopy(fieldPermutation, 0, searchKeyPermutations, 0, searchKeyPermutations.length);
key.setFieldPermutation(searchKeyPermutations);
hasMeta = (fieldPermutation.length > numOfPrimaryKeys + 1) && (filterFieldIndex < 0
|| (filterFieldIndex >= 0 && (fieldPermutation.length > numOfPrimaryKeys + 2)));
@@ -152,6 +155,7 @@
processor = createTupleProcessor(hasSecondaries);
tracer = ctx.getJobletContext().getServiceContext().getTracer();
traceCategory = tracer.getRegistry().get(TraceUtils.LATENCY);
+ tupleProjector = projectorFactory.createTupleProjector(ctx);
}
protected void beforeModification(ITupleReference tuple) {
@@ -174,7 +178,7 @@
try {
if (cursor.hasNext()) {
cursor.next();
- prevTuple = cursor.getTuple();
+ prevTuple = tupleProjector.project(cursor.getTuple(), dos, tb);
appendOperationIndicator(!isDelete, true);
appendFilterToPrevTuple();
appendPrevRecord();
@@ -268,6 +272,7 @@
searchCallback = (LockThenSearchOperationCallback) searchCallbackFactory
.createSearchOperationCallback(indexHelper.getResource().getId(), ctx, this);
IIndexAccessParameters iap = new IndexAccessParameters(abstractModCallback, searchCallback);
+ iap.getParameters().put(HyracksConstants.TUPLE_PROJECTOR, tupleProjector);
indexAccessor = index.createAccessor(iap);
lsmAccessor = (LSMTreeIndexAccessor) indexAccessor;
cursor = indexAccessor.createSearchCursor(false);
@@ -277,7 +282,7 @@
LSMIndexUtil.checkAndSetFirstLSN((AbstractLSMIndex) index,
appCtx.getTransactionSubsystem().getLogManager());
frameOpCallback = new IFrameOperationCallback() {
- IFrameOperationCallback callback =
+ final IFrameOperationCallback callback =
frameOpCallbackFactory.createFrameOperationCallback(ctx, (ILSMIndexAccessor) indexAccessor);
@Override
diff --git a/hyracks-fullstack/hyracks/hyracks-storage-am-common/src/main/java/org/apache/hyracks/storage/am/common/impls/NoOpTupleProjector.java b/hyracks-fullstack/hyracks/hyracks-storage-am-common/src/main/java/org/apache/hyracks/storage/am/common/impls/NoOpTupleProjector.java
new file mode 100644
index 0000000..382cbdf
--- /dev/null
+++ b/hyracks-fullstack/hyracks/hyracks-storage-am-common/src/main/java/org/apache/hyracks/storage/am/common/impls/NoOpTupleProjector.java
@@ -0,0 +1,38 @@
+/*
+ * 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.hyracks.storage.am.common.impls;
+
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.hyracks.dataflow.common.comm.io.ArrayTupleBuilder;
+import org.apache.hyracks.dataflow.common.data.accessors.ITupleReference;
+import org.apache.hyracks.storage.common.projection.ITupleProjector;
+
+public class NoOpTupleProjector implements ITupleProjector {
+ static final ITupleProjector INSTANCE = new NoOpTupleProjector();
+
+ private NoOpTupleProjector() {
+ }
+
+ @Override
+ public ITupleReference project(ITupleReference tuple, DataOutput dos, ArrayTupleBuilder tb) throws IOException {
+ return tuple;
+ }
+}
diff --git a/hyracks-fullstack/hyracks/hyracks-storage-am-common/src/main/java/org/apache/hyracks/storage/am/common/impls/NoOpTupleProjectorFactory.java b/hyracks-fullstack/hyracks/hyracks-storage-am-common/src/main/java/org/apache/hyracks/storage/am/common/impls/NoOpTupleProjectorFactory.java
new file mode 100644
index 0000000..206b729
--- /dev/null
+++ b/hyracks-fullstack/hyracks/hyracks-storage-am-common/src/main/java/org/apache/hyracks/storage/am/common/impls/NoOpTupleProjectorFactory.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.hyracks.storage.am.common.impls;
+
+import org.apache.hyracks.api.context.IHyracksTaskContext;
+import org.apache.hyracks.api.exceptions.HyracksDataException;
+import org.apache.hyracks.storage.common.projection.ITupleProjector;
+import org.apache.hyracks.storage.common.projection.ITupleProjectorFactory;
+
+public class NoOpTupleProjectorFactory implements ITupleProjectorFactory {
+ private static final long serialVersionUID = -9141740164848087190L;
+ public static final ITupleProjectorFactory INSTANCE = new NoOpTupleProjectorFactory();
+
+ private NoOpTupleProjectorFactory() {
+ }
+
+ @Override
+ public ITupleProjector createTupleProjector(IHyracksTaskContext context) throws HyracksDataException {
+ return NoOpTupleProjector.INSTANCE;
+ }
+}
diff --git a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-btree-column/src/main/java/org/apache/hyracks/storage/am/lsm/btree/column/impls/btree/ColumnBTreeRangeSearchCursor.java b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-btree-column/src/main/java/org/apache/hyracks/storage/am/lsm/btree/column/impls/btree/ColumnBTreeRangeSearchCursor.java
index fe980cc..7ebdc8b 100644
--- a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-btree-column/src/main/java/org/apache/hyracks/storage/am/lsm/btree/column/impls/btree/ColumnBTreeRangeSearchCursor.java
+++ b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-btree-column/src/main/java/org/apache/hyracks/storage/am/lsm/btree/column/impls/btree/ColumnBTreeRangeSearchCursor.java
@@ -152,21 +152,26 @@
}
protected void advanceTupleToLowKey() throws HyracksDataException {
- if (highKey != null && isLessOrEqual(highKey, frame.getLeftmostTuple(), !pred.isHighKeyInclusive())) {
+ if (highKey != null && isLessOrEqual(highKey, frame.getLeftmostTuple(), !pred.isHighKeyInclusive())
+ || lowKey != null && isLessOrEqual(frame.getRightmostTuple(), lowKey, !pred.isLowKeyInclusive())) {
/*
- * Lowest key from the frame is greater than the requested highKey. No tuple will satisfy the search
- * key. Consume the frameTuple to stop the search
+ * If
+ * - The Lowest key from the frame is greater than the requested highKey
+ * OR
+ * - The highest key from the frame is less than the requested lowKey
+ * Then:
+ * No tuple will satisfy the search key. Consume the frameTuple to stop the search.
*/
firstNextCall = false;
frameTuple.consume();
return;
} else if (lowKey == null) {
- //No range was specified.
+ // no lowKey was specified, start from tupleIndex = 0
frameTuple.next();
return;
}
- //The lowKey is somewhere within the frame tuples
+ //The requested key is somewhere within the frame tuples
boolean stop = false;
int counter = 0;
while (!stop && !frameTuple.isConsumed()) {
@@ -174,8 +179,10 @@
stop = isLessOrEqual(lowKey, frameTuple, pred.isLowKeyInclusive());
counter++;
}
- //Advance all columns to the proper position
- frameTuple.skip(counter - 1);
+ //Advance all columns to the proper position if needed
+ if (counter - 1 > 0) {
+ frameTuple.skip(counter - 1);
+ }
}
protected void releasePages() throws HyracksDataException {
@@ -189,7 +196,7 @@
private boolean isLessOrEqual(ITupleReference left, ITupleReference right, boolean inclusive)
throws HyracksDataException {
int cmp = originalKeyCmp.compare(left, right);
- return cmp < 0 || cmp == 0 && inclusive;
+ return cmp < 0 || inclusive && cmp == 0;
}
@Override