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
@@ -0,0 +1,29 @@
-- List of configuration the test suite is run against:
--SET spark.sql.autoBroadcastJoinThreshold=10485760
--SET spark.sql.autoBroadcastJoinThreshold=-1,spark.sql.join.preferSortMergeJoin=true
--SET spark.sql.autoBroadcastJoinThreshold=-1,spark.sql.join.preferSortMergeJoin=false

-- This test file was converted from natural-join.sql.
-- Note that currently registered UDF returns a string. So there are some differences, for instance
-- in string cast within UDF in Scala and Python.

create temporary view nt1 as select * from values
("one", 1),
("two", 2),
("three", 3)
as nt1(k, v1);

create temporary view nt2 as select * from values
("one", 1),
("two", 22),
("one", 5)
as nt2(k, v2);


SELECT * FROM nt1 natural join nt2 where udf(k) = "one";

SELECT * FROM nt1 natural left join nt2 where k <> udf("") order by v1, v2;

SELECT * FROM nt1 natural right join nt2 where udf(k) <> udf("") order by v1, v2;

SELECT udf(count(*)) FROM nt1 natural full outer join nt2;
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
-- Automatically generated by SQLQueryTestSuite
-- Number of queries: 6


-- !query 0
create temporary view nt1 as select * from values
("one", 1),
("two", 2),
("three", 3)
as nt1(k, v1)
-- !query 0 schema
struct<>
-- !query 0 output



-- !query 1
create temporary view nt2 as select * from values
("one", 1),
("two", 22),
("one", 5)
as nt2(k, v2)
-- !query 1 schema
struct<>
-- !query 1 output



-- !query 2
SELECT * FROM nt1 natural join nt2 where udf(k) = "one"
-- !query 2 schema
struct<k:string,v1:int,v2:int>
-- !query 2 output
one 1 1
one 1 5


-- !query 3
SELECT * FROM nt1 natural left join nt2 where k <> udf("") order by v1, v2
-- !query 3 schema
struct<k:string,v1:int,v2:int>
-- !query 3 output
one 1 1
one 1 5
two 2 22
three 3 NULL


-- !query 4
SELECT * FROM nt1 natural right join nt2 where udf(k) <> udf("") order by v1, v2
-- !query 4 schema
struct<k:string,v1:int,v2:int>
-- !query 4 output
one 1 1
one 1 5
two 2 22


-- !query 5
SELECT udf(count(*)) FROM nt1 natural full outer join nt2
-- !query 5 schema
struct<udf(count(1)):string>
-- !query 5 output
4