File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -370,6 +370,7 @@ impl fmt::Display for Join {
370370 fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
371371 match self . 0 {
372372 JoinConstraint :: On ( expr) => write ! ( f, " ON {}" , expr) ,
373+ JoinConstraint :: Where ( expr) => write ! ( f, " WHERE {}" , expr) ,
373374 JoinConstraint :: Using ( attrs) => {
374375 write ! ( f, " USING({})" , display_comma_separated( attrs) )
375376 }
@@ -433,6 +434,8 @@ pub enum JoinOperator {
433434#[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
434435pub enum JoinConstraint {
435436 On ( Expr ) ,
437+ /// snowflake-specific: https://docs.snowflake.com/en/sql-reference/constructs/where.html#joins-in-the-where-clause
438+ Where ( Expr ) ,
436439 Using ( Vec < Ident > ) ,
437440 Natural ,
438441}
Original file line number Diff line number Diff line change @@ -2328,6 +2328,9 @@ impl<'a> Parser<'a> {
23282328 } else if self . parse_keyword ( Keyword :: ON ) {
23292329 let constraint = self . parse_expr ( ) ?;
23302330 Ok ( JoinConstraint :: On ( constraint) )
2331+ } else if dialect_of ! ( self is SnowflakeDialect ) && self . parse_keyword ( Keyword :: WHERE ) {
2332+ let constraint = self . parse_expr ( ) ?;
2333+ Ok ( JoinConstraint :: Where ( constraint) )
23312334 } else if self . parse_keyword ( Keyword :: USING ) {
23322335 let columns = self . parse_parenthesized_column_list ( Mandatory ) ?;
23332336 Ok ( JoinConstraint :: Using ( columns) )
You can’t perform that action at this time.
0 commit comments