@@ -5582,6 +5582,7 @@ fn parse_implicit_join() {
55825582 partitions: vec![ ] ,
55835583 with_ordinality: false ,
55845584 } ,
5585+ global: false ,
55855586 join_operator: JoinOperator :: Inner ( JoinConstraint :: Natural ) ,
55865587 } ] ,
55875588 } ,
@@ -5605,6 +5606,7 @@ fn parse_implicit_join() {
56055606 partitions: vec![ ] ,
56065607 with_ordinality: false ,
56075608 } ,
5609+ global: false ,
56085610 join_operator: JoinOperator :: Inner ( JoinConstraint :: Natural ) ,
56095611 } ] ,
56105612 } ,
@@ -5628,6 +5630,7 @@ fn parse_cross_join() {
56285630 partitions: vec![ ] ,
56295631 with_ordinality: false ,
56305632 } ,
5633+ global: false ,
56315634 join_operator: JoinOperator :: CrossJoin ,
56325635 } ,
56335636 only( only( select. from) . joins) ,
@@ -5639,6 +5642,7 @@ fn parse_joins_on() {
56395642 fn join_with_constraint (
56405643 relation : impl Into < String > ,
56415644 alias : Option < TableAlias > ,
5645+ global : bool ,
56425646 f : impl Fn ( JoinConstraint ) -> JoinOperator ,
56435647 ) -> Join {
56445648 Join {
@@ -5651,6 +5655,7 @@ fn parse_joins_on() {
56515655 partitions : vec ! [ ] ,
56525656 with_ordinality : false ,
56535657 } ,
5658+ global,
56545659 join_operator : f ( JoinConstraint :: On ( Expr :: BinaryOp {
56555660 left : Box :: new ( Expr :: Identifier ( "c1" . into ( ) ) ) ,
56565661 op : BinaryOperator :: Eq ,
@@ -5664,6 +5669,7 @@ fn parse_joins_on() {
56645669 vec![ join_with_constraint(
56655670 "t2" ,
56665671 table_alias( "foo" ) ,
5672+ false ,
56675673 JoinOperator :: Inner ,
56685674 ) ]
56695675 ) ;
@@ -5674,35 +5680,80 @@ fn parse_joins_on() {
56745680 // Test parsing of different join operators
56755681 assert_eq ! (
56765682 only( & verified_only_select( "SELECT * FROM t1 JOIN t2 ON c1 = c2" ) . from) . joins,
5677- vec![ join_with_constraint( "t2" , None , JoinOperator :: Inner ) ]
5683+ vec![ join_with_constraint( "t2" , None , false , JoinOperator :: Inner ) ]
56785684 ) ;
56795685 assert_eq ! (
56805686 only( & verified_only_select( "SELECT * FROM t1 LEFT JOIN t2 ON c1 = c2" ) . from) . joins,
5681- vec![ join_with_constraint( "t2" , None , JoinOperator :: LeftOuter ) ]
5687+ vec![ join_with_constraint(
5688+ "t2" ,
5689+ None ,
5690+ false ,
5691+ JoinOperator :: LeftOuter
5692+ ) ]
56825693 ) ;
56835694 assert_eq ! (
56845695 only( & verified_only_select( "SELECT * FROM t1 RIGHT JOIN t2 ON c1 = c2" ) . from) . joins,
5685- vec![ join_with_constraint( "t2" , None , JoinOperator :: RightOuter ) ]
5696+ vec![ join_with_constraint(
5697+ "t2" ,
5698+ None ,
5699+ false ,
5700+ JoinOperator :: RightOuter
5701+ ) ]
56865702 ) ;
56875703 assert_eq ! (
56885704 only( & verified_only_select( "SELECT * FROM t1 LEFT SEMI JOIN t2 ON c1 = c2" ) . from) . joins,
5689- vec![ join_with_constraint( "t2" , None , JoinOperator :: LeftSemi ) ]
5705+ vec![ join_with_constraint(
5706+ "t2" ,
5707+ None ,
5708+ false ,
5709+ JoinOperator :: LeftSemi
5710+ ) ]
56905711 ) ;
56915712 assert_eq ! (
56925713 only( & verified_only_select( "SELECT * FROM t1 RIGHT SEMI JOIN t2 ON c1 = c2" ) . from) . joins,
5693- vec![ join_with_constraint( "t2" , None , JoinOperator :: RightSemi ) ]
5714+ vec![ join_with_constraint(
5715+ "t2" ,
5716+ None ,
5717+ false ,
5718+ JoinOperator :: RightSemi
5719+ ) ]
56945720 ) ;
56955721 assert_eq ! (
56965722 only( & verified_only_select( "SELECT * FROM t1 LEFT ANTI JOIN t2 ON c1 = c2" ) . from) . joins,
5697- vec![ join_with_constraint( "t2" , None , JoinOperator :: LeftAnti ) ]
5723+ vec![ join_with_constraint(
5724+ "t2" ,
5725+ None ,
5726+ false ,
5727+ JoinOperator :: LeftAnti
5728+ ) ]
56985729 ) ;
56995730 assert_eq ! (
57005731 only( & verified_only_select( "SELECT * FROM t1 RIGHT ANTI JOIN t2 ON c1 = c2" ) . from) . joins,
5701- vec![ join_with_constraint( "t2" , None , JoinOperator :: RightAnti ) ]
5732+ vec![ join_with_constraint(
5733+ "t2" ,
5734+ None ,
5735+ false ,
5736+ JoinOperator :: RightAnti
5737+ ) ]
57025738 ) ;
57035739 assert_eq ! (
57045740 only( & verified_only_select( "SELECT * FROM t1 FULL JOIN t2 ON c1 = c2" ) . from) . joins,
5705- vec![ join_with_constraint( "t2" , None , JoinOperator :: FullOuter ) ]
5741+ vec![ join_with_constraint(
5742+ "t2" ,
5743+ None ,
5744+ false ,
5745+ JoinOperator :: FullOuter
5746+ ) ]
5747+ ) ;
5748+
5749+ assert_eq ! (
5750+ only( & verified_only_select( "SELECT * FROM t1 GLOBAL FULL JOIN t2 ON c1 = c2" ) . from) . joins,
5751+ vec![ join_with_constraint(
5752+ "t2" ,
5753+ None ,
5754+ true ,
5755+ JoinOperator :: FullOuter
5756+ ) ]
57065757 ) ;
57075758}
57085759
@@ -5723,6 +5774,7 @@ fn parse_joins_using() {
57235774 partitions : vec ! [ ] ,
57245775 with_ordinality : false ,
57255776 } ,
5777+ global : false ,
57265778 join_operator : f ( JoinConstraint :: Using ( vec ! [ "c1" . into( ) ] ) ) ,
57275779 }
57285780 }
@@ -5787,6 +5839,7 @@ fn parse_natural_join() {
57875839 partitions : vec ! [ ] ,
57885840 with_ordinality : false ,
57895841 } ,
5842+ global : false ,
57905843 join_operator : f ( JoinConstraint :: Natural ) ,
57915844 }
57925845 }
@@ -6055,6 +6108,7 @@ fn parse_derived_tables() {
60556108 partitions: vec![ ] ,
60566109 with_ordinality: false ,
60576110 } ,
6111+ global: false ,
60586112 join_operator: JoinOperator :: Inner ( JoinConstraint :: Natural ) ,
60596113 } ] ,
60606114 } ) ,
@@ -6965,6 +7019,7 @@ fn lateral_function() {
69657019 ] ,
69667020 alias: None ,
69677021 } ,
7022+ global: false ,
69687023 join_operator: JoinOperator :: LeftOuter ( JoinConstraint :: None ) ,
69697024 } ] ,
69707025 } ] ,
0 commit comments