Steven Jacobs has uploaded a new change for review. https://asterix-gerrit.ics.uci.edu/1091
Change subject: ASTERIXDB-1587 Test upsert when using foreign datatype ...................................................................... ASTERIXDB-1587 Test upsert when using foreign datatype Change-Id: I4c374a44389af5916c8398afb3be8628b7872389 --- M asterixdb/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/drop-dataverse/drop-dataverse.1.ddl.aql A asterixdb/asterix-app/src/test/resources/runtimets/queries/upsert/issue1587-foriegnDataType/primary-index.1.ddl.aql A asterixdb/asterix-app/src/test/resources/runtimets/queries/upsert/issue1587-foriegnDataType/primary-index.2.update.aql A asterixdb/asterix-app/src/test/resources/runtimets/queries/upsert/issue1587-foriegnDataType/primary-index.3.query.aql A asterixdb/asterix-app/src/test/resources/runtimets/results/upsert/issue1587-foriegnDataType/issue1587-foriegnDataType.1.adm M asterixdb/asterix-app/src/test/resources/runtimets/testsuite.xml 6 files changed, 113 insertions(+), 1 deletion(-) git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/91/1091/1 diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/drop-dataverse/drop-dataverse.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/drop-dataverse/drop-dataverse.1.ddl.aql index b9b280c..c71bc9b 100644 --- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/drop-dataverse/drop-dataverse.1.ddl.aql +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/drop-dataverse/drop-dataverse.1.ddl.aql @@ -25,8 +25,8 @@ */ -drop dataverse a if exists; drop dataverse b if exists; +drop dataverse a if exists; create dataverse a; create dataverse b; diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/upsert/issue1587-foriegnDataType/primary-index.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/upsert/issue1587-foriegnDataType/primary-index.1.ddl.aql new file mode 100644 index 0000000..e64f67c --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/upsert/issue1587-foriegnDataType/primary-index.1.ddl.aql @@ -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. + */ +/* + * Description : Upsert into a dataset which has a foreign datatype + * Expected Res : Success + * Date : Aug 18th 2016 + */ + +drop dataverse b if exists; +drop dataverse a if exists; +create dataverse a; +create dataverse b; +use dataverse a; + +create type TypeA as closed{ +id:int32, +age:int32 +}; + +use dataverse b; + +create dataset UpsertTo(a.TypeA) primary key id; \ No newline at end of file diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/upsert/issue1587-foriegnDataType/primary-index.2.update.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/upsert/issue1587-foriegnDataType/primary-index.2.update.aql new file mode 100644 index 0000000..6c3f6b4 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/upsert/issue1587-foriegnDataType/primary-index.2.update.aql @@ -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. + */ +/* + * Description : Upsert into a dataset which has a foreign datatype + * Expected Res : Success + * Date : Aug 18th 2016 + */ + +// upsert UpsertFrom into UpsertTo +use dataverse b; + +upsert into dataset UpsertTo( +{"id":1,"age":7} +); + +upsert into dataset UpsertTo( +{"id":2,"age":8} +); + +upsert into dataset UpsertTo( +{"id":1,"age":9} +); \ No newline at end of file diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/upsert/issue1587-foriegnDataType/primary-index.3.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/upsert/issue1587-foriegnDataType/primary-index.3.query.aql new file mode 100644 index 0000000..972049c --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/upsert/issue1587-foriegnDataType/primary-index.3.query.aql @@ -0,0 +1,29 @@ +/* + * 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 : Upsert into a dataset which has a foreign datatype + * Expected Res : Success + * Date : Aug 18th 2016 + */ + +use dataverse b; + +for $x in dataset UpsertTo +return $x; + diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/upsert/issue1587-foriegnDataType/issue1587-foriegnDataType.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/upsert/issue1587-foriegnDataType/issue1587-foriegnDataType.1.adm new file mode 100644 index 0000000..ab1f6f2 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/upsert/issue1587-foriegnDataType/issue1587-foriegnDataType.1.adm @@ -0,0 +1,2 @@ +{ "id": 1, "age": 9 } +{ "id": 2, "age": 8 } \ No newline at end of file diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite.xml b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite.xml index 749965e..c6d39e0 100644 --- a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite.xml +++ b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite.xml @@ -257,6 +257,11 @@ </compilation-unit> </test-case> <test-case FilePath="upsert"> + <compilation-unit name="issue1587-foriegnDataType"> + <output-dir compare="Text">issue1587-foriegnDataType</output-dir> + </compilation-unit> + </test-case> + <test-case FilePath="upsert"> <compilation-unit name="nested-index"> <output-dir compare="Text">nested-index</output-dir> </compilation-unit> -- To view, visit https://asterix-gerrit.ics.uci.edu/1091 To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4c374a44389af5916c8398afb3be8628b7872389 Gerrit-PatchSet: 1 Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Owner: Steven Jacobs <[email protected]>
