forked from sqlancer/sqlancer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTiDBAggregate.java
More file actions
34 lines (23 loc) · 846 Bytes
/
TiDBAggregate.java
File metadata and controls
34 lines (23 loc) · 846 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
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 {
AVG(1), BIT_AND(1), BIT_OR(1), COUNT(1), SUM(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);
}
}