Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
3b44c59
adding testcase
kevinyu98 Apr 20, 2016
18b4a31
Merge remote-tracking branch 'upstream/master'
kevinyu98 Apr 22, 2016
4f4d1c8
Merge remote-tracking branch 'upstream/master'
kevinyu98 Apr 23, 2016
f5f0cbe
Merge remote-tracking branch 'upstream/master'
kevinyu98 Apr 23, 2016
d8b2edb
Merge remote-tracking branch 'upstream/master'
kevinyu98 Apr 25, 2016
196b6c6
Merge remote-tracking branch 'upstream/master'
kevinyu98 Apr 25, 2016
f37a01e
Merge remote-tracking branch 'upstream/master'
kevinyu98 Apr 27, 2016
bb5b01f
Merge remote-tracking branch 'upstream/master'
kevinyu98 Apr 30, 2016
bde5820
Merge remote-tracking branch 'upstream/master'
kevinyu98 May 4, 2016
5f7cd96
Merge remote-tracking branch 'upstream/master'
kevinyu98 May 10, 2016
893a49a
Merge remote-tracking branch 'upstream/master'
kevinyu98 May 13, 2016
4bbe1fd
Merge remote-tracking branch 'upstream/master'
kevinyu98 May 17, 2016
b2dd795
Merge remote-tracking branch 'upstream/master'
kevinyu98 May 18, 2016
8c3e5da
Merge remote-tracking branch 'upstream/master'
kevinyu98 May 18, 2016
a0eaa40
Merge remote-tracking branch 'upstream/master'
kevinyu98 May 19, 2016
d03c940
Merge remote-tracking branch 'upstream/master'
kevinyu98 May 19, 2016
d728d5e
Merge remote-tracking branch 'upstream/master'
kevinyu98 May 24, 2016
ea104dd
Merge remote-tracking branch 'upstream/master'
kevinyu98 May 25, 2016
6ab1215
Merge remote-tracking branch 'upstream/master'
kevinyu98 May 27, 2016
0c56653
Merge remote-tracking branch 'upstream/master'
kevinyu98 Jun 1, 2016
d7a1874
Merge remote-tracking branch 'upstream/master'
kevinyu98 Jun 1, 2016
85d3500
Merge remote-tracking branch 'upstream/master'
kevinyu98 Jun 2, 2016
c056f91
Merge remote-tracking branch 'upstream/master'
kevinyu98 Jun 3, 2016
0b8189d
Merge remote-tracking branch 'upstream/master'
kevinyu98 Jun 3, 2016
c2ea31d
Merge remote-tracking branch 'upstream/master'
kevinyu98 Jun 6, 2016
a2d3056
Merge remote-tracking branch 'upstream/master'
kevinyu98 Jun 8, 2016
39e5648
Merge remote-tracking branch 'upstream/master'
kevinyu98 Jun 8, 2016
b9370a3
Merge remote-tracking branch 'upstream/master'
kevinyu98 Jul 25, 2016
01224a4
Merge remote-tracking branch 'upstream/master'
kevinyu98 Aug 3, 2016
d05d39a
Merge remote-tracking branch 'upstream/master'
kevinyu98 Aug 19, 2016
ee6ed88
Merge remote-tracking branch 'upstream/master'
kevinyu98 Aug 26, 2016
db19296
Merge remote-tracking branch 'upstream/master'
kevinyu98 Aug 31, 2016
2e399d9
Merge remote-tracking branch 'upstream/master'
kevinyu98 Sep 1, 2016
0ef59bc
Merge remote-tracking branch 'upstream/master'
kevinyu98 Sep 30, 2016
6fad85f
Merge remote-tracking branch 'upstream/master'
kevinyu98 Oct 20, 2016
5525dff
Merge remote-tracking branch 'upstream/master'
kevinyu98 Nov 4, 2016
63715e4
Merge remote-tracking branch 'upstream/master'
kevinyu98 Nov 22, 2016
a084410
Merge remote-tracking branch 'upstream/master'
kevinyu98 Dec 9, 2016
cdfb1ad
first draft testcases
kevinyu98 Dec 9, 2016
753d7fe
in subquery testcase
kevinyu98 Dec 18, 2016
b6e5b97
Merge remote-tracking branch 'upstream/master'
kevinyu98 Dec 18, 2016
7ca65ec
Merge branch 'subquery' into spark-18871
kevinyu98 Dec 19, 2016
7165105
rerun the test
kevinyu98 Dec 19, 2016
32dbd46
rename the file name
kevinyu98 Dec 19, 2016
ee1e14e
fix comment
kevinyu98 Dec 19, 2016
c2ca009
rename the file
kevinyu98 Dec 19, 2016
9c584fb
logical grouping the IN subquery
kevinyu98 Dec 21, 2016
1c1900a
comment out 4 test cases
kevinyu98 Dec 22, 2016
7c129d9
address comments
kevinyu98 Jan 1, 2017
895bb35
remove two not in cases
kevinyu98 Jan 2, 2017
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
Prev Previous commit
Next Next commit
comment out 4 test cases
  • Loading branch information
kevinyu98 committed Dec 22, 2016
commit 1c1900a261b12e95a8a53892017294df3c21b317
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,14 @@ select count(distinct(*)) from t1 where t1b in (select min(t2b) from t2 where t1
select t1a, t1b from t1 where t1c in (select max(t2c) from t2 where t1a = t2a group by t2a, t2c having t2c > 8);
-- TC 01.11
select t1a, t1b from t1 where t1c in (select t2c from t2 where t2a in
( select min(t3a) from t3 where t3a = t2a group by t3b) group by t2c);
-- TC 01.12
select * from t1 where t1a in
(select min(t2a) from t2 where t2a = t2a and t2c >= 1 group by t2c having t2c in
(select t3c from t3 group by t3c, t3b having t2b > 6 and t3b > t2b ));
-- TC 01.13
select * from (select * from t2 where t2a in (select t1a from t1 where t1b = t2b)) t2 where t2a in
(select t2a from t2 where t2a = t2a and t2c > 1 group by t2a having t2c > 8);
(select min(t3a) from t3 where t3a = t2a group by t3b) group by t2c);
-- TC 01.12, comment out pending SPARK-18863
--select * from t1 where t1a in
--(select min(t2a) from t2 where t2a = t2a and t2c >= 1 group by t2c having t2c in
--(select t3c from t3 group by t3c, t3b having t2b > 6 and t3b > t2b ));
-- TC 01.13, comment out pending SPARK-18863
--select * from (select * from t2 where t2a in (select t1a from t1 where t1b = t2b)) t2 where t2a in
--(select t2a from t2 where t2a = t2a and t2c > 1 group by t2a having t2c > 8);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test suite is only for positive cases, right? The above two test cases are negative cases. The negative cases can be added with the other negative cases. Right? We can put these two cases in the JIRA-18863.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will enable these two test cases once the problem is fixed. They remain here to demonstrate the test coverage of IN/NOT IN subquery. At this point, I have only done an initial investigation on SPARK-18863. Once the investigation is confirmed that these two cases have the same root cause as the one in 18863, they will be cross-referenced.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two test cases will not be part of this test suite, right? So far, no negative cases are added to this test suite.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, so we can add these test cases back when deliver the fixes as you mentioned below? I will put these test case into the JIRA-18863. Thanks.


-- GROUP BY in both
-- TC 01.14
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ select t1a, t1b from t1 where t1c in (select t2b from t2 where t2a in
-- simple select for NOT IN
-- TC 01.07
select distinct(t1a), t1b, t1h from t1 where t1a not in (select t2a from t2);
-- TC 01.08
select t1d, t1h, t1i from t1 where t1d not in (select t2d from t2 where t2h > t1h or t2i > t1i);
-- TC 01.08, comment out pending on SPARK-18966
--select t1d, t1h, t1i from t1 where t1d not in (select t2d from t2 where t2h > t1h or t2i > t1i);
-- TC 01.09
select distinct(t1a), t1b from t1 where t1b not in (select t2b from t2 where t1a < t2a and t2b > 8);
-- TC 01.10
select t1a, t1b from t1 where t1c not in (select t2b from t2 where t2a not in
(select t3a from t3 where t2c = t3c and t2b is NULL));
-- TC 01.10, comment out pending on SPARK-18966
--select t1a, t1b from t1 where t1c not in (select t2b from t2 where t2a not in
-- (select t3a from t3 where t2c = t3c and t2b is NULL));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to add the test cases now. We can deliver the cases with the bug fixes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add these two cases into the JIRA. I think that is good enough.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SPARK-18966 has a simplified test case to demonstrate the problem. The complexity of these two test cases makes it difficult for us to walk through the root cause of the problem. We should enable the test cases here once we fix SPARK-18966 to demonstrate the test coverage of NOT IN in with correlated expressions. I can add a remark on SPARK-18966 to enable these test cases as part of its PR. Once this PR is reviewed and merged, I will have the file and the test cases' numbers recorded in SPARK-18966.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on my experience, we do not add them until the fix is ready.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is your recommendation to move this forward? Wouldn't commenting out the failing test cases be sufficient and at the same time, leave a trace that we had thought about these scenarios while we were writing tests for IN subquery?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, will do. Thanks.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normally, remove all the unnecessary changes. If any issue/bug exists, create a JIRA to track it.

-- TC 01.11
select t1a, t1b from t1 where t1h not in (select t2h from t2 where t2a = t1a) and t1b not in (
(select min(t3b) from t3 where t3d = t1d));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-- Automatically generated by SQLQueryTestSuite
-- Number of queries: 30
-- Number of queries: 28


-- !query 0
Expand Down Expand Up @@ -195,7 +195,7 @@ t1c 8

-- !query 17
select t1a, t1b from t1 where t1c in (select t2c from t2 where t2a in
( select min(t3a) from t3 where t3a = t2a group by t3b) group by t2c)
(select min(t3a) from t3 where t3a = t2a group by t3b) group by t2c)
-- !query 17 schema
struct<t1a:string,t1b:smallint>
-- !query 17 output
Expand All @@ -208,27 +208,29 @@ t1d NULL


-- !query 18
select * from t1 where t1a in
(select min(t2a) from t2 where t2a = t2a and t2c >= 1 group by t2c having t2c in
(select t3c from t3 group by t3c, t3b having t2b > 6 and t3b > t2b ))
select t1a, min(t1b) from t1 where t1c in (select min(t2c) from t2 where t2b = t1b group by t2a) group by t1a
-- !query 18 schema
struct<t1a:string,t1b:smallint,t1c:int,t1d:bigint,t1e:float,t1f:double,t1g:decimal(10,0),t1h:timestamp,t1i:date>
struct<t1a:string,min(t1b):smallint>
-- !query 18 output
t1b 8 16 19 17.0 25.0 26 2014-05-04 00:00:00 2014-05-04
t1b 8
t1c 8


-- !query 19
select * from (select * from t2 where t2a in (select t1a from t1 where t1b = t2b)) t2 where t2a in
(select t2a from t2 where t2a = t2a and t2c > 1 group by t2a having t2c > 8)
select t1a, min(t1b) from t1 where t1c in (select min(t2c) from t2 where t2b in (select min(t3b) from t3
where t2a = t3a group by t3a) group by t2c) group by t1a, t1d
-- !query 19 schema
struct<t2a:string,t2b:smallint,t2c:int,t2d:bigint,t2e:float,t2f:double,t2g:decimal(10,0),t2h:timestamp,t2i:date>
struct<t1a:string,min(t1b):smallint>
-- !query 19 output
t1b 8 16 119 17.0 25.0 26 2015-05-04 00:00:00 2015-05-04
t1b 8 16 19 17.0 25.0 26 2014-07-04 00:00:00 2014-07-04
t1b 8
t1c 8
t1d NULL
t1d NULL


-- !query 20
select t1a, min(t1b) from t1 where t1c in (select min(t2c) from t2 where t2b = t1b group by t2a) group by t1a
select t1a, min(t1b) from t1 where t1c in (select min(t2c) from t2 where t2b = t1b group by t2a) and
t1d in (select t3d from t3 where t1c = t3c group by t3d) group by t1a
-- !query 20 schema
struct<t1a:string,min(t1b):smallint>
-- !query 20 output
Expand All @@ -237,85 +239,63 @@ t1c 8


-- !query 21
select t1a, min(t1b) from t1 where t1c in (select min(t2c) from t2 where t2b in (select min(t3b) from t3
where t2a = t3a group by t3a) group by t2c) group by t1a, t1d
select t1a, min(t1b) from t1 where t1c in (select min(t2c) from t2 where t2b = t1b group by t2a) or
t1d in (select t3d from t3 where t1c = t3c group by t3d) group by t1a
-- !query 21 schema
struct<t1a:string,min(t1b):smallint>
-- !query 21 output
t1a 16
t1b 8
t1c 8
t1d NULL
t1d NULL


-- !query 22
select t1a, min(t1b) from t1 where t1c in (select min(t2c) from t2 where t2b = t1b group by t2a) and
t1d in (select t3d from t3 where t1c = t3c group by t3d) group by t1a
select t1a, min(t1b) from t1 where t1c in (select min(t2c) from t2 where t2b = t1b group by t2a having t2a > t1a) or
t1d in (select t3d from t3 where t1c = t3c group by t3d having t3d = t1d) group by t1a having min(t1b) is NOT NULL
-- !query 22 schema
struct<t1a:string,min(t1b):smallint>
-- !query 22 output
t1a 16
t1b 8
t1c 8


-- !query 23
select t1a, min(t1b) from t1 where t1c in (select min(t2c) from t2 where t2b = t1b group by t2a) or
t1d in (select t3d from t3 where t1c = t3c group by t3d) group by t1a
DROP TABLE t1
-- !query 23 schema
struct<t1a:string,min(t1b):smallint>
struct<>
-- !query 23 output
t1a 16
t1b 8
t1c 8
t1d NULL



-- !query 24
select t1a, min(t1b) from t1 where t1c in (select min(t2c) from t2 where t2b = t1b group by t2a having t2a > t1a) or
t1d in (select t3d from t3 where t1c = t3c group by t3d having t3d = t1d) group by t1a having min(t1b) is NOT NULL
DROP TABLE t2
-- !query 24 schema
struct<t1a:string,min(t1b):smallint>
struct<>
-- !query 24 output
t1a 16
t1b 8
t1c 8



-- !query 25
DROP TABLE t1
DROP TABLE t3
-- !query 25 schema
struct<>
-- !query 25 output



-- !query 26
DROP TABLE t2
USE default
-- !query 26 schema
struct<>
-- !query 26 output



-- !query 27
DROP TABLE t3
DROP DATABASE indb
-- !query 27 schema
struct<>
-- !query 27 output



-- !query 28
USE default
-- !query 28 schema
struct<>
-- !query 28 output



-- !query 29
DROP DATABASE indb
-- !query 29 schema
struct<>
-- !query 29 output

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-- Automatically generated by SQLQueryTestSuite
-- Number of queries: 23
-- Number of queries: 21


-- !query 0
Expand Down Expand Up @@ -171,92 +171,63 @@ t1d NULL 2014-07-04 00:00:00


-- !query 14
select t1d, t1h, t1i from t1 where t1d not in (select t2d from t2 where t2h > t1h or t2i > t1i)
select distinct(t1a), t1b from t1 where t1b not in (select t2b from t2 where t1a < t2a and t2b > 8)
-- !query 14 schema
struct<t1d:bigint,t1h:timestamp,t1i:date>
struct<t1a:string,t1b:smallint>
-- !query 14 output
10 2014-04-04 00:00:00 2014-04-04
10 2014-04-04 00:00:00 2014-04-04
t1a 16
t1a 6
t1b 8
t1c 8
t1d 10
t1e 10


-- !query 15
select distinct(t1a), t1b from t1 where t1b not in (select t2b from t2 where t1a < t2a and t2b > 8)
select t1a, t1b from t1 where t1h not in (select t2h from t2 where t2a = t1a) and t1b not in (
(select min(t3b) from t3 where t3d = t1d))
-- !query 15 schema
struct<t1a:string,t1b:smallint>
-- !query 15 output
t1a 16
t1a 6
t1b 8
t1c 8
t1d 10
t1e 10


-- !query 16
select t1a, t1b from t1 where t1c not in (select t2b from t2 where t2a not in
(select t3a from t3 where t2c = t3c and t2b is NULL))
DROP TABLE t1
-- !query 16 schema
struct<t1a:string,t1b:smallint>
struct<>
-- !query 16 output
t1a 16
t1a 16
t1a 6
t1a 6
t1b 8
t1c 8
t1d 10
t1d NULL
t1d NULL
t1e 10
t1e 10
t1e 10



-- !query 17
select t1a, t1b from t1 where t1h not in (select t2h from t2 where t2a = t1a) and t1b not in (
(select min(t3b) from t3 where t3d = t1d))
DROP TABLE t2
-- !query 17 schema
struct<t1a:string,t1b:smallint>
struct<>
-- !query 17 output
t1a 16
t1e 10



-- !query 18
DROP TABLE t1
DROP TABLE t3
-- !query 18 schema
struct<>
-- !query 18 output



-- !query 19
DROP TABLE t2
USE default
-- !query 19 schema
struct<>
-- !query 19 output



-- !query 20
DROP TABLE t3
DROP DATABASE indb
-- !query 20 schema
struct<>
-- !query 20 output



-- !query 21
USE default
-- !query 21 schema
struct<>
-- !query 21 output



-- !query 22
DROP DATABASE indb
-- !query 22 schema
struct<>
-- !query 22 output