This is an automated email from the ASF dual-hosted git repository. mblow pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/asterixdb.git
commit 47ff45ea15a651ae998c87d6157d1a3d2bb5b99e Author: Wail Alkowaileet <[email protected]> AuthorDate: Tue Jul 30 20:12:06 2024 +0300 [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 <[email protected]> Tested-by: Jenkins <[email protected]> Integration-Tests: Wail Alkowaileet <[email protected]> --- .../column/upsert/003/003.001.ddl.sqlpp | 33 ++++++++++++++++++++++ .../column/upsert/003/003.002.update.sqlpp | 30 ++++++++++++++++++++ .../column/upsert/003/003.003.get.http | 19 +++++++++++++ .../column/upsert/003/003.004.query.sqlpp | 25 ++++++++++++++++ .../results/column/upsert/003/003.003.regexadm | 1 + .../results/column/upsert/003/003.004.adm | 1 + .../src/test/resources/runtimets/sqlpp_queries.xml | 7 ++++- .../values/reader/value/UUIDValueReader.java | 1 + 8 files changed, 116 insertions(+), 1 deletion(-) 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 0000000000..93462f65da --- /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 0000000000..f3fd0b3b8c --- /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 0000000000..57d830aed0 --- /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 0000000000..896331257f --- /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 0000000000..64695de098 --- /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 0000000000..83b33d238d --- /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 afb829eb8f..f7e5d912ea 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 75179601ee..741d9b39d8 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 final class UUIDValueReader extends AbstractValueReader { public UUIDValueReader() { ArrayBackedValueStorage storage = new ArrayBackedValueStorage(16); + storage.setSize(16); uuidReader = new ParquetPlainFixedLengthValuesReader(storage); }
