File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed
Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -919,16 +919,12 @@ def _parse_make_interval(self) -> exp.MakeInterval:
919919 def _parse_approx_quantiles (self ) -> t .Optional [exp .Expression ]:
920920 # APPROX_QUANTILES([DISTINCT] expression, number [{IGNORE | RESPECT} NULLS])
921921 distinct = self ._match (TokenType .DISTINCT )
922- this = self ._parse_assignment ()
922+ this = self ._parse_disjunction ()
923923 if distinct :
924924 this = self .expression (exp .Distinct , expressions = [this ])
925925
926- if not self ._match (TokenType .COMMA ):
927- self .raise_error (
928- "Expected comma between expression and number of quantiles in APPROX_QUANTILES"
929- )
930-
931- expression = self ._parse_assignment ()
926+ self ._match (TokenType .COMMA )
927+ expression = self ._parse_disjunction ()
932928 if not expression :
933929 self .raise_error ("Expected number of quantiles argument in APPROX_QUANTILES" )
934930
Original file line number Diff line number Diff line change @@ -3448,6 +3448,8 @@ def test_round(self):
34483448
34493449 def test_approx_quantiles (self ):
34503450 self .validate_identity ("APPROX_QUANTILES(x, 2)" )
3451+ self .validate_identity ("APPROX_QUANTILES(FALSE OR TRUE, 2)" )
3452+ self .validate_identity ("APPROX_QUANTILES((SELECT 1 AS val), CAST(2.1 AS INT64))" )
34513453 self .validate_identity ("APPROX_QUANTILES(DISTINCT x, 2)" )
34523454 self .validate_identity ("APPROX_QUANTILES(x, 2 RESPECT NULLS)" )
34533455 self .validate_identity ("APPROX_QUANTILES(x, 2 IGNORE NULLS)" )
You can’t perform that action at this time.
0 commit comments