You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by ji...@apache.org on 2021/11/14 06:51:58 UTC

[arrow-datafusion] branch master updated: Add PSQL comparison tests for except, intersect (#1292)

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

jiayuliu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-datafusion.git


The following commit(s) were added to refs/heads/master by this push:
     new 17f1c09  Add PSQL comparison tests for except, intersect (#1292)
17f1c09 is described below

commit 17f1c09d0020248147f2147a452b6846cdd591d0
Author: Mike Roberts <42...@users.noreply.github.com>
AuthorDate: Sun Nov 14 06:51:50 2021 +0000

    Add PSQL comparison tests for except, intersect (#1292)
---
 integration-tests/sqls/simple_except.sql        | 25 +++++++++++++++++++++++++
 integration-tests/sqls/simple_except_all.sql    | 25 +++++++++++++++++++++++++
 integration-tests/sqls/simple_intersect.sql     | 25 +++++++++++++++++++++++++
 integration-tests/sqls/simple_intersect_all.sql | 25 +++++++++++++++++++++++++
 integration-tests/test_psql_parity.py           |  2 +-
 5 files changed, 101 insertions(+), 1 deletion(-)

diff --git a/integration-tests/sqls/simple_except.sql b/integration-tests/sqls/simple_except.sql
new file mode 100644
index 0000000..fc29dd8
--- /dev/null
+++ b/integration-tests/sqls/simple_except.sql
@@ -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.
+
+SELECT * FROM (
+    SELECT c2
+    FROM test t1
+    EXCEPT
+    SELECT c2
+    FROM test t2
+    WHERE c2 IN (3, 4)
+) s
+ORDER BY c2
diff --git a/integration-tests/sqls/simple_except_all.sql b/integration-tests/sqls/simple_except_all.sql
new file mode 100644
index 0000000..3989edd
--- /dev/null
+++ b/integration-tests/sqls/simple_except_all.sql
@@ -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.
+
+SELECT * FROM (
+    SELECT c2
+    FROM test t1
+    EXCEPT ALL
+    SELECT c2
+    FROM test t2
+    WHERE c2 IN (3, 4)
+) s
+ORDER BY c2
diff --git a/integration-tests/sqls/simple_intersect.sql b/integration-tests/sqls/simple_intersect.sql
new file mode 100644
index 0000000..a0c10bb
--- /dev/null
+++ b/integration-tests/sqls/simple_intersect.sql
@@ -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.
+
+SELECT * FROM (
+    SELECT c2
+    FROM test t1
+    INTERSECT
+    SELECT c2
+    FROM test t2
+    WHERE c2 IN (3, 4)
+) s
+ORDER BY c2
diff --git a/integration-tests/sqls/simple_intersect_all.sql b/integration-tests/sqls/simple_intersect_all.sql
new file mode 100644
index 0000000..4f8fa2c
--- /dev/null
+++ b/integration-tests/sqls/simple_intersect_all.sql
@@ -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.
+
+SELECT * FROM (
+    SELECT c2
+    FROM test t1
+    INTERSECT ALL
+    SELECT c2
+    FROM test t2
+    WHERE c2 IN (3, 4)
+) s
+ORDER BY c2
diff --git a/integration-tests/test_psql_parity.py b/integration-tests/test_psql_parity.py
index e9776e0..8cd94ba 100644
--- a/integration-tests/test_psql_parity.py
+++ b/integration-tests/test_psql_parity.py
@@ -77,7 +77,7 @@ test_files = set(root.glob("*.sql"))
 
 class TestPsqlParity:
     def test_tests_count(self):
-        assert len(test_files) == 16, "tests are missed"
+        assert len(test_files) == 20, "tests are missed"
 
     @pytest.mark.parametrize("fname", test_files)
     def test_sql_file(self, fname):