[ASTERIXDB-3469][STO] Fix UUID reader value length
- user model changes: no
- storage format changes: no
- interface changes: yes
Details:
The length of the storage used to read UUID length
values is not set to 16.
Ext-ref: MB-62909
Change-Id: Idd9d1e72ea583365f3adce0f6316b07e44122b81
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/18545
Reviewed-by: Murtadha Hubail <mhubail@apache.org>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Wail Alkowaileet <wael.y.k@gmail.com>
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/003/003.001.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/003/003.001.ddl.sqlpp
new file mode 100644
index 0000000..93462f6
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/003/003.001.ddl.sqlpp
@@ -0,0 +1,33 @@
+/*
+ * 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 RowDataset
+PRIMARY KEY (id: uuid) AUTOGENERATED WITH {
+ "storage-format": {"format" : "row"}
+};
+
+CREATE DATASET ColumnDataset
+PRIMARY KEY (id: uuid) WITH {
+ "storage-format": {"format" : "column"}
+};
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/003/003.002.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/003/003.002.update.sqlpp
new file mode 100644
index 0000000..f3fd0b3
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/003/003.002.update.sqlpp
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+USE test;
+
+UPSERT INTO RowDataset (
+ SELECT UUID() AS myUUID
+ FROM RANGE(1, 1000) x
+);
+
+UPSERT INTO ColumnDataset (
+ SELECT VALUE r
+ FROM RowDataset r
+);
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/003/003.003.get.http b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/003/003.003.get.http
new file mode 100644
index 0000000..57d830a
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/003/003.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=ColumnDataset
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/003/003.004.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/003/003.004.query.sqlpp
new file mode 100644
index 0000000..8963312
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/upsert/003/003.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 VALUE COUNT(*)
+FROM RowDataset r, ColumnDataset c
+WHERE r.id = c.id
+ AND r.myUUID = c.myUUID;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/003/003.003.regexadm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/003/003.003.regexadm
new file mode 100644
index 0000000..64695de
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/003/003.003.regexadm
@@ -0,0 +1 @@
+\Q{"keys":"id","type":{"type":"org.apache.asterix.om.types.ARecordType","name":"AnyObject","open":true,"fields":[]},"splits":[\E.*\Q]}\E
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/003/003.004.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/003/003.004.adm
new file mode 100644
index 0000000..83b33d2
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/upsert/003/003.004.adm
@@ -0,0 +1 @@
+1000
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 afb829e..f7e5d91 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/sqlpp_queries.xml
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/sqlpp_queries.xml
@@ -16423,6 +16423,11 @@
<output-dir compare="Text">upsert/002</output-dir>
</compilation-unit>
</test-case>
+ <test-case FilePath="column">
+ <compilation-unit name="upsert/003">
+ <output-dir compare="Text">upsert/003</output-dir>
+ </compilation-unit>
+ </test-case>
<test-case FilePath="column" check-warnings="true">
<compilation-unit name="filter/001">
<output-dir compare="Text">filter/001</output-dir>
@@ -16645,4 +16650,4 @@
</compilation-unit>
</test-case>
</test-group>
-</test-group>
\ No newline at end of file
+</test-group>
diff --git a/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/values/reader/value/UUIDValueReader.java b/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/values/reader/value/UUIDValueReader.java
index 7517960..741d9b3 100644
--- a/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/values/reader/value/UUIDValueReader.java
+++ b/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/values/reader/value/UUIDValueReader.java
@@ -33,6 +33,7 @@
public UUIDValueReader() {
ArrayBackedValueStorage storage = new ArrayBackedValueStorage(16);
+ storage.setSize(16);
uuidReader = new ParquetPlainFixedLengthValuesReader(storage);
}