This is an automated email from the ASF dual-hosted git repository.

peeyush pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/asterixdb.git


The following commit(s) were added to refs/heads/master by this push:
     new 44bdd1731c [NO ISSUE][MTD] Fix for standalone collection with columnar 
storage
44bdd1731c is described below

commit 44bdd1731cd2b58335c07567977d2d3c377f08bb
Author: Peeyush Gupta <[email protected]>
AuthorDate: Fri Aug 11 11:42:16 2023 -0700

    [NO ISSUE][MTD] Fix for standalone collection with columnar storage
    
    - user model changes: no
    - storage format changes: no
    - interface changes: no
    
    Details:
    With standalone collections, the record type was missing
    the primary key when passed to TupleProjectorFactory.
    
    Change-Id: I3aede214cdfd3c0e6d00378bd07acaf7192b1195
    Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/17721
    Integration-Tests: Jenkins <[email protected]>
    Tested-by: Jenkins <[email protected]>
    Reviewed-by: Peeyush Gupta <[email protected]>
    Reviewed-by: Wail Alkowaileet <[email protected]>
---
 .../columnar-dataset/columnar-dataset.01.ddl.sqlpp | 30 ++++++++++++++++++++
 .../columnar-dataset.02.update.sqlpp               | 32 ++++++++++++++++++++++
 .../columnar-dataset.03.query.sqlpp                | 22 +++++++++++++++
 .../columnar-dataset.04.query.sqlpp                | 22 +++++++++++++++
 .../columnar-dataset.05.query.sqlpp                | 21 ++++++++++++++
 .../columnar-dataset/columnar-dataset.06.ddl.sqlpp | 24 ++++++++++++++++
 .../columnar-dataset/columnar-dataset.03.adm       |  9 ++++++
 .../columnar-dataset/columnar-dataset.04.adm       |  1 +
 .../columnar-dataset/columnar-dataset.05.adm       |  4 +++
 .../test/resources/runtimets/testsuite_sqlpp.xml   |  5 ++++
 .../metadata/declared/DatasetDataSource.java       |  2 ++
 11 files changed, 172 insertions(+)

diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/atomic-statements/columnar-dataset/columnar-dataset.01.ddl.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/atomic-statements/columnar-dataset/columnar-dataset.01.ddl.sqlpp
new file mode 100644
index 0000000000..f9868aceaa
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/atomic-statements/columnar-dataset/columnar-dataset.01.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 test if exists;
+create dataverse test;
+use test;
+
+create dataset reviews primary key (id: int) WITH {
+    "storage-format": {"format": "column"}
+};
+
+CREATE PRIMARY INDEX review_idx_primary ON reviews;
+
+CREATE INDEX review_idx_review ON reviews(review: string?) TYPE BTREE;
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/atomic-statements/columnar-dataset/columnar-dataset.02.update.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/atomic-statements/columnar-dataset/columnar-dataset.02.update.sqlpp
new file mode 100644
index 0000000000..b0c59dfc5e
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/atomic-statements/columnar-dataset/columnar-dataset.02.update.sqlpp
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+ use test;
+
+upsert into reviews ([
+    {"id": 1, "year": null, "quarter": null, "review": "good"},
+    {"id": 2, "year": null, "quarter": null, "review": "good"},
+    {"id": 3, "year": 2018, "quarter": null, "review": "good"},
+    {"id": 4, "year": 2018, "quarter": null, "review": "bad"},
+    {"id": 5, "year": 2018, "quarter": 1, "review": "bad"},
+    {"id": 7, "year": 2018, "quarter": 2, "review": "good"},
+    {"id": 8, "year": 2018, "quarter": 2, "review": "bad"},
+    {"id": 9, "year": 2019, "quarter": null, "review": "good"},
+    {"id": 10, "year": 2019, "quarter": null, "review": "bad"}
+]);
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/atomic-statements/columnar-dataset/columnar-dataset.03.query.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/atomic-statements/columnar-dataset/columnar-dataset.03.query.sqlpp
new file mode 100644
index 0000000000..11d5a3f9dc
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/atomic-statements/columnar-dataset/columnar-dataset.03.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.
+ */
+use test;
+
+select *
+from reviews order by id;
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/atomic-statements/columnar-dataset/columnar-dataset.04.query.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/atomic-statements/columnar-dataset/columnar-dataset.04.query.sqlpp
new file mode 100644
index 0000000000..8709326bc9
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/atomic-statements/columnar-dataset/columnar-dataset.04.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.
+ */
+use test;
+
+select value count(*)
+from reviews;
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/atomic-statements/columnar-dataset/columnar-dataset.05.query.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/atomic-statements/columnar-dataset/columnar-dataset.05.query.sqlpp
new file mode 100644
index 0000000000..4438fe60ef
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/atomic-statements/columnar-dataset/columnar-dataset.05.query.sqlpp
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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 id,year from reviews where id < 5 order by id;
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/atomic-statements/columnar-dataset/columnar-dataset.06.ddl.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/atomic-statements/columnar-dataset/columnar-dataset.06.ddl.sqlpp
new file mode 100644
index 0000000000..3cc900bbb5
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/atomic-statements/columnar-dataset/columnar-dataset.06.ddl.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;
+
+drop dataset reviews;
+
+drop dataverse test;
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/atomic-statements/columnar-dataset/columnar-dataset.03.adm
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/atomic-statements/columnar-dataset/columnar-dataset.03.adm
new file mode 100644
index 0000000000..e542bd0127
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/atomic-statements/columnar-dataset/columnar-dataset.03.adm
@@ -0,0 +1,9 @@
+{ "reviews": { "id": 1, "year": null, "quarter": null, "review": "good" } }
+{ "reviews": { "id": 2, "year": null, "quarter": null, "review": "good" } }
+{ "reviews": { "id": 3, "year": 2018, "quarter": null, "review": "good" } }
+{ "reviews": { "id": 4, "year": 2018, "quarter": null, "review": "bad" } }
+{ "reviews": { "id": 5, "year": 2018, "quarter": 1, "review": "bad" } }
+{ "reviews": { "id": 7, "year": 2018, "quarter": 2, "review": "good" } }
+{ "reviews": { "id": 8, "year": 2018, "quarter": 2, "review": "bad" } }
+{ "reviews": { "id": 9, "year": 2019, "quarter": null, "review": "good" } }
+{ "reviews": { "id": 10, "year": 2019, "quarter": null, "review": "bad" } }
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/atomic-statements/columnar-dataset/columnar-dataset.04.adm
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/atomic-statements/columnar-dataset/columnar-dataset.04.adm
new file mode 100644
index 0000000000..f11c82a4cb
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/atomic-statements/columnar-dataset/columnar-dataset.04.adm
@@ -0,0 +1 @@
+9
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/atomic-statements/columnar-dataset/columnar-dataset.05.adm
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/atomic-statements/columnar-dataset/columnar-dataset.05.adm
new file mode 100644
index 0000000000..e908ea50ed
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/atomic-statements/columnar-dataset/columnar-dataset.05.adm
@@ -0,0 +1,4 @@
+{ "id": 1, "year": null }
+{ "id": 2, "year": null }
+{ "id": 3, "year": 2018 }
+{ "id": 4, "year": 2018 }
\ No newline at end of file
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 16d5719d76..6d83fb5d84 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
@@ -16371,5 +16371,10 @@
         <output-dir compare="Clean-JSON">atomic-statements-4</output-dir>
       </compilation-unit>
     </test-case>
+    <test-case FilePath="atomic-statements">
+      <compilation-unit name="columnar-dataset">
+        <output-dir compare="Clean-JSON">columnar-dataset</output-dir>
+      </compilation-unit>
+    </test-case>
   </test-group>
 </test-suite>
diff --git 
a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/declared/DatasetDataSource.java
 
b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/declared/DatasetDataSource.java
index f4e15de534..9a7494f77e 100644
--- 
a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/declared/DatasetDataSource.java
+++ 
b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/declared/DatasetDataSource.java
@@ -161,6 +161,8 @@ public class DatasetDataSource extends DataSource {
                                     dataset.getMetaItemTypeDataverseName(), 
dataset.getMetaItemTypeName())
                             .getDatatype();
                 }
+                datasetType = (ARecordType) 
metadataProvider.findTypeForDatasetWithoutType(datasetType, metaItemType,
+                        dataset);
                 int numberOfPrimaryKeys = dataset.getPrimaryKeys().size();
                 ITupleProjectorFactory tupleProjectorFactory =
                         IndexUtil.createTupleProjectorFactory(context, 
typeEnv, dataset.getDatasetFormatInfo(),

Reply via email to