Skip to content

Commit

Permalink
Support APPROX_PERCENTILE function (#1002)
Browse files Browse the repository at this point in the history
* support approx_percentile function

* update

Co-authored-by: kennytm <kennytm@gmail.com>
  • Loading branch information
leiysky and kennytm authored Sep 4, 2020
1 parent b0b7759 commit 39e9c7b
Show file tree
Hide file tree
Showing 5 changed files with 7,921 additions and 7,889 deletions.
2 changes: 2 additions & 0 deletions ast/functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,8 @@ const (
AggFuncJsonObjectAgg = "json_objectagg"
// AggFuncApproxCountDistinct is the name of approx_count_distinct function.
AggFuncApproxCountDistinct = "approx_count_distinct"
// AggFuncApproxPercentile is the name of approx_percentile function.
AggFuncApproxPercentile = "approx_percentile"
)

// AggregateFuncExpr represents aggregate function expression.
Expand Down
4 changes: 3 additions & 1 deletion misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ var tokenMap = map[string]int{
"ANALYZE": analyze,
"AND": and,
"ANY": any,
"APPROX_COUNT_DISTINCT": approxCountDistinct,
"APPROX_PERCENTILE": approxPercentile,
"AS": as,
"ASC": asc,
"ASCII": ascii,
Expand Down Expand Up @@ -234,7 +236,6 @@ var tokenMap = map[string]int{
"CONVERT": convert,
"COPY": copyKwd,
"CORRELATION": correlation,
"APPROX_COUNT_DISTINCT": approxCountDistinct,
"CPU": cpu,
"CREATE": create,
"CROSS": cross,
Expand Down Expand Up @@ -755,6 +756,7 @@ var btFuncTokenMap = map[string]int{
"CAST": builtinCast,
"COUNT": builtinCount,
"APPROX_COUNT_DISTINCT": builtinApproxCountDistinct,
"APPROX_PERCENTILE": builtinApproxPercentile,
"CURDATE": builtinCurDate,
"CURTIME": builtinCurTime,
"DATE_ADD": builtinDateAdd,
Expand Down
Loading

0 comments on commit 39e9c7b

Please sign in to comment.