Skip to content

Commit

Permalink
[parser] support new aggregation function stddev_pop and stddev_samp
Browse files Browse the repository at this point in the history
  • Loading branch information
zz-jason authored Nov 2, 2018
2 parents fbc63dc + 6c76230 commit 19c3ed6
Show file tree
Hide file tree
Showing 5 changed files with 5,140 additions and 5,066 deletions.
4 changes: 4 additions & 0 deletions parser/ast/functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,10 @@ const (
AggFuncBitXor = "bit_xor"
// AggFuncBitAnd is the name of bit_and function.
AggFuncBitAnd = "bit_and"
// AggFuncStddevPop is the name of stddev_pop function
AggFuncStddevPop = "stddev_pop"
// AggFuncStddevSamp is the name of stddev_samp function
AggFuncStddevSamp = "stddev_samp"
)

// AggregateFuncExpr represents aggregate function expression.
Expand Down
6 changes: 5 additions & 1 deletion parser/misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,10 @@ var tokenMap = map[string]int{
"STATS_META": statsMeta,
"STATS_PERSISTENT": statsPersistent,
"STATUS": status,
"STD": stddevPop,
"STDDEV": stddevPop,
"STDDEV_POP": stddevPop,
"STDDEV_SAMP": stddevSamp,
"STORED": stored,
"STRAIGHT_JOIN": straightJoin,
"SUBDATE": subDate,
Expand Down Expand Up @@ -541,7 +545,7 @@ var btFuncTokenMap = map[string]int{
"STD": builtinStddevPop,
"STDDEV": builtinStddevPop,
"STDDEV_POP": builtinStddevPop,
"STDDEV_SAMP": builtinVarSamp,
"STDDEV_SAMP": builtinStddevSamp,
"SUBDATE": builtinSubDate,
"SUBSTR": builtinSubstring,
"SUBSTRING": builtinSubstring,
Expand Down
Loading

0 comments on commit 19c3ed6

Please sign in to comment.