Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,11 @@ struct<>

-- !query 1
SELECT
-- boolean and transitions
-- null because strict
(NULL AND NULL) IS NULL AS `t`,
(TRUE AND NULL) IS NULL AS `t`,
(FALSE AND NULL) IS NULL AS `t`,
(NULL AND TRUE) IS NULL AS `t`,
(NULL AND FALSE) IS NULL AS `t`,
-- and actual computations
(TRUE AND TRUE) AS `t`,
NOT (TRUE AND FALSE) AS `t`,
NOT (FALSE AND TRUE) AS `t`,
Expand All @@ -38,14 +35,11 @@ true true false true false true true true true

-- !query 2
SELECT
-- boolean or transitions
-- null because strict
(NULL OR NULL) IS NULL AS `t`,
(TRUE OR NULL) IS NULL AS `t`,
(FALSE OR NULL) IS NULL AS `t`,
(NULL OR TRUE) IS NULL AS `t`,
(NULL OR FALSE) IS NULL AS `t`,
-- actual computations
(TRUE OR TRUE) AS `t`,
(TRUE OR FALSE) AS `t`,
(FALSE OR TRUE) AS `t`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,6 @@ NULL


-- !query 39
-- error
SELECT boolean(string('')) AS invalid
-- !query 39 schema
struct<invalid:boolean>
Expand All @@ -325,8 +324,6 @@ NULL


-- !query 40
-- error

CREATE TABLE BOOLTBL1 (f1 boolean) USING parquet
-- !query 40 schema
struct<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -452,17 +452,15 @@ struct<DATE '4714-11-23':date>


-- !query 44
-- out of range
SELECT date '5874897-12-31'
-- !query 44 schema
struct<>
-- !query 44 output
org.apache.spark.sql.catalyst.parser.ParseException

Cannot parse the DATE value: 5874897-12-31(line 2, pos 7)
Cannot parse the DATE value: 5874897-12-31(line 1, pos 7)

== SQL ==
-- out of range
SELECT date '5874897-12-31'
-------^^^

Expand All @@ -482,10 +480,6 @@ SELECT date '5874898-01-01'


-- !query 46
-- out of range



SELECT f1 - date '2000-01-01' AS `Days From 2K` FROM DATE_TBL
-- !query 46 schema
struct<Days From 2K:int>
Expand Down
42 changes: 5 additions & 37 deletions sql/core/src/test/resources/sql-tests/results/pgSQL/join.sql.out
Original file line number Diff line number Diff line change
Expand Up @@ -3257,18 +3257,16 @@ Reference 'f1' is ambiguous, could be: j.f1, j.f1.; line 2 pos 63


-- !query 168
-- error
select * from
int8_tbl x join (int4_tbl x cross join int4_tbl y) j on q1 = y.f1
-- !query 168 schema
struct<>
-- !query 168 output
org.apache.spark.sql.AnalysisException
cannot resolve '`y.f1`' given input columns: [j.f1, j.f1, x.q1, x.q2]; line 3 pos 63
cannot resolve '`y.f1`' given input columns: [j.f1, j.f1, x.q1, x.q2]; line 2 pos 63


-- !query 169
-- error
select * from
int8_tbl x join (int4_tbl x cross join int4_tbl y(ff)) j on q1 = f1
-- !query 169 schema
Expand All @@ -3278,72 +3276,42 @@ struct<q1:bigint,q2:bigint,f1:int,ff:int>


-- !query 170
-- ok


select t1.uunique1 from
tenk1 t1 join tenk2 t2 on t1.two = t2.two
-- !query 170 schema
struct<>
-- !query 170 output
org.apache.spark.sql.AnalysisException
cannot resolve '`t1.uunique1`' given input columns: [t1.even, t2.even, t1.fivethous, t2.fivethous, t1.four, t2.four, t1.hundred, t2.hundred, t1.odd, t2.odd, t1.string4, t2.string4, t1.stringu1, t2.stringu1, t1.stringu2, t2.stringu2, t1.ten, t2.ten, t1.tenthous, t2.tenthous, t1.thousand, t2.thousand, t1.twenty, t2.twenty, t1.two, t2.two, t1.twothousand, t2.twothousand, t1.unique1, t2.unique1, t1.unique2, t2.unique2]; line 4 pos 7
cannot resolve '`t1.uunique1`' given input columns: [t1.even, t2.even, t1.fivethous, t2.fivethous, t1.four, t2.four, t1.hundred, t2.hundred, t1.odd, t2.odd, t1.string4, t2.string4, t1.stringu1, t2.stringu1, t1.stringu2, t2.stringu2, t1.ten, t2.ten, t1.tenthous, t2.tenthous, t1.thousand, t2.thousand, t1.twenty, t2.twenty, t1.two, t2.two, t1.twothousand, t2.twothousand, t1.unique1, t2.unique1, t1.unique2, t2.unique2]; line 1 pos 7


-- !query 171
-- error, prefer "t1" suggestion
select t2.uunique1 from
tenk1 t1 join tenk2 t2 on t1.two = t2.two
-- !query 171 schema
struct<>
-- !query 171 output
org.apache.spark.sql.AnalysisException
cannot resolve '`t2.uunique1`' given input columns: [t1.even, t2.even, t1.fivethous, t2.fivethous, t1.four, t2.four, t1.hundred, t2.hundred, t1.odd, t2.odd, t1.string4, t2.string4, t1.stringu1, t2.stringu1, t1.stringu2, t2.stringu2, t1.ten, t2.ten, t1.tenthous, t2.tenthous, t1.thousand, t2.thousand, t1.twenty, t2.twenty, t1.two, t2.two, t1.twothousand, t2.twothousand, t1.unique1, t2.unique1, t1.unique2, t2.unique2]; line 2 pos 7
cannot resolve '`t2.uunique1`' given input columns: [t1.even, t2.even, t1.fivethous, t2.fivethous, t1.four, t2.four, t1.hundred, t2.hundred, t1.odd, t2.odd, t1.string4, t2.string4, t1.stringu1, t2.stringu1, t1.stringu2, t2.stringu2, t1.ten, t2.ten, t1.tenthous, t2.tenthous, t1.thousand, t2.thousand, t1.twenty, t2.twenty, t1.two, t2.two, t1.twothousand, t2.twothousand, t1.unique1, t2.unique1, t1.unique2, t2.unique2]; line 1 pos 7


-- !query 172
-- error, prefer "t2" suggestion
select uunique1 from
tenk1 t1 join tenk2 t2 on t1.two = t2.two
-- !query 172 schema
struct<>
-- !query 172 output
org.apache.spark.sql.AnalysisException
cannot resolve '`uunique1`' given input columns: [t1.even, t2.even, t1.fivethous, t2.fivethous, t1.four, t2.four, t1.hundred, t2.hundred, t1.odd, t2.odd, t1.string4, t2.string4, t1.stringu1, t2.stringu1, t1.stringu2, t2.stringu2, t1.ten, t2.ten, t1.tenthous, t2.tenthous, t1.thousand, t2.thousand, t1.twenty, t2.twenty, t1.two, t2.two, t1.twothousand, t2.twothousand, t1.unique1, t2.unique1, t1.unique2, t2.unique2]; line 2 pos 7
cannot resolve '`uunique1`' given input columns: [t1.even, t2.even, t1.fivethous, t2.fivethous, t1.four, t2.four, t1.hundred, t2.hundred, t1.odd, t2.odd, t1.string4, t2.string4, t1.stringu1, t2.stringu1, t1.stringu2, t2.stringu2, t1.ten, t2.ten, t1.tenthous, t2.tenthous, t1.thousand, t2.thousand, t1.twenty, t2.twenty, t1.two, t2.two, t1.twothousand, t2.twothousand, t1.unique1, t2.unique1, t1.unique2, t2.unique2]; line 1 pos 7


-- !query 173
-- error, suggest both at once
























select f1,g from int4_tbl a, (select f1 as g) ss
-- !query 173 schema
struct<>
-- !query 173 output
org.apache.spark.sql.AnalysisException
cannot resolve '`f1`' given input columns: []; line 26 pos 37
cannot resolve '`f1`' given input columns: []; line 1 pos 37


-- !query 174
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,6 @@ NULL


-- !query 22
-- same thing
SELECT * FROM foo ORDER BY f1 NULLS FIRST
-- !query 22 schema
struct<f1:int>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,23 +358,20 @@ create table foo (with baz)


-- !query 38
-- fail, WITH is a reserved word
create table foo (with ordinality)
-- !query 38 schema
struct<>
-- !query 38 output
org.apache.spark.sql.catalyst.parser.ParseException

no viable alternative at input 'with'(line 2, pos 18)
no viable alternative at input 'with'(line 1, pos 18)

== SQL ==
-- fail, WITH is a reserved word
create table foo (with ordinality)
------------------^^^


-- !query 39
-- fail, WITH is a reserved word
with ordinality as (select 1 as x) select * from ordinality
-- !query 39 schema
struct<x:int>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ struct<>


-- !query 1
-- Case 5
-- (one null column with no match -> row is returned)
SELECT *
FROM m
WHERE b = 1.0 -- Matches (null, 1.0)
Expand All @@ -29,8 +27,6 @@ NULL 1


-- !query 2
-- Case 6
-- (no null columns with match -> row not returned)
SELECT *
FROM m
WHERE b = 3.0 -- Matches (2, 3.0)
Expand All @@ -42,8 +38,6 @@ struct<a:int,b:decimal(2,1)>


-- !query 3
-- Case 7
-- (no null columns with no match -> row is returned)
SELECT *
FROM m
WHERE b = 5.0 -- Matches (4, 5.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ struct<>


-- !query 2
-- Case 1
-- (subquery is empty -> row is returned)
SELECT *
FROM m
WHERE (a, b) NOT IN (SELECT *
Expand All @@ -46,8 +44,6 @@ NULL NULL


-- !query 3
-- Case 2
-- (subquery contains a row with null in all columns -> row not returned)
SELECT *
FROM m
WHERE (a, b) NOT IN (SELECT *
Expand All @@ -60,8 +56,6 @@ struct<a:int,b:decimal(2,1)>


-- !query 4
-- Case 3
-- (probe-side columns are all null -> row not returned)
SELECT *
FROM m
WHERE a IS NULL AND b IS NULL -- Matches only (null, null)
Expand All @@ -75,8 +69,6 @@ struct<a:int,b:decimal(2,1)>


-- !query 5
-- Case 4
-- (one column null, other column matches a row in the subquery result -> row not returned)
SELECT *
FROM m
WHERE b = 1.0 -- Matches (null, 1.0)
Expand All @@ -90,8 +82,6 @@ struct<a:int,b:decimal(2,1)>


-- !query 6
-- Case 5
-- (one null column with no match -> row is returned)
SELECT *
FROM m
WHERE b = 1.0 -- Matches (null, 1.0)
Expand All @@ -105,8 +95,6 @@ NULL 1


-- !query 7
-- Case 6
-- (no null columns with match -> row not returned)
SELECT *
FROM m
WHERE b = 3.0 -- Matches (2, 3.0)
Expand All @@ -120,8 +108,6 @@ struct<a:int,b:decimal(2,1)>


-- !query 8
-- Case 7
-- (no null columns with no match -> row is returned)
SELECT *
FROM m
WHERE b = 5.0 -- Matches (4, 5.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@ struct<>


-- !query 1
-- Uncorrelated NOT IN Subquery test cases
-- Case 1 (not possible to write a literal with no rows, so we ignore it.)
-- (empty subquery -> all rows returned)

-- Case 2
-- (subquery includes null -> no rows returned)
SELECT *
FROM m
WHERE a NOT IN (null)
Expand All @@ -31,8 +25,6 @@ struct<a:int,b:decimal(2,1)>


-- !query 2
-- Case 3
-- (probe column is null -> row not returned)
SELECT *
FROM m
WHERE b = 1.0 -- Only matches (null, 1.0)
Expand All @@ -44,8 +36,6 @@ struct<a:int,b:decimal(2,1)>


-- !query 3
-- Case 4
-- (probe column matches subquery row -> row not returned)
SELECT *
FROM m
WHERE b = 3.0 -- Only matches (2, 3.0)
Expand All @@ -57,8 +47,6 @@ struct<a:int,b:decimal(2,1)>


-- !query 4
-- Case 5
-- (probe column does not match subquery row -> row is returned)
SELECT *
FROM m
WHERE b = 3.0 -- Only matches (2, 3.0)
Expand Down
Loading