-
Notifications
You must be signed in to change notification settings - Fork 397
Expand file tree
/
Copy pathTiDBAggregate.java
More file actions
38 lines (27 loc) · 867 Bytes
/
TiDBAggregate.java
File metadata and controls
38 lines (27 loc) · 867 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package sqlancer.tidb.ast;
import java.util.List;
import sqlancer.Randomly;
import sqlancer.common.ast.FunctionNode;
import sqlancer.tidb.ast.TiDBAggregate.TiDBAggregateFunction;
public class TiDBAggregate extends FunctionNode<TiDBAggregateFunction, TiDBExpression> implements TiDBExpression {
public enum TiDBAggregateFunction {
COUNT(1), //
SUM(1), //
AVG(1), //
MIN(1), //
MAX(1);
private int nrArgs;
TiDBAggregateFunction(int nrArgs) {
this.nrArgs = nrArgs;
}
public static TiDBAggregateFunction getRandom() {
return Randomly.fromOptions(values());
}
public int getNrArgs() {
return nrArgs;
}
}
public TiDBAggregate(List<TiDBExpression> args, TiDBAggregateFunction func) {
super(func, args);
}
}