http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-empty-dataset/insert-into-empty-dataset.3.query.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-empty-dataset/insert-into-empty-dataset.3.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-empty-dataset/insert-into-empty-dataset.3.query.aql new file mode 100644 index 0000000..62ef918 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-empty-dataset/insert-into-empty-dataset.3.query.aql @@ -0,0 +1,31 @@ +/* + * 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. + */ +/* + * Test case Name : insert-into-empty-dataset.aql + * Description : Check that we can insert into an empty dataset + * Expected Result : Success + * Date : May 2 2012 + */ + +use dataverse test; + +for $c in dataset('LineID') +where $c.l_suppkey < 100 and $c.l_linenumber<5 +order by $c.l_orderkey, $c.l_linenumber +return $c
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_01/insert-into-loaded-dataset-with-index_01.1.ddl.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_01/insert-into-loaded-dataset-with-index_01.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_01/insert-into-loaded-dataset-with-index_01.1.ddl.aql new file mode 100644 index 0000000..c46a95a --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_01/insert-into-loaded-dataset-with-index_01.1.ddl.aql @@ -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. + */ +drop dataverse test if exists; +create dataverse test; + +use dataverse test; + +create type LineIDType as closed { + l_orderkey: int64, + l_linenumber: int64, + l_suppkey: int64 +} + +create dataset LineID(LineIDType) + primary key l_orderkey, l_linenumber; + http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_01/insert-into-loaded-dataset-with-index_01.2.update.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_01/insert-into-loaded-dataset-with-index_01.2.update.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_01/insert-into-loaded-dataset-with-index_01.2.update.aql new file mode 100644 index 0000000..3d291b7 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_01/insert-into-loaded-dataset-with-index_01.2.update.aql @@ -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 dataverse test; + +load dataset LineID +using localfs +(("path"="asterix_nc1://data/tpch0.001/lineitem_0.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted; + http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_01/insert-into-loaded-dataset-with-index_01.3.ddl.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_01/insert-into-loaded-dataset-with-index_01.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_01/insert-into-loaded-dataset-with-index_01.3.ddl.aql new file mode 100644 index 0000000..2889cba --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_01/insert-into-loaded-dataset-with-index_01.3.ddl.aql @@ -0,0 +1,23 @@ +/* + * 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 dataverse test; + +create index idx_LineID_partkey on LineID(l_linenumber); +create index idx_LineID_suppkey on LineID(l_suppkey); + http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_01/insert-into-loaded-dataset-with-index_01.4.update.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_01/insert-into-loaded-dataset-with-index_01.4.update.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_01/insert-into-loaded-dataset-with-index_01.4.update.aql new file mode 100644 index 0000000..f33d1a9 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_01/insert-into-loaded-dataset-with-index_01.4.update.aql @@ -0,0 +1,42 @@ +/* + * 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 dataverse test; + +insert into dataset LineID ( +let $x:=1 +let $y:=2 +let $z:=3 +return { + "l_orderkey": $x, + "l_linenumber": $y, + "l_suppkey": $z +} +); + +insert into dataset LineID ( +let $x:=2 +let $y:=3 +let $z:=4 +return { + "l_orderkey": $x, + "l_linenumber": $y, + "l_suppkey": $z +} +); + http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_01/insert-into-loaded-dataset-with-index_01.5.query.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_01/insert-into-loaded-dataset-with-index_01.5.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_01/insert-into-loaded-dataset-with-index_01.5.query.aql new file mode 100644 index 0000000..7a6d3d2 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_01/insert-into-loaded-dataset-with-index_01.5.query.aql @@ -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 dataverse test; + +for $c in dataset('LineID') +where $c.l_suppkey = 3 and $c.l_linenumber=2 +order by $c.l_orderkey, $c.l_linenumber +return $c http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_02/insert-into-loaded-dataset-with-index_02.1.ddl.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_02/insert-into-loaded-dataset-with-index_02.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_02/insert-into-loaded-dataset-with-index_02.1.ddl.aql new file mode 100644 index 0000000..2b9b7c6 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_02/insert-into-loaded-dataset-with-index_02.1.ddl.aql @@ -0,0 +1,54 @@ +/* + * 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 dataverse test; + +create type LineItemType as closed { + l_orderkey: int64, + l_partkey: int64, + l_suppkey: int64, + l_linenumber: int64, + l_quantity: double, + l_extendedprice: double, + l_discount: double, + l_tax: double, + l_returnflag: string, + l_linestatus: string, + l_shipdate: string, + l_commitdate: string, + l_receiptdate: string, + l_shipinstruct: string, + l_shipmode: string, + l_comment: string +} + +create type LineIDType as closed { + l_orderkey: int64, + l_linenumber: int64, + l_suppkey: int64 +} + +create dataset LineItem(LineItemType) + primary key l_orderkey, l_linenumber; + +create dataset LineID(LineIDType) + primary key l_orderkey, l_linenumber; + http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_02/insert-into-loaded-dataset-with-index_02.2.update.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_02/insert-into-loaded-dataset-with-index_02.2.update.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_02/insert-into-loaded-dataset-with-index_02.2.update.aql new file mode 100644 index 0000000..7e944cd --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_02/insert-into-loaded-dataset-with-index_02.2.update.aql @@ -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. + */ +use dataverse test; + +load dataset LineItem +using localfs +(("path"="asterix_nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted; + +load dataset LineID +using localfs +(("path"="asterix_nc1://data/tpch0.001/lineitem_0.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted; + http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_02/insert-into-loaded-dataset-with-index_02.3.ddl.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_02/insert-into-loaded-dataset-with-index_02.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_02/insert-into-loaded-dataset-with-index_02.3.ddl.aql new file mode 100644 index 0000000..2889cba --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_02/insert-into-loaded-dataset-with-index_02.3.ddl.aql @@ -0,0 +1,23 @@ +/* + * 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 dataverse test; + +create index idx_LineID_partkey on LineID(l_linenumber); +create index idx_LineID_suppkey on LineID(l_suppkey); + http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_02/insert-into-loaded-dataset-with-index_02.4.update.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_02/insert-into-loaded-dataset-with-index_02.4.update.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_02/insert-into-loaded-dataset-with-index_02.4.update.aql new file mode 100644 index 0000000..8f481e7 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_02/insert-into-loaded-dataset-with-index_02.4.update.aql @@ -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 dataverse test; + +insert into dataset LineID ( +for $l in dataset('LineItem') + where $l.l_orderkey<10 + return { + "l_orderkey": $l.l_orderkey, + "l_linenumber": $l.l_linenumber, + "l_suppkey": $l.l_partkey + } +); + http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_02/insert-into-loaded-dataset-with-index_02.5.query.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_02/insert-into-loaded-dataset-with-index_02.5.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_02/insert-into-loaded-dataset-with-index_02.5.query.aql new file mode 100644 index 0000000..2148e8f --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_02/insert-into-loaded-dataset-with-index_02.5.query.aql @@ -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 dataverse test; + +for $c in dataset('LineID') +where $c.l_suppkey < 100 and $c.l_linenumber<5 +order by $c.l_orderkey, $c.l_linenumber +return $c + http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset_01/insert-into-loaded-dataset_01.1.ddl.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset_01/insert-into-loaded-dataset_01.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset_01/insert-into-loaded-dataset_01.1.ddl.aql new file mode 100644 index 0000000..c46a95a --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset_01/insert-into-loaded-dataset_01.1.ddl.aql @@ -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. + */ +drop dataverse test if exists; +create dataverse test; + +use dataverse test; + +create type LineIDType as closed { + l_orderkey: int64, + l_linenumber: int64, + l_suppkey: int64 +} + +create dataset LineID(LineIDType) + primary key l_orderkey, l_linenumber; + http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset_01/insert-into-loaded-dataset_01.2.update.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset_01/insert-into-loaded-dataset_01.2.update.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset_01/insert-into-loaded-dataset_01.2.update.aql new file mode 100644 index 0000000..42c8f18 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset_01/insert-into-loaded-dataset_01.2.update.aql @@ -0,0 +1,46 @@ +/* + * 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 dataverse test; + +load dataset LineID +using localfs +(("path"="asterix_nc1://data/tpch0.001/lineitem_0.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted; + +insert into dataset LineID ( +let $x:=1 +let $y:=2 +let $z:=3 +return { + "l_orderkey": $x, + "l_linenumber": $y, + "l_suppkey": $z +} +); + +insert into dataset LineID ( +let $x:=2 +let $y:=3 +let $z:=4 +return { + "l_orderkey": $x, + "l_linenumber": $y, + "l_suppkey": $z +} +); + http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset_01/insert-into-loaded-dataset_01.3.query.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset_01/insert-into-loaded-dataset_01.3.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset_01/insert-into-loaded-dataset_01.3.query.aql new file mode 100644 index 0000000..2140d72 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset_01/insert-into-loaded-dataset_01.3.query.aql @@ -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 dataverse test; + +for $c in dataset('LineID') +where $c.l_suppkey < 100 and $c.l_linenumber<5 +order by $c.l_orderkey, $c.l_linenumber +return $c http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset_02/insert-into-loaded-dataset_02.1.ddl.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset_02/insert-into-loaded-dataset_02.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset_02/insert-into-loaded-dataset_02.1.ddl.aql new file mode 100644 index 0000000..1df83f0 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset_02/insert-into-loaded-dataset_02.1.ddl.aql @@ -0,0 +1,48 @@ +/* + * 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 dataverse test; + +create type Schema as closed { +unique1: int64, +unique2: int64, +two: int64, +four: int64, +ten: int64, +twenty: int64, +onePercent: int64, +tenPercent: int64, +twentyPercent: int64, +fiftyPercent: int64, +unique3: int64, +evenOnePercent: int64, +oddOnePercent: int64, +stringu1: string, +stringu2: string, +string4: string +} + +create dataset onektup(Schema) primary key unique2; + +create dataset tenktup1(Schema) primary key unique2; + +create dataset tmp(Schema) primary key unique2; + http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset_02/insert-into-loaded-dataset_02.2.update.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset_02/insert-into-loaded-dataset_02.2.update.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset_02/insert-into-loaded-dataset_02.2.update.aql new file mode 100644 index 0000000..07c9c3e --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset_02/insert-into-loaded-dataset_02.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. + */ +use dataverse test; + +load dataset onektup +using localfs +(("path"="asterix_nc1://data/wisc/onektup.adm"),("format"="delimited-text"),("delimiter"="|")) pre-sorted; + +load dataset tenktup1 +using localfs +(("path"="asterix_nc1://data/wisc/tenktup.adm"),("format"="delimited-text"),("delimiter"="|")) pre-sorted; + +load dataset tmp +using localfs +(("path"="asterix_nc1://data/wisc/empty.adm"),("format"="adm")) pre-sorted; + +insert into dataset tmp( +for $l in dataset('tenktup1') +where $l.unique2 > 0 and $l.unique2 < 99 +return $l +); + http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset_02/insert-into-loaded-dataset_02.3.query.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset_02/insert-into-loaded-dataset_02.3.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset_02/insert-into-loaded-dataset_02.3.query.aql new file mode 100644 index 0000000..8a705bc --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset_02/insert-into-loaded-dataset_02.3.query.aql @@ -0,0 +1,23 @@ +/* + * 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 dataverse test; + +for $t in dataset('tmp') +order by $t.unique2 +return $t http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-record-function/insert-record-function.1.ddl.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-record-function/insert-record-function.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-record-function/insert-record-function.1.ddl.aql new file mode 100644 index 0000000..2f58172 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-record-function/insert-record-function.1.ddl.aql @@ -0,0 +1,42 @@ +/* + * 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. + */ +/* + * Test case Name : insert-into-empty-dataset.aql + * Description : Check that we can insert into an empty dataset + * Expected Result : Success + * Date : May 2 2012 + */ + +drop dataverse test if exists; +create dataverse test; + +use dataverse test; + +create type LineIDType as closed { + l_orderkey: int32, + l_linenumber: int32, + l_suppkey: int32 +} + +create dataset LineID(LineIDType) + primary key l_orderkey, l_linenumber; + +create dataset LineID2(LineIDType) + primary key l_orderkey, l_linenumber; + http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-record-function/insert-record-function.2.update.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-record-function/insert-record-function.2.update.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-record-function/insert-record-function.2.update.aql new file mode 100644 index 0000000..89b6db7 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-record-function/insert-record-function.2.update.aql @@ -0,0 +1,53 @@ +/* + * 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. + */ +/* + * Test case Name : insert-into-empty-dataset.aql + * Description : Check that we can insert into an empty dataset + * Expected Result : Success + * Date : May 2 2012 + */ + +use dataverse test; + +insert into dataset LineID ( +let $x:=1 +let $y:=2 +let $z:=3 +return { + "l_orderkey": $x, + "l_linenumber": $y, + "l_suppkey": $z +} +); + +insert into dataset LineID ( +let $x:=2 +let $y:=3 +let $z:=4 +return { + "l_orderkey": $x, + "l_linenumber": $y, + "l_suppkey": $z +} +); + +insert into dataset LineID2 ( + for $x in dataset LineID + return flow-record($x) +); http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-record-function/insert-record-function.3.query.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-record-function/insert-record-function.3.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-record-function/insert-record-function.3.query.aql new file mode 100644 index 0000000..6e9c990 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-record-function/insert-record-function.3.query.aql @@ -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. + */ +/* + * Test case Name : insert-into-empty-dataset.aql + * Description : Check that we can insert into an empty dataset + * Expected Result : Success + * Date : May 2 2012 + */ + +use dataverse test; + +for $c in dataset('LineID2') +order by $c.l_orderkey, $c.l_linenumber +return $c http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-return-records/insert-return-records.1.ddl.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-return-records/insert-return-records.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-return-records/insert-return-records.1.ddl.aql new file mode 100644 index 0000000..a75f9da --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-return-records/insert-return-records.1.ddl.aql @@ -0,0 +1,36 @@ +/* + * 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. + */ +/* + * Test case Name : insert-return-records + * Description : Check records returned on insert + * Expected Result : Success + * Date : Mar 2015 + */ + +drop dataverse test if exists; +create dataverse test; +use dataverse test; + +create type TweetMessageTypeuuid as closed { + tweetid: int, + message-text: string +} + +create dataset TweetMessageuuids(TweetMessageTypeuuid) +primary key tweetid; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-return-records/insert-return-records.3.query.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-return-records/insert-return-records.3.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-return-records/insert-return-records.3.query.aql new file mode 100644 index 0000000..6fc7112 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-return-records/insert-return-records.3.query.aql @@ -0,0 +1,34 @@ +/* + * 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. + */ +/* + * Test case Name : insert-return-records + * Description : Check records returned on insert + * Expected Result : Success + * Date : Mar 2015 + */ + + use dataverse test; + +insert into dataset TweetMessageuuids as $message ( +[{ "tweetid":1,"message-text":"hello"}, +{"tweetid":2,"message-text":"goodbye"}, +{"tweetid":3,"message-text":"the end"}, +{"tweetid":4,"message-text":"what"}, +{"tweetid":5,"message-text":"good"}] +) returning $message; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-returning-fieldname-implicit/insert-returning-fieldname-implicit.1.ddl.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-returning-fieldname-implicit/insert-returning-fieldname-implicit.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-returning-fieldname-implicit/insert-returning-fieldname-implicit.1.ddl.aql new file mode 100644 index 0000000..9e77afb --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-returning-fieldname-implicit/insert-returning-fieldname-implicit.1.ddl.aql @@ -0,0 +1,37 @@ +/* + * 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. + */ +/* + * Test case Name : insert-returning-fieldname + * Description : Check fields returned on insert + * Expected Result : Success + * Date : Mar 2015 + */ + + +drop dataverse test if exists; +create dataverse test; +use dataverse test; + +create type TweetMessageTypeuuid as closed { + tweetid: uuid, + message-text: string +} + +create dataset TweetMessageuuids(TweetMessageTypeuuid) +primary key tweetid autogenerated; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-returning-fieldname-implicit/insert-returning-fieldname-implicit.3.query.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-returning-fieldname-implicit/insert-returning-fieldname-implicit.3.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-returning-fieldname-implicit/insert-returning-fieldname-implicit.3.query.aql new file mode 100644 index 0000000..8e9cff5 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-returning-fieldname-implicit/insert-returning-fieldname-implicit.3.query.aql @@ -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. + */ +/* + * Test case Name : insert-returning-fieldname + * Description : Check fields returned on insert + * Expected Result : Success + * Date : Mar 2015 + */ + +use dataverse test; + +insert into dataset TweetMessageuuids ( + { "message-text":"hello"} +) returning 1; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-returning-fieldname/insert-returning-fieldname.1.ddl.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-returning-fieldname/insert-returning-fieldname.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-returning-fieldname/insert-returning-fieldname.1.ddl.aql new file mode 100644 index 0000000..9e77afb --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-returning-fieldname/insert-returning-fieldname.1.ddl.aql @@ -0,0 +1,37 @@ +/* + * 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. + */ +/* + * Test case Name : insert-returning-fieldname + * Description : Check fields returned on insert + * Expected Result : Success + * Date : Mar 2015 + */ + + +drop dataverse test if exists; +create dataverse test; +use dataverse test; + +create type TweetMessageTypeuuid as closed { + tweetid: uuid, + message-text: string +} + +create dataset TweetMessageuuids(TweetMessageTypeuuid) +primary key tweetid autogenerated; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-returning-fieldname/insert-returning-fieldname.3.query.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-returning-fieldname/insert-returning-fieldname.3.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-returning-fieldname/insert-returning-fieldname.3.query.aql new file mode 100644 index 0000000..6a7be26 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-returning-fieldname/insert-returning-fieldname.3.query.aql @@ -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. + */ +/* + * Test case Name : insert-returning-fieldname + * Description : Check fields returned on insert + * Expected Result : Success + * Date : Mar 2015 + */ + +use dataverse test; + +insert into dataset TweetMessageuuids as $message ( +{ "message-text":"hello"} +) returning $message.message-text; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-returning-udf/insert-returning-udf.1.ddl.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-returning-udf/insert-returning-udf.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-returning-udf/insert-returning-udf.1.ddl.aql new file mode 100644 index 0000000..f579a73 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-returning-udf/insert-returning-udf.1.ddl.aql @@ -0,0 +1,42 @@ +/* + * 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. + */ +/* + * Test case Name : insert-returning-fieldname + * Description : Check fields returned on insert + * Expected Result : Success + * Date : Mar 2015 + */ + + +drop dataverse test if exists; +create dataverse test; +use dataverse test; + +create type TweetMessageTypeuuid as closed { + tweetid: uuid, + message-text: string +} + +create dataset TweetMessageuuids(TweetMessageTypeuuid) +primary key tweetid autogenerated; + +create function project($foo){ + let $result := $foo.message-text + return $result +} http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-returning-udf/insert-returning-udf.3.query.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-returning-udf/insert-returning-udf.3.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-returning-udf/insert-returning-udf.3.query.aql new file mode 100644 index 0000000..ecbb50d --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-returning-udf/insert-returning-udf.3.query.aql @@ -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. + */ +/* + * Test case Name : insert-returning-fieldname + * Description : Check fields returned on insert + * Expected Result : Success + * Date : Mar 2015 + */ + +use dataverse test; + +insert into dataset TweetMessageuuids as $message ( +{ "message-text":"hello"} +) returning project($message); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-src-dst-01/insert-src-dst-01.1.ddl.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-src-dst-01/insert-src-dst-01.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-src-dst-01/insert-src-dst-01.1.ddl.aql new file mode 100644 index 0000000..f45dec7 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-src-dst-01/insert-src-dst-01.1.ddl.aql @@ -0,0 +1,42 @@ +/* + * 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 : Insert from source dataset into target dataset + * Expected Result : Success + * Date : 25th July 2012 + * Issue # : Issue 76 + */ + +drop dataverse testdv2 if exists; +create dataverse testdv2; + +use dataverse testdv2; + +create type testtype01 as closed { + id: string, + name: string? +} + +create type testtype02 as closed { + id: string +} + +create dataset testds01(testtype01) primary key id; +create dataset testds02(testtype02) primary key id; + http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-src-dst-01/insert-src-dst-01.2.update.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-src-dst-01/insert-src-dst-01.2.update.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-src-dst-01/insert-src-dst-01.2.update.aql new file mode 100644 index 0000000..3f3fea3 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-src-dst-01/insert-src-dst-01.2.update.aql @@ -0,0 +1,39 @@ +/* + * 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 : Insert from source dataset into target dataset + * Expected Result : Success + * Date : 25th July 2012 + * Issue # : Issue 76 + */ + +use dataverse testdv2; + +insert into dataset testds01 ({ "id": "001" }); +insert into dataset testds01 ({ "id": "002", "name": "John Doe" }); + +insert into dataset testds02 ({ "id": "003" }); +insert into dataset testds02 ({ "id": "004" }); +insert into dataset testds02 ({ "id": "005" }); + +insert into dataset testds01( +for $d in dataset("testds02") +return $d +); + http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-src-dst-01/insert-src-dst-01.3.query.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-src-dst-01/insert-src-dst-01.3.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-src-dst-01/insert-src-dst-01.3.query.aql new file mode 100644 index 0000000..000669b --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-src-dst-01/insert-src-dst-01.3.query.aql @@ -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. + */ +/* + * Description : Insert from source dataset into target dataset + * Expected Result : Success + * Date : 25th July 2012 + * Issue # : Issue 76 + */ + +use dataverse testdv2; + +for $d in dataset("testds01") +order by $d.id +return $d http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-syntax.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-syntax.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-syntax.aql new file mode 100644 index 0000000..9d778ab --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-syntax.aql @@ -0,0 +1,53 @@ +/* + * 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. + */ +/* + * Test case Name : insert-syntax-change.aql + * Description : verify various AQL syntax for insert + * Expected Result : Success + * Date : 6th March 2013 + */ + +drop dataverse testdv2 if exists; +create dataverse testdv2; +use dataverse testdv2; + +create type testtype as open { + id: int32, + name: string +} + +create dataset testds(testtype) primary key id; + + insert into dataset testds ( + { "id": 1, "name": "Person One", "hobbies": {{"Rock", "Metal"}}} + ); + + insert into dataset testds ( + { "id": 2, "name": "Person Two", "hobbies": {{"Rock", "Jazz"}}} + ) + + insert into dataset testds { "id": 3, "name": "Person Three", "hobbies": {{"Blues"}}}; + + insert into dataset testds { "id": 4, "name": "Person Four", "hobbies": {{"Metal", "Jazz"}}} + +write output to asterix_nc1:"rttest/dml_insert-syntax.adm"; + +for $d in dataset("testds") +order by $d.id +return $d http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-syntax/insert-syntax.1.ddl.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-syntax/insert-syntax.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-syntax/insert-syntax.1.ddl.aql new file mode 100644 index 0000000..d718aed --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-syntax/insert-syntax.1.ddl.aql @@ -0,0 +1,35 @@ +/* + * 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. + */ +/* + * Test case Name : insert-syntax-change.aql + * Description : verify various AQL syntax for insert + * Expected Result : Success + * Date : 6th March 2013 + */ + +drop dataverse testdv2 if exists; +create dataverse testdv2; +use dataverse testdv2; + +create type testtype as open { + id: int64, + name: string +} + +create dataset testds(testtype) primary key id; http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-syntax/insert-syntax.2.update.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-syntax/insert-syntax.2.update.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-syntax/insert-syntax.2.update.aql new file mode 100644 index 0000000..705b37c --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-syntax/insert-syntax.2.update.aql @@ -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 dataverse testdv2; + +insert into dataset testds ( +{ "id": 1, "name": "Person One", "hobbies": {{"Rock", "Metal"}}} +); + +insert into dataset testds ( +{ "id": 2, "name": "Person Two", "hobbies": {{"Rock", "Jazz"}}} +) + +insert into dataset testds { "id": 3, "name": "Person Three", "hobbies": {{"Blues"}}}; + +insert into dataset testds { "id": 4, "name": "Person Four", "hobbies": {{"Metal", "Jazz"}}} + http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-syntax/insert-syntax.3.query.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-syntax/insert-syntax.3.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-syntax/insert-syntax.3.query.aql new file mode 100644 index 0000000..59a590e --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-syntax/insert-syntax.3.query.aql @@ -0,0 +1,23 @@ +/* + * 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 dataverse testdv2; + +for $d in dataset("testds") +order by $d.id +return $d http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-with-autogenerated-pk_adm_01/insert-with-autogenerated-pk_adm_01.1.ddl.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-with-autogenerated-pk_adm_01/insert-with-autogenerated-pk_adm_01.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-with-autogenerated-pk_adm_01/insert-with-autogenerated-pk_adm_01.1.ddl.aql new file mode 100644 index 0000000..ee39fb6 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-with-autogenerated-pk_adm_01/insert-with-autogenerated-pk_adm_01.1.ddl.aql @@ -0,0 +1,34 @@ +/* + * 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. + */ +// insert test case: insert to a dataset that has an autogenerated-PK + +drop dataverse test if exists; +create dataverse test; + +use dataverse test; + +create type DBLPType as closed { + id: uuid, + dblpid: string, + title: string, + authors: string, + misc: string +} + +create dataset DBLP(DBLPType) primary key id autogenerated; http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-with-autogenerated-pk_adm_01/insert-with-autogenerated-pk_adm_01.2.update.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-with-autogenerated-pk_adm_01/insert-with-autogenerated-pk_adm_01.2.update.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-with-autogenerated-pk_adm_01/insert-with-autogenerated-pk_adm_01.2.update.aql new file mode 100644 index 0000000..87f383a --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-with-autogenerated-pk_adm_01/insert-with-autogenerated-pk_adm_01.2.update.aql @@ -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 dataverse test; + +insert into dataset DBLP ({"dblpid": "books/acm/kim95/Blakeley95", +"title": "OQL[C++] Extending C++ with an Object Query Capability.", +"authors": "José A. Blakeley", +"misc": "2002-01-03 69-88 Modern Database Systems db/books/collections/kim95.html#Blakeley95 1995" }); http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-with-autogenerated-pk_adm_01/insert-with-autogenerated-pk_adm_01.3.query.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-with-autogenerated-pk_adm_01/insert-with-autogenerated-pk_adm_01.3.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-with-autogenerated-pk_adm_01/insert-with-autogenerated-pk_adm_01.3.query.aql new file mode 100644 index 0000000..5d4ccef --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-with-autogenerated-pk_adm_01/insert-with-autogenerated-pk_adm_01.3.query.aql @@ -0,0 +1,23 @@ +/* + * 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 dataverse test; + +for $o in dataset('DBLP') +where contains($o.title,"Extending") +return $o.title; http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-with-autogenerated-pk_adm_02/insert-with-autogenerated-pk_adm_02.1.ddl.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-with-autogenerated-pk_adm_02/insert-with-autogenerated-pk_adm_02.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-with-autogenerated-pk_adm_02/insert-with-autogenerated-pk_adm_02.1.ddl.aql new file mode 100644 index 0000000..504691b --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-with-autogenerated-pk_adm_02/insert-with-autogenerated-pk_adm_02.1.ddl.aql @@ -0,0 +1,35 @@ +/* + * 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. + */ +// insert test case: insert to a dataset that has an autogenerated-PK +// This should fail since we are trying to insert a value into the autogenerated PK field. + +drop dataverse test if exists; +create dataverse test; + +use dataverse test; + +create type DBLPType as closed { + id: uuid, + dblpid: string, + title: string, + authors: string, + misc: string +} + +create dataset DBLP(DBLPType) primary key id autogenerated; http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-with-autogenerated-pk_adm_02/insert-with-autogenerated-pk_adm_02.2.update.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-with-autogenerated-pk_adm_02/insert-with-autogenerated-pk_adm_02.2.update.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-with-autogenerated-pk_adm_02/insert-with-autogenerated-pk_adm_02.2.update.aql new file mode 100644 index 0000000..f598328 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-with-autogenerated-pk_adm_02/insert-with-autogenerated-pk_adm_02.2.update.aql @@ -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 dataverse test; + +insert into dataset DBLP ({"id": "89fb1567-70f8-4e59-87d9-ace64f73daf1", +"dblpid": "books/acm/kim95/Blakeley95", +"title": "OQL[C++] Extending C++ with an Object Query Capability.", +"authors": "José A. Blakeley", +"misc": "2002-01-03 69-88 Modern Database Systems db/books/collections/kim95.html#Blakeley95 1995" }); http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-with-autogenerated-pk_adm_02/insert-with-autogenerated-pk_adm_02.3.query.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-with-autogenerated-pk_adm_02/insert-with-autogenerated-pk_adm_02.3.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-with-autogenerated-pk_adm_02/insert-with-autogenerated-pk_adm_02.3.query.aql new file mode 100644 index 0000000..5d4ccef --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-with-autogenerated-pk_adm_02/insert-with-autogenerated-pk_adm_02.3.query.aql @@ -0,0 +1,23 @@ +/* + * 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 dataverse test; + +for $o in dataset('DBLP') +where contains($o.title,"Extending") +return $o.title; http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-with-autogenerated-pk_adm_03/insert-with-autogenerated-pk_adm_03.1.ddl.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-with-autogenerated-pk_adm_03/insert-with-autogenerated-pk_adm_03.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-with-autogenerated-pk_adm_03/insert-with-autogenerated-pk_adm_03.1.ddl.aql new file mode 100644 index 0000000..da92dc4 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-with-autogenerated-pk_adm_03/insert-with-autogenerated-pk_adm_03.1.ddl.aql @@ -0,0 +1,36 @@ +/* + * 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. + */ +// insert test case: insert to a dataset that has an autogenerated-PK +// For this test case, id field is the PK, however that is not an auto-generated field. +// This test case should succeed. + +drop dataverse test if exists; +create dataverse test; + +use dataverse test; + +create type DBLPType as closed { + id: uuid, + dblpid: string, + title: string, + authors: string, + misc: string +} + +create dataset DBLP(DBLPType) primary key id; http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-with-autogenerated-pk_adm_03/insert-with-autogenerated-pk_adm_03.2.update.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-with-autogenerated-pk_adm_03/insert-with-autogenerated-pk_adm_03.2.update.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-with-autogenerated-pk_adm_03/insert-with-autogenerated-pk_adm_03.2.update.aql new file mode 100644 index 0000000..40b89fc --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-with-autogenerated-pk_adm_03/insert-with-autogenerated-pk_adm_03.2.update.aql @@ -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 dataverse test; + +insert into dataset DBLP ({"id": uuid("89fb1567-70f8-4e59-87d9-ace64f73daf1"), +"dblpid": "books/acm/kim95/Blakeley95", +"title": "OQL[C++] Extending C++ with an Object Query Capability.", +"authors": "José A. Blakeley", +"misc": "2002-01-03 69-88 Modern Database Systems db/books/collections/kim95.html#Blakeley95 1995" }); http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-with-autogenerated-pk_adm_03/insert-with-autogenerated-pk_adm_03.3.query.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-with-autogenerated-pk_adm_03/insert-with-autogenerated-pk_adm_03.3.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-with-autogenerated-pk_adm_03/insert-with-autogenerated-pk_adm_03.3.query.aql new file mode 100644 index 0000000..d309fab --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-with-autogenerated-pk_adm_03/insert-with-autogenerated-pk_adm_03.3.query.aql @@ -0,0 +1,23 @@ +/* + * 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 dataverse test; + +for $o in dataset('DBLP') +where contains($o.title,"Extending") +return $o; http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-with-bad-return/insert-with-bad-return.1.ddl.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-with-bad-return/insert-with-bad-return.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-with-bad-return/insert-with-bad-return.1.ddl.aql new file mode 100644 index 0000000..a75f9da --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-with-bad-return/insert-with-bad-return.1.ddl.aql @@ -0,0 +1,36 @@ +/* + * 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. + */ +/* + * Test case Name : insert-return-records + * Description : Check records returned on insert + * Expected Result : Success + * Date : Mar 2015 + */ + +drop dataverse test if exists; +create dataverse test; +use dataverse test; + +create type TweetMessageTypeuuid as closed { + tweetid: int, + message-text: string +} + +create dataset TweetMessageuuids(TweetMessageTypeuuid) +primary key tweetid; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-with-bad-return/insert-with-bad-return.3.query.aql ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-with-bad-return/insert-with-bad-return.3.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-with-bad-return/insert-with-bad-return.3.query.aql new file mode 100644 index 0000000..417860d --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-with-bad-return/insert-with-bad-return.3.query.aql @@ -0,0 +1,37 @@ +/* + * 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. + */ +/* + * Test case Name : insert-with-bad-return + * Description : Throw an error + * Expected Result : Error + * Date : Oct 2016 + */ + + use dataverse test; + +insert into dataset TweetMessageuuids as $message ( +[{ "tweetid":1,"message-text":"hello"}, +{"tweetid":2,"message-text":"goodbye"}, +{"tweetid":3,"message-text":"the end"}, +{"tweetid":4,"message-text":"what"}, +{"tweetid":5,"message-text":"good"}] +) returning +for $result in dataset TweetMessageuuids +where $result.message-text = $message +return $result; \ No newline at end of file