@@ -2077,20 +2077,34 @@ impl fmt::Display for Join {
20772077 self . relation,
20782078 suffix( constraint)
20792079 ) ,
2080- JoinOperator :: LeftOuter ( constraint) => write ! (
2080+ JoinOperator :: Left ( constraint) => write ! (
20812081 f,
20822082 " {}LEFT JOIN {}{}" ,
20832083 prefix( constraint) ,
20842084 self . relation,
20852085 suffix( constraint)
20862086 ) ,
2087- JoinOperator :: RightOuter ( constraint) => write ! (
2087+ JoinOperator :: LeftOuter ( constraint) => write ! (
2088+ f,
2089+ " {}LEFT OUTER JOIN {}{}" ,
2090+ prefix( constraint) ,
2091+ self . relation,
2092+ suffix( constraint)
2093+ ) ,
2094+ JoinOperator :: Right ( constraint) => write ! (
20882095 f,
20892096 " {}RIGHT JOIN {}{}" ,
20902097 prefix( constraint) ,
20912098 self . relation,
20922099 suffix( constraint)
20932100 ) ,
2101+ JoinOperator :: RightOuter ( constraint) => write ! (
2102+ f,
2103+ " {}RIGHT OUTER JOIN {}{}" ,
2104+ prefix( constraint) ,
2105+ self . relation,
2106+ suffix( constraint)
2107+ ) ,
20942108 JoinOperator :: FullOuter ( constraint) => write ! (
20952109 f,
20962110 " {}FULL JOIN {}{}" ,
@@ -2162,7 +2176,9 @@ impl fmt::Display for Join {
21622176pub enum JoinOperator {
21632177 Join ( JoinConstraint ) ,
21642178 Inner ( JoinConstraint ) ,
2179+ Left ( JoinConstraint ) ,
21652180 LeftOuter ( JoinConstraint ) ,
2181+ Right ( JoinConstraint ) ,
21662182 RightOuter ( JoinConstraint ) ,
21672183 FullOuter ( JoinConstraint ) ,
21682184 CrossJoin ,
@@ -2547,13 +2563,18 @@ impl fmt::Display for SelectInto {
25472563/// e.g. GROUP BY year WITH ROLLUP WITH TOTALS
25482564///
25492565/// [ClickHouse]: <https://clickhouse.com/docs/en/sql-reference/statements/select/group-by#rollup-modifier>
2550- #[ derive( Debug , Copy , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
2566+ #[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
25512567#[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
25522568#[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
25532569pub enum GroupByWithModifier {
25542570 Rollup ,
25552571 Cube ,
25562572 Totals ,
2573+ /// Hive supports GROUP BY GROUPING SETS syntax.
2574+ /// e.g. GROUP BY year , month GROUPING SETS((year,month),(year),(month))
2575+ ///
2576+ /// [Hive]: <https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=30151323#EnhancedAggregation,Cube,GroupingandRollup-GROUPINGSETSclause>
2577+ GroupingSets ( Expr ) ,
25572578}
25582579
25592580impl fmt:: Display for GroupByWithModifier {
@@ -2562,6 +2583,9 @@ impl fmt::Display for GroupByWithModifier {
25622583 GroupByWithModifier :: Rollup => write ! ( f, "WITH ROLLUP" ) ,
25632584 GroupByWithModifier :: Cube => write ! ( f, "WITH CUBE" ) ,
25642585 GroupByWithModifier :: Totals => write ! ( f, "WITH TOTALS" ) ,
2586+ GroupByWithModifier :: GroupingSets ( expr) => {
2587+ write ! ( f, "{expr}" )
2588+ }
25652589 }
25662590 }
25672591}
0 commit comments