forked from sqlancer/sqlancer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathYSQLJoin.java
More file actions
56 lines (43 loc) · 1.39 KB
/
YSQLJoin.java
File metadata and controls
56 lines (43 loc) · 1.39 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package sqlancer.yugabyte.ysql.ast;
import sqlancer.Randomly;
import sqlancer.common.ast.newast.Join;
import sqlancer.yugabyte.ysql.YSQLSchema.YSQLColumn;
import sqlancer.yugabyte.ysql.YSQLSchema.YSQLDataType;
import sqlancer.yugabyte.ysql.YSQLSchema.YSQLTable;
public class YSQLJoin implements YSQLExpression, Join<YSQLExpression, YSQLTable, YSQLColumn> {
private final YSQLExpression tableReference;
private YSQLExpression onClause;
private final YSQLJoinType type;
public YSQLJoin(YSQLExpression tableReference, YSQLExpression onClause, YSQLJoinType type) {
this.tableReference = tableReference;
this.onClause = onClause;
this.type = type;
}
public YSQLExpression getTableReference() {
return tableReference;
}
public YSQLExpression getOnClause() {
return onClause;
}
public YSQLJoinType getType() {
return type;
}
@Override
public YSQLDataType getExpressionType() {
throw new AssertionError();
}
@Override
public YSQLConstant getExpectedValue() {
throw new AssertionError();
}
public enum YSQLJoinType {
INNER, LEFT, RIGHT, FULL, CROSS;
public static YSQLJoinType getRandom() {
return Randomly.fromOptions(values());
}
}
@Override
public void setOnClause(YSQLExpression onClause) {
this.onClause = onClause;
}
}