From 1e364d3cb7ea7e9f40028ebbb10141907097bf17 Mon Sep 17 00:00:00 2001 From: Peter Toth Date: Thu, 4 Feb 2021 20:01:07 +0100 Subject: [PATCH] fix expected error messages, fix `table.*` syntax --- .../sql-tests/inputs/postgreSQL/with.sql | 2 +- .../sql-tests/results/cte-recursion.sql.out | 22 +++++----- .../sql-tests/results/postgreSQL/with.sql.out | 40 +++++++++---------- 3 files changed, 32 insertions(+), 32 deletions(-) diff --git a/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/with.sql b/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/with.sql index 7118036e61903..b9855e07dd6f1 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/with.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/with.sql @@ -417,7 +417,7 @@ UNION ALL SELECT tree.id, t.path || array(tree.id) FROM tree JOIN t ON (tree.parent_id = t.id) ) -SELECT t1.id, count(t2.*) FROM t AS t1 JOIN t AS t2 ON +SELECT t1.id, count(*) FROM t AS t1 JOIN t AS t2 ON (t1.path[0] = t2.path[0] AND size(t1.path) = 1 AND size(t2.path) > 1) diff --git a/sql/core/src/test/resources/sql-tests/results/cte-recursion.sql.out b/sql/core/src/test/resources/sql-tests/results/cte-recursion.sql.out index 97db69f841fa2..1bb08c852ded2 100644 --- a/sql/core/src/test/resources/sql-tests/results/cte-recursion.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/cte-recursion.sql.out @@ -140,7 +140,7 @@ SELECT * FROM r struct<> -- !query output org.apache.spark.sql.AnalysisException -Recursive query r should not contain recursive references in its anchor (first) term.; +Recursive query r should not contain recursive references in its anchor (first) term. -- !query @@ -178,7 +178,7 @@ SELECT * FROM r struct<> -- !query output org.apache.spark.sql.AnalysisException -Recursive query r should not contain recursive references in its anchor (first) term.; +Recursive query r should not contain recursive references in its anchor (first) term. -- !query @@ -196,7 +196,7 @@ SELECT * FROM r struct<> -- !query output org.apache.spark.sql.AnalysisException -Recursive query r should not contain recursive references in its anchor (first) term.; +Recursive query r should not contain recursive references in its anchor (first) term. -- !query @@ -208,7 +208,7 @@ SELECT * FROM r struct<> -- !query output org.apache.spark.sql.AnalysisException -Recursive query r should contain UNION or UNION ALL statements only. This error can also be caused by ORDER BY or LIMIT keywords used on result of UNION or UNION ALL.; +Recursive query r should contain UNION or UNION ALL statements only. This error can also be caused by ORDER BY or LIMIT keywords used on result of UNION or UNION ALL. -- !query @@ -244,7 +244,7 @@ SELECT * FROM r struct<> -- !query output org.apache.spark.sql.AnalysisException -Recursive query r should contain UNION or UNION ALL statements only. This error can also be caused by ORDER BY or LIMIT keywords used on result of UNION or UNION ALL.; +Recursive query r should contain UNION or UNION ALL statements only. This error can also be caused by ORDER BY or LIMIT keywords used on result of UNION or UNION ALL. -- !query @@ -258,7 +258,7 @@ SELECT * FROM r struct<> -- !query output org.apache.spark.sql.AnalysisException -Recursive query r should not contain recursive references in its subquery.; +Recursive query r should not contain recursive references in its subquery. -- !query @@ -275,7 +275,7 @@ SELECT * FROM r struct<> -- !query output org.apache.spark.sql.AnalysisException -Recursive reference r cannot be used multiple times in a recursive term.; +Recursive reference r cannot be used multiple times in a recursive term. -- !query @@ -293,7 +293,7 @@ SELECT * FROM r struct<> -- !query output org.apache.spark.sql.AnalysisException -Recursive reference r cannot be used here. This can be caused by using it on inner side of an outer join, using it with aggregate in a subquery or using it multiple times in a recursive term (except for using it on different sides of an UNION ALL).; +Recursive reference r cannot be used here. This can be caused by using it on inner side of an outer join, using it with aggregate in a subquery or using it multiple times in a recursive term (except for using it on different sides of an UNION ALL). -- !query @@ -311,7 +311,7 @@ SELECT * FROM r struct<> -- !query output org.apache.spark.sql.AnalysisException -Recursive reference r cannot be used here. This can be caused by using it on inner side of an outer join, using it with aggregate in a subquery or using it multiple times in a recursive term (except for using it on different sides of an UNION ALL).; +Recursive reference r cannot be used here. This can be caused by using it on inner side of an outer join, using it with aggregate in a subquery or using it multiple times in a recursive term (except for using it on different sides of an UNION ALL). -- !query @@ -339,7 +339,7 @@ SELECT * FROM r struct<> -- !query output org.apache.spark.sql.AnalysisException -Recursive reference r cannot be used here. This can be caused by using it on inner side of an outer join, using it with aggregate in a subquery or using it multiple times in a recursive term (except for using it on different sides of an UNION ALL).; +Recursive reference r cannot be used here. This can be caused by using it on inner side of an outer join, using it with aggregate in a subquery or using it multiple times in a recursive term (except for using it on different sides of an UNION ALL). -- !query @@ -353,7 +353,7 @@ SELECT * FROM r struct<> -- !query output org.apache.spark.sql.AnalysisException -Recursive reference r cannot be used here. This can be caused by using it on inner side of an outer join, using it with aggregate in a subquery or using it multiple times in a recursive term (except for using it on different sides of an UNION ALL).; +Recursive reference r cannot be used here. This can be caused by using it on inner side of an outer join, using it with aggregate in a subquery or using it multiple times in a recursive term (except for using it on different sides of an UNION ALL). -- !query diff --git a/sql/core/src/test/resources/sql-tests/results/postgreSQL/with.sql.out b/sql/core/src/test/resources/sql-tests/results/postgreSQL/with.sql.out index 04363f039b229..2dd957224e34a 100644 --- a/sql/core/src/test/resources/sql-tests/results/postgreSQL/with.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/postgreSQL/with.sql.out @@ -523,14 +523,14 @@ UNION ALL SELECT tree.id, t.path || array(tree.id) FROM tree JOIN t ON (tree.parent_id = t.id) ) -SELECT t1.id, count(t2.*) FROM t AS t1 JOIN t AS t2 ON +SELECT t1.id, count(*) FROM t AS t1 JOIN t AS t2 ON (t1.path[0] = t2.path[0] AND size(t1.path) = 1 AND size(t2.path) > 1) GROUP BY t1.id ORDER BY t1.id -- !query schema -struct +struct -- !query output 2 6 3 7 @@ -873,7 +873,7 @@ WITH RECURSIVE x(n) AS (SELECT 1 INTERSECT SELECT n+1 FROM x) struct<> -- !query output org.apache.spark.sql.AnalysisException -Recursive query x should contain UNION or UNION ALL statements only. This error can also be caused by ORDER BY or LIMIT keywords used on result of UNION or UNION ALL.; +Recursive query x should contain UNION or UNION ALL statements only. This error can also be caused by ORDER BY or LIMIT keywords used on result of UNION or UNION ALL. -- !query @@ -883,7 +883,7 @@ WITH RECURSIVE x(n) AS (SELECT 1 INTERSECT ALL SELECT n+1 FROM x) struct<> -- !query output org.apache.spark.sql.AnalysisException -Recursive query x should contain UNION or UNION ALL statements only. This error can also be caused by ORDER BY or LIMIT keywords used on result of UNION or UNION ALL.; +Recursive query x should contain UNION or UNION ALL statements only. This error can also be caused by ORDER BY or LIMIT keywords used on result of UNION or UNION ALL. -- !query @@ -893,7 +893,7 @@ WITH RECURSIVE x(n) AS (SELECT 1 EXCEPT SELECT n+1 FROM x) struct<> -- !query output org.apache.spark.sql.AnalysisException -Recursive query x should contain UNION or UNION ALL statements only. This error can also be caused by ORDER BY or LIMIT keywords used on result of UNION or UNION ALL.; +Recursive query x should contain UNION or UNION ALL statements only. This error can also be caused by ORDER BY or LIMIT keywords used on result of UNION or UNION ALL. -- !query @@ -903,7 +903,7 @@ WITH RECURSIVE x(n) AS (SELECT 1 EXCEPT ALL SELECT n+1 FROM x) struct<> -- !query output org.apache.spark.sql.AnalysisException -Recursive query x should contain UNION or UNION ALL statements only. This error can also be caused by ORDER BY or LIMIT keywords used on result of UNION or UNION ALL.; +Recursive query x should contain UNION or UNION ALL statements only. This error can also be caused by ORDER BY or LIMIT keywords used on result of UNION or UNION ALL. -- !query @@ -913,7 +913,7 @@ WITH RECURSIVE x(n) AS (SELECT n FROM x) struct<> -- !query output org.apache.spark.sql.AnalysisException -Recursive query x should contain UNION or UNION ALL statements only. This error can also be caused by ORDER BY or LIMIT keywords used on result of UNION or UNION ALL.; +Recursive query x should contain UNION or UNION ALL statements only. This error can also be caused by ORDER BY or LIMIT keywords used on result of UNION or UNION ALL. -- !query @@ -923,7 +923,7 @@ WITH RECURSIVE x(n) AS (SELECT n FROM x UNION ALL SELECT 1) struct<> -- !query output org.apache.spark.sql.AnalysisException -Recursive query x should not contain recursive references in its anchor (first) term.; +Recursive query x should not contain recursive references in its anchor (first) term. -- !query @@ -951,7 +951,7 @@ SELECT * FROM x struct<> -- !query output org.apache.spark.sql.AnalysisException -Recursive reference x cannot be used here. This can be caused by using it on inner side of an outer join, using it with aggregate in a subquery or using it multiple times in a recursive term (except for using it on different sides of an UNION ALL).; +Recursive reference x cannot be used here. This can be caused by using it on inner side of an outer join, using it with aggregate in a subquery or using it multiple times in a recursive term (except for using it on different sides of an UNION ALL). -- !query @@ -963,7 +963,7 @@ SELECT * FROM x struct<> -- !query output org.apache.spark.sql.AnalysisException -Recursive reference x cannot be used here. This can be caused by using it on inner side of an outer join, using it with aggregate in a subquery or using it multiple times in a recursive term (except for using it on different sides of an UNION ALL).; +Recursive reference x cannot be used here. This can be caused by using it on inner side of an outer join, using it with aggregate in a subquery or using it multiple times in a recursive term (except for using it on different sides of an UNION ALL). -- !query @@ -975,7 +975,7 @@ SELECT * FROM x struct<> -- !query output org.apache.spark.sql.AnalysisException -Recursive reference x cannot be used here. This can be caused by using it on inner side of an outer join, using it with aggregate in a subquery or using it multiple times in a recursive term (except for using it on different sides of an UNION ALL).; +Recursive reference x cannot be used here. This can be caused by using it on inner side of an outer join, using it with aggregate in a subquery or using it multiple times in a recursive term (except for using it on different sides of an UNION ALL). -- !query @@ -986,7 +986,7 @@ WITH RECURSIVE x(n) AS (SELECT 1 UNION ALL SELECT n+1 FROM x struct<> -- !query output org.apache.spark.sql.AnalysisException -Recursive query x should not contain recursive references in its subquery.; +Recursive query x should not contain recursive references in its subquery. -- !query @@ -996,7 +996,7 @@ WITH RECURSIVE x(n) AS (SELECT 1L UNION ALL SELECT count(*) FROM x) struct<> -- !query output org.apache.spark.sql.AnalysisException -Recursive reference x cannot be used here. This can be caused by using it on inner side of an outer join, using it with aggregate in a subquery or using it multiple times in a recursive term (except for using it on different sides of an UNION ALL).; +Recursive reference x cannot be used here. This can be caused by using it on inner side of an outer join, using it with aggregate in a subquery or using it multiple times in a recursive term (except for using it on different sides of an UNION ALL). -- !query @@ -1006,7 +1006,7 @@ WITH RECURSIVE x(n) AS (SELECT 1L UNION ALL SELECT sum(n) FROM x) struct<> -- !query output org.apache.spark.sql.AnalysisException -Recursive reference x cannot be used here. This can be caused by using it on inner side of an outer join, using it with aggregate in a subquery or using it multiple times in a recursive term (except for using it on different sides of an UNION ALL).; +Recursive reference x cannot be used here. This can be caused by using it on inner side of an outer join, using it with aggregate in a subquery or using it multiple times in a recursive term (except for using it on different sides of an UNION ALL). -- !query @@ -1016,7 +1016,7 @@ WITH RECURSIVE x(n) AS (SELECT 1 UNION ALL SELECT n+1 FROM x ORDER BY 1) struct<> -- !query output org.apache.spark.sql.AnalysisException -Recursive query x should contain UNION or UNION ALL statements only. This error can also be caused by ORDER BY or LIMIT keywords used on result of UNION or UNION ALL.; +Recursive query x should contain UNION or UNION ALL statements only. This error can also be caused by ORDER BY or LIMIT keywords used on result of UNION or UNION ALL. -- !query @@ -1026,7 +1026,7 @@ WITH RECURSIVE x(n) AS (SELECT 1 UNION ALL SELECT n+1 FROM x LIMIT 10) struct<> -- !query output org.apache.spark.sql.AnalysisException -Recursive query x should contain UNION or UNION ALL statements only. This error can also be caused by ORDER BY or LIMIT keywords used on result of UNION or UNION ALL.; +Recursive query x should contain UNION or UNION ALL statements only. This error can also be caused by ORDER BY or LIMIT keywords used on result of UNION or UNION ALL. -- !query @@ -1038,7 +1038,7 @@ WITH RECURSIVE x(id) AS (values (1) struct<> -- !query output org.apache.spark.sql.AnalysisException -Recursive query x should not contain recursive references in its subquery.; +Recursive query x should not contain recursive references in its subquery. -- !query @@ -1314,7 +1314,7 @@ WITH RECURSIVE foo(i) AS struct<> -- !query output org.apache.spark.sql.AnalysisException -Recursive reference foo cannot be used multiple times in a recursive term.; +Recursive reference foo cannot be used multiple times in a recursive term. -- !query @@ -1329,7 +1329,7 @@ WITH RECURSIVE foo(i) AS struct<> -- !query output org.apache.spark.sql.AnalysisException -Recursive reference foo cannot be used multiple times in a recursive term.; +Recursive reference foo cannot be used multiple times in a recursive term. -- !query @@ -1495,7 +1495,7 @@ SELECT * FROM outermost ORDER BY 1 struct<> -- !query output org.apache.spark.sql.AnalysisException -Recursive query outermost should not contain recursive references in its anchor (first) term.; +Recursive query outermost should not contain recursive references in its anchor (first) term. -- !query