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

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


The following commit(s) were added to refs/heads/master by this push:
     new 7a80e97  [NO ISSUE][IDX] Add tests to make sure no nulls in index
7a80e97 is described below

commit 7a80e974e96e2a8419a55cd05d7f8c5cc5ac9e1e
Author: Ali Alsuliman <ali.al.solai...@gmail.com>
AuthorDate: Thu Aug 22 09:34:26 2019 -0700

    [NO ISSUE][IDX] Add tests to make sure no nulls in index
    
    - user model changes: no
    - storage format changes: no
    - interface changes: no
    
    Details:
    Added test cases to test that nulls do not make it
    to secondary indexes.
    
    Change-Id: I6d9a9a072f8378f2af262f49728001ce4e10bdbb
    Reviewed-on: https://asterix-gerrit.ics.uci.edu/3530
    Reviewed-by: Michael Blow <mb...@apache.org>
    Sonar-Qube: Jenkins <jenk...@fulliautomatix.ics.uci.edu>
    Tested-by: Jenkins <jenk...@fulliautomatix.ics.uci.edu>
    Integration-Tests: Jenkins <jenk...@fulliautomatix.ics.uci.edu>
---
 asterixdb/asterix-app/data/data1.adm               |  3 ++
 .../insert_nulls_with_secondary_idx.1.ddl.sqlpp    | 29 +++++++++++++++++++
 .../insert_nulls_with_secondary_idx.2.update.sqlpp | 33 ++++++++++++++++++++++
 .../insert_nulls_with_secondary_idx.3.ddl.sqlpp    | 22 +++++++++++++++
 .../insert_nulls_with_secondary_idx.4.query.sqlpp  | 28 ++++++++++++++++++
 .../insert_nulls_with_secondary_idx.5.query.sqlpp  | 28 ++++++++++++++++++
 .../insert_nulls_with_secondary_idx.6.query.sqlpp  | 28 ++++++++++++++++++
 .../insert_nulls_with_secondary_idx.7.update.sqlpp | 31 ++++++++++++++++++++
 .../insert_nulls_with_secondary_idx.8.query.sqlpp  | 29 +++++++++++++++++++
 .../insert_nulls_with_secondary_idx.9.ddl.sqlpp    | 20 +++++++++++++
 .../insert_nulls_with_secondary_idx.4.adm          |  3 ++
 .../insert_nulls_with_secondary_idx.5.adm          |  3 ++
 .../insert_nulls_with_secondary_idx.6.adm          |  1 +
 .../insert_nulls_with_secondary_idx.8.adm          |  3 ++
 .../test/resources/runtimets/testsuite_sqlpp.xml   |  5 ++++
 15 files changed, 266 insertions(+)

diff --git a/asterixdb/asterix-app/data/data1.adm 
b/asterixdb/asterix-app/data/data1.adm
new file mode 100644
index 0000000..81170e3
--- /dev/null
+++ b/asterixdb/asterix-app/data/data1.adm
@@ -0,0 +1,3 @@
+{"id": 1, "f1": "str", "f2": null}
+{"id": 2, "f1": "str"}
+{"id": 8, "f1": "str", "f2": 888}
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/misc/insert_nulls_with_secondary_idx/insert_nulls_with_secondary_idx.1.ddl.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/misc/insert_nulls_with_secondary_idx/insert_nulls_with_secondary_idx.1.ddl.sqlpp
new file mode 100644
index 0000000..00f3581
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/misc/insert_nulls_with_secondary_idx/insert_nulls_with_secondary_idx.1.ddl.sqlpp
@@ -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.
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+use test;
+
+create type t1 as {id: int, f1:string, f2:int?};
+create dataset ds1(t1) primary key id;
+create dataset ds2(t1) primary key id;
+create index idx1 on ds1(f2);
+create index idx2 on ds2(f2);
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/misc/insert_nulls_with_secondary_idx/insert_nulls_with_secondary_idx.2.update.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/misc/insert_nulls_with_secondary_idx/insert_nulls_with_secondary_idx.2.update.sqlpp
new file mode 100644
index 0000000..da6823f
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/misc/insert_nulls_with_secondary_idx/insert_nulls_with_secondary_idx.2.update.sqlpp
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+use test;
+
+upsert into ds1 {"id": 1, "f1": "str", "f2": null};
+upsert into ds1 {"id": 2, "f1": "str", "f2": null};
+upsert into ds1 {"id": 3, "f1": "str"};
+upsert into ds1 {"id": 4, "f1": "str"};
+upsert into ds1 {"id": 5, "f1": "str", "f2": 555};
+
+insert into ds1 {"id": 6, "f1": "str", "f2": null};
+insert into ds1 {"id": 7, "f1": "str"};
+insert into ds1 {"id": 8, "f1": "str", "f2": 888};
+insert into ds1 {"id": 9, "f1": "str", "f2": 999};
+
+load dataset ds2 using localfs 
(("path"="asterix_nc1://data/data1.adm"),("format"="adm"));
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/misc/insert_nulls_with_secondary_idx/insert_nulls_with_secondary_idx.3.ddl.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/misc/insert_nulls_with_secondary_idx/insert_nulls_with_secondary_idx.3.ddl.sqlpp
new file mode 100644
index 0000000..73bbebc
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/misc/insert_nulls_with_secondary_idx/insert_nulls_with_secondary_idx.3.ddl.sqlpp
@@ -0,0 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+use test;
+
+create index idx2 on ds1(f2);
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/misc/insert_nulls_with_secondary_idx/insert_nulls_with_secondary_idx.4.query.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/misc/insert_nulls_with_secondary_idx/insert_nulls_with_secondary_idx.4.query.sqlpp
new file mode 100644
index 0000000..5d5e120
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/misc/insert_nulls_with_secondary_idx/insert_nulls_with_secondary_idx.4.query.sqlpp
@@ -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.
+ */
+
+/*
+ * Description: Testing that nulls do not make it to the secondary indexes
+ */
+use test;
+
+SET `import-private-functions` `true`;
+FROM DUMP_INDEX("test", "ds1", "idx1") AS v
+SELECT VALUE v
+ORDER BY v.values;
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/misc/insert_nulls_with_secondary_idx/insert_nulls_with_secondary_idx.5.query.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/misc/insert_nulls_with_secondary_idx/insert_nulls_with_secondary_idx.5.query.sqlpp
new file mode 100644
index 0000000..68f8d9a
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/misc/insert_nulls_with_secondary_idx/insert_nulls_with_secondary_idx.5.query.sqlpp
@@ -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.
+ */
+
+/*
+ * Description: Testing that nulls do not make it to the secondary indexes
+ */
+use test;
+
+SET `import-private-functions` `true`;
+FROM DUMP_INDEX("test", "ds1", "idx2") AS v
+SELECT VALUE v
+ORDER BY v.values;
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/misc/insert_nulls_with_secondary_idx/insert_nulls_with_secondary_idx.6.query.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/misc/insert_nulls_with_secondary_idx/insert_nulls_with_secondary_idx.6.query.sqlpp
new file mode 100644
index 0000000..39baa19
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/misc/insert_nulls_with_secondary_idx/insert_nulls_with_secondary_idx.6.query.sqlpp
@@ -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.
+ */
+
+/*
+ * Description: Testing that nulls do not make it to the secondary indexes
+ */
+use test;
+
+SET `import-private-functions` `true`;
+FROM DUMP_INDEX("test", "ds2", "idx2") AS v
+SELECT VALUE v
+ORDER BY v.values;
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/misc/insert_nulls_with_secondary_idx/insert_nulls_with_secondary_idx.7.update.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/misc/insert_nulls_with_secondary_idx/insert_nulls_with_secondary_idx.7.update.sqlpp
new file mode 100644
index 0000000..43fb3ef
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/misc/insert_nulls_with_secondary_idx/insert_nulls_with_secondary_idx.7.update.sqlpp
@@ -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.
+ */
+
+use test;
+
+upsert into ds1 {"id": 1, "f1": "str", "f2": null};
+upsert into ds1 {"id": 2, "f1": "str", "f2": 222};
+upsert into ds1 {"id": 3, "f1": "str"};
+upsert into ds1 {"id": 4, "f1": "str", "f2": 444};
+upsert into ds1 {"id": 5, "f1": "str", "f2": 555};
+
+upsert into ds1 {"id": 6, "f1": "str"};
+upsert into ds1 {"id": 7, "f1": "str", "f2": null};
+upsert into ds1 {"id": 8, "f1": "str"};
+upsert into ds1 {"id": 9, "f1": "str", "f2": null};
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/misc/insert_nulls_with_secondary_idx/insert_nulls_with_secondary_idx.8.query.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/misc/insert_nulls_with_secondary_idx/insert_nulls_with_secondary_idx.8.query.sqlpp
new file mode 100644
index 0000000..2a572a0
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/misc/insert_nulls_with_secondary_idx/insert_nulls_with_secondary_idx.8.query.sqlpp
@@ -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: Testing that nulls do not make it to the secondary indexes
+ */
+use test;
+
+SET `import-private-functions` `true`;
+SET `import-private-functions` `true`;
+FROM DUMP_INDEX("test", "ds1", "idx1") AS v
+SELECT VALUE v
+ORDER BY v.values;
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/misc/insert_nulls_with_secondary_idx/insert_nulls_with_secondary_idx.9.ddl.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/misc/insert_nulls_with_secondary_idx/insert_nulls_with_secondary_idx.9.ddl.sqlpp
new file mode 100644
index 0000000..548e632
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/misc/insert_nulls_with_secondary_idx/insert_nulls_with_secondary_idx.9.ddl.sqlpp
@@ -0,0 +1,20 @@
+/*
+ * 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;
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/misc/insert_nulls_with_secondary_idx/insert_nulls_with_secondary_idx.4.adm
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/misc/insert_nulls_with_secondary_idx/insert_nulls_with_secondary_idx.4.adm
new file mode 100644
index 0000000..fab2047
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/misc/insert_nulls_with_secondary_idx/insert_nulls_with_secondary_idx.4.adm
@@ -0,0 +1,3 @@
+{ "values": [ 555, 5 ] }
+{ "values": [ 888, 8 ] }
+{ "values": [ 999, 9 ] }
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/misc/insert_nulls_with_secondary_idx/insert_nulls_with_secondary_idx.5.adm
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/misc/insert_nulls_with_secondary_idx/insert_nulls_with_secondary_idx.5.adm
new file mode 100644
index 0000000..fab2047
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/misc/insert_nulls_with_secondary_idx/insert_nulls_with_secondary_idx.5.adm
@@ -0,0 +1,3 @@
+{ "values": [ 555, 5 ] }
+{ "values": [ 888, 8 ] }
+{ "values": [ 999, 9 ] }
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/misc/insert_nulls_with_secondary_idx/insert_nulls_with_secondary_idx.6.adm
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/misc/insert_nulls_with_secondary_idx/insert_nulls_with_secondary_idx.6.adm
new file mode 100644
index 0000000..761a8fc
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/misc/insert_nulls_with_secondary_idx/insert_nulls_with_secondary_idx.6.adm
@@ -0,0 +1 @@
+{ "values": [ 888, 8 ] }
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/misc/insert_nulls_with_secondary_idx/insert_nulls_with_secondary_idx.8.adm
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/misc/insert_nulls_with_secondary_idx/insert_nulls_with_secondary_idx.8.adm
new file mode 100644
index 0000000..85c91e6
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/misc/insert_nulls_with_secondary_idx/insert_nulls_with_secondary_idx.8.adm
@@ -0,0 +1,3 @@
+{ "values": [ 222, 2 ] }
+{ "values": [ 444, 4 ] }
+{ "values": [ 555, 5 ] }
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml 
b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
index 43c8445..8da6725 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
@@ -6066,6 +6066,11 @@
         <output-dir compare="Text">cast-ASTERIXDB-2458</output-dir>
       </compilation-unit>
     </test-case>
+    <test-case FilePath="misc">
+      <compilation-unit name="insert_nulls_with_secondary_idx">
+        <output-dir compare="Text">insert_nulls_with_secondary_idx</output-dir>
+      </compilation-unit>
+    </test-case>
   </test-group>
   <test-group name="index">
     <test-group name="index/validations">

Reply via email to