[ASTERIXDB-3289][TEST] Add test
- user model changes: no
- storage format changes: no
- interface changes: no
Details:
Add test for ASTERIXDB-3289
Change-Id: Iba7a4bbcd3b273953caab7f0e04f1a432fb2ab8e
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/17880
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Murtadha Hubail <mhubail@apache.org>
Tested-by: Wail Alkowaileet <wael.y.k@gmail.com>
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/composite-pks/composite-pks.001.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/composite-pks/composite-pks.001.ddl.sqlpp
new file mode 100644
index 0000000..f2b599e
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/composite-pks/composite-pks.001.ddl.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.
+ */
+
+DROP DATAVERSE test IF EXISTS;
+CREATE DATAVERSE test;
+USE test;
+
+CREATE COLLECTION CompositeKey
+PRIMARY KEY (k1: string, k2: string)
+WITH {
+ "storage-format": {"format":"column"}
+};
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/composite-pks/composite-pks.002.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/composite-pks/composite-pks.002.update.sqlpp
new file mode 100644
index 0000000..d21be80
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/composite-pks/composite-pks.002.update.sqlpp
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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;
+
+/*
+ * Those are atomic UPSERT and each will produce a component
+ */
+
+UPSERT INTO CompositeKey (
+ {"k1": "1", "k2": "The quick brown fox jumps over the lazy dog"},
+ {"k1": "2", "k2": "The quick brown fox jumps over the lazy dog"},
+ {"k1": "3", "k2": "The quick brown fox jumps over the lazy dog"},
+ {"k1": "4", "k2": "The quick brown fox jumps over the lazy dog"},
+ {"k1": "5", "k2": "The quick brown fox jumps over the lazy dog"},
+ {"k1": "6", "k2": "The quick brown fox jumps over the lazy dog"},
+ {"k1": "7", "k2": "The quick brown fox jumps over the lazy dog"},
+ {"k1": "8", "k2": "The quick brown fox jumps over the lazy dog"},
+ {"k1": "9", "k2": "The quick brown fox jumps over the lazy dog"}
+);
+
+UPSERT INTO CompositeKey (
+ {"k1": "10", "k2": "The quick brown fox jumps over the lazy dog"},
+ {"k1": "20", "k2": "The quick brown fox jumps over the lazy dog"},
+ {"k1": "30", "k2": "The quick brown fox jumps over the lazy dog"},
+ {"k1": "40", "k2": "The quick brown fox jumps over the lazy dog"},
+ {"k1": "50", "k2": "The quick brown fox jumps over the lazy dog"},
+ {"k1": "60", "k2": "The quick brown fox jumps over the lazy dog"},
+ {"k1": "70", "k2": "The quick brown fox jumps over the lazy dog"},
+ {"k1": "80", "k2": "The quick brown fox jumps over the lazy dog"},
+ {"k1": "90", "k2": "The quick brown fox jumps over the lazy dog"}
+);
+
+UPSERT INTO CompositeKey (
+ {"k1": "11", "k2": "The quick brown fox jumps over the lazy dog"},
+ {"k1": "21", "k2": "The quick brown fox jumps over the lazy dog"},
+ {"k1": "31", "k2": "The quick brown fox jumps over the lazy dog"},
+ {"k1": "41", "k2": "The quick brown fox jumps over the lazy dog"},
+ {"k1": "51", "k2": "The quick brown fox jumps over the lazy dog"},
+ {"k1": "61", "k2": "The quick brown fox jumps over the lazy dog"},
+ {"k1": "71", "k2": "The quick brown fox jumps over the lazy dog"},
+ {"k1": "81", "k2": "The quick brown fox jumps over the lazy dog"},
+ {"k1": "91", "k2": "The quick brown fox jumps over the lazy dog"}
+);
+
+-- Compact the dataset just in case the merge policy changes from 3 components to trigger a merge
+COMPACT DATASET CompositeKey;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/composite-pks/composite-pks.003.sleep.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/composite-pks/composite-pks.003.sleep.sqlpp
new file mode 100644
index 0000000..c0e90c8
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/composite-pks/composite-pks.003.sleep.sqlpp
@@ -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.
+ */
+
+5000
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/composite-pks/composite-pks.004.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/composite-pks/composite-pks.004.query.sqlpp
new file mode 100644
index 0000000..f14acad
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/composite-pks/composite-pks.004.query.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;
+
+SELECT VALUE c
+FROM CompositeKey c
+ORDER BY to_bigint(k1);
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/composite-pks/composite-pks.004.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/composite-pks/composite-pks.004.adm
new file mode 100644
index 0000000..c38033d
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/composite-pks/composite-pks.004.adm
@@ -0,0 +1,27 @@
+{ "k1": "1", "k2": "The quick brown fox jumps over the lazy dog" }
+{ "k1": "2", "k2": "The quick brown fox jumps over the lazy dog" }
+{ "k1": "3", "k2": "The quick brown fox jumps over the lazy dog" }
+{ "k1": "4", "k2": "The quick brown fox jumps over the lazy dog" }
+{ "k1": "5", "k2": "The quick brown fox jumps over the lazy dog" }
+{ "k1": "6", "k2": "The quick brown fox jumps over the lazy dog" }
+{ "k1": "7", "k2": "The quick brown fox jumps over the lazy dog" }
+{ "k1": "8", "k2": "The quick brown fox jumps over the lazy dog" }
+{ "k1": "9", "k2": "The quick brown fox jumps over the lazy dog" }
+{ "k1": "10", "k2": "The quick brown fox jumps over the lazy dog" }
+{ "k1": "11", "k2": "The quick brown fox jumps over the lazy dog" }
+{ "k1": "20", "k2": "The quick brown fox jumps over the lazy dog" }
+{ "k1": "21", "k2": "The quick brown fox jumps over the lazy dog" }
+{ "k1": "30", "k2": "The quick brown fox jumps over the lazy dog" }
+{ "k1": "31", "k2": "The quick brown fox jumps over the lazy dog" }
+{ "k1": "40", "k2": "The quick brown fox jumps over the lazy dog" }
+{ "k1": "41", "k2": "The quick brown fox jumps over the lazy dog" }
+{ "k1": "50", "k2": "The quick brown fox jumps over the lazy dog" }
+{ "k1": "51", "k2": "The quick brown fox jumps over the lazy dog" }
+{ "k1": "60", "k2": "The quick brown fox jumps over the lazy dog" }
+{ "k1": "61", "k2": "The quick brown fox jumps over the lazy dog" }
+{ "k1": "70", "k2": "The quick brown fox jumps over the lazy dog" }
+{ "k1": "71", "k2": "The quick brown fox jumps over the lazy dog" }
+{ "k1": "80", "k2": "The quick brown fox jumps over the lazy dog" }
+{ "k1": "81", "k2": "The quick brown fox jumps over the lazy dog" }
+{ "k1": "90", "k2": "The quick brown fox jumps over the lazy dog" }
+{ "k1": "91", "k2": "The quick brown fox jumps over the lazy dog" }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/sqlpp_queries.xml b/asterixdb/asterix-app/src/test/resources/runtimets/sqlpp_queries.xml
index 0f537d7..8df4599 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/sqlpp_queries.xml
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/sqlpp_queries.xml
@@ -16161,6 +16161,11 @@
</compilation-unit>
</test-case>
<test-case FilePath="column">
+ <compilation-unit name="composite-pks">
+ <output-dir compare="Text">composite-pks</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="column">
<compilation-unit name="meta/meta_after_gby">
<output-dir compare="Text">meta/meta_after_gby</output-dir>
</compilation-unit>