提交 39882408 authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Add MEDIAN to help.csv and update initial capacity of Aggregate.AGGREGATES

上级 13796c1a
...@@ -498,7 +498,7 @@ qualified class name. The class must implement the interface ...@@ -498,7 +498,7 @@ qualified class name. The class must implement the interface
Admin rights are required to execute this command. Admin rights are required to execute this command.
This command commits an open transaction in this connection. This command commits an open transaction in this connection.
"," ","
CREATE AGGREGATE MEDIAN FOR ""com.acme.db.Median"" CREATE AGGREGATE SIMPLE_MEDIAN FOR ""com.acme.db.Median""
" "
"Commands (DDL)","CREATE ALIAS"," "Commands (DDL)","CREATE ALIAS","
...@@ -821,7 +821,7 @@ Drops an existing user-defined aggregate function. ...@@ -821,7 +821,7 @@ Drops an existing user-defined aggregate function.
Admin rights are required to execute this command. Admin rights are required to execute this command.
This command commits an open transaction in this connection. This command commits an open transaction in this connection.
"," ","
DROP AGGREGATE MEDIAN DROP AGGREGATE SIMPLE_MEDIAN
" "
"Commands (DDL)","DROP ALIAS"," "Commands (DDL)","DROP ALIAS","
...@@ -2801,6 +2801,19 @@ Aggregates are only allowed in select statements. ...@@ -2801,6 +2801,19 @@ Aggregates are only allowed in select statements.
VAR_SAMP(X) VAR_SAMP(X)
" "
"Functions (Aggregate)","MEDIAN","
MEDIAN( [ DISTINCT ] value )
","
The value separating the higher half of a values from the lower half.
Returns the middle value or an interpolated value between two middle values if number of values is even.
Interpolation is only supported for numeric, date, and time data types.
NULL values are ignored in the calculation.
If no rows are selected, the result is NULL.
Aggregates are only allowed in select statements.
","
MEDIAN(X)
"
"Functions (Numeric)","ABS"," "Functions (Numeric)","ABS","
ABS ( { numeric } ) ABS ( { numeric } )
"," ","
......
...@@ -131,7 +131,7 @@ public class Aggregate extends Expression { ...@@ -131,7 +131,7 @@ public class Aggregate extends Expression {
MEDIAN MEDIAN
} }
private static final HashMap<String, AggregateType> AGGREGATES = new HashMap<>(24); private static final HashMap<String, AggregateType> AGGREGATES = new HashMap<>(25);
private final AggregateType type; private final AggregateType type;
private final Select select; private final Select select;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论