Skip to content

Commit 9ba50c7

Browse files
committed
fixup! fixup! Remove redundant tests for sql integrations
1 parent c03b365 commit 9ba50c7

File tree

2 files changed

+39
-31
lines changed

2 files changed

+39
-31
lines changed

datafusion/sql/tests/sql_integration.rs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4860,6 +4860,38 @@ fn test_using_join_wildcard_schema() {
48604860
);
48614861
}
48624862

4863+
#[test]
4864+
fn test_2_nested_lateral_join_with_the_deepest_join_referencing_the_outer_most_relation()
4865+
{
4866+
let sql = "SELECT * FROM j1 j1_outer, LATERAL (
4867+
SELECT * FROM j1 j1_inner, LATERAL (
4868+
SELECT * FROM j2 WHERE j1_inner.j1_id = j2_id and j1_outer.j1_id=j2_id
4869+
) as j2
4870+
) as j2";
4871+
4872+
let plan = logical_plan(sql).unwrap();
4873+
assert_snapshot!(
4874+
plan,
4875+
@r#"
4876+
Projection: j1_outer.j1_id, j1_outer.j1_string, j2.j1_id, j2.j1_string, j2.j2_id, j2.j2_string
4877+
Cross Join:
4878+
SubqueryAlias: j1_outer
4879+
TableScan: j1
4880+
SubqueryAlias: j2
4881+
Subquery:
4882+
Projection: j1_inner.j1_id, j1_inner.j1_string, j2.j2_id, j2.j2_string
4883+
Cross Join:
4884+
SubqueryAlias: j1_inner
4885+
TableScan: j1
4886+
SubqueryAlias: j2
4887+
Subquery:
4888+
Projection: j2.j2_id, j2.j2_string
4889+
Filter: outer_ref(j1_inner.j1_id) = j2.j2_id AND outer_ref(j1_outer.j1_id) = j2.j2_id
4890+
TableScan: j2
4891+
"#
4892+
);
4893+
}
4894+
48634895
#[test]
48644896
fn test_correlated_recursive_scalar_subquery_with_level_3_scalar_subquery_referencing_level1_relation()
48654897
{

datafusion/sqllogictest/test_files/joins.slt

Lines changed: 7 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,15 @@ statement ok
5757
CREATE TABLE join_t3(s3 struct<id INT>)
5858
AS VALUES
5959
(NULL),
60-
({id: 1}),
61-
({id: 2});
60+
(struct(1)),
61+
(struct(2));
6262

6363
statement ok
6464
CREATE TABLE join_t4(s4 struct<id INT>)
6565
AS VALUES
6666
(NULL),
67-
({id: 2}),
68-
({id: 3});
67+
(struct(2)),
68+
(struct(3));
6969

7070
# Left semi anti join
7171

@@ -4646,29 +4646,6 @@ logical_plan
46464646
08)----------TableScan: j3 projection=[j3_string, j3_id]
46474647
physical_plan_error This feature is not implemented: Physical plan does not support logical expression OuterReferenceColumn(Field { name: "j1_id", data_type: Int32, nullable: true }, Column { relation: Some(Bare { table: "j1" }), name: "j1_id" })
46484648

4649-
# 2 nested lateral join with the deepest join referencing the outer most relation
4650-
query TT
4651-
explain SELECT * FROM j1 j1_outer, LATERAL (
4652-
SELECT * FROM j1 j1_inner, LATERAL (
4653-
SELECT * FROM j2 WHERE j1_inner.j1_id = j2_id and j1_outer.j1_id=j2_id
4654-
) as j2
4655-
) as j2;
4656-
----
4657-
logical_plan
4658-
01)Cross Join:
4659-
02)--SubqueryAlias: j1_outer
4660-
03)----TableScan: j1 projection=[j1_string, j1_id]
4661-
04)--SubqueryAlias: j2
4662-
05)----Subquery:
4663-
06)------Cross Join:
4664-
07)--------SubqueryAlias: j1_inner
4665-
08)----------TableScan: j1 projection=[j1_string, j1_id]
4666-
09)--------SubqueryAlias: j2
4667-
10)----------Subquery:
4668-
11)------------Filter: outer_ref(j1_inner.j1_id) = j2.j2_id AND outer_ref(j1_outer.j1_id) = j2.j2_id
4669-
12)--------------TableScan: j2 projection=[j2_string, j2_id]
4670-
physical_plan_error This feature is not implemented: Physical plan does not support logical expression OuterReferenceColumn(Field { name: "j1_id", data_type: Int32, nullable: true }, Column { relation: Some(Bare { table: "j1_inner" }), name: "j1_id" })
4671-
46724649
query TT
46734650
explain SELECT * FROM j1, LATERAL (SELECT 1) AS j2;
46744651
----
@@ -5072,10 +5049,9 @@ WHERE k1 < 0
50725049
----
50735050
physical_plan
50745051
01)HashJoinExec: mode=CollectLeft, join_type=RightAnti, on=[(k2@0, k1@0)]
5075-
02)--FilterExec: k2@0 < 0
5076-
03)----DataSourceExec: partitions=1, partition_sizes=[0]
5077-
04)--FilterExec: k1@0 < 0
5078-
05)----DataSourceExec: partitions=1, partition_sizes=[10000]
5052+
02)--DataSourceExec: partitions=1, partition_sizes=[0]
5053+
03)--FilterExec: k1@0 < 0
5054+
04)----DataSourceExec: partitions=1, partition_sizes=[10000]
50795055

50805056
query II
50815057
SELECT *

0 commit comments

Comments
 (0)