NewJoin creates Join
(location *NodeLocation, joinType JoinType, left, right IRelation, criteria IJoinCriteria)
| 64 | |
| 65 | // NewJoin creates Join |
| 66 | func NewJoin(location *NodeLocation, joinType JoinType, left, right IRelation, criteria IJoinCriteria) *Join { |
| 67 | errMsg := fmt.Sprintf("left is null at (line:%d, col:%d)", location.Line, location.CharPosition) |
| 68 | util.RequireNonNull(left, errMsg) |
| 69 | errMsg = fmt.Sprintf("right is null at (line:%d, col:%d)", location.Line, location.CharPosition) |
| 70 | util.RequireNonNull(right, errMsg) |
| 71 | |
| 72 | if joinType != LEFT { |
| 73 | panic(fmt.Errorf("only support left join at (line:%d, col:%d)", location.Line, location.CharPosition)) |
| 74 | } |
| 75 | |
| 76 | return &Join{ |
| 77 | NewRelation(location), |
| 78 | joinType, |
| 79 | left, |
| 80 | right, |
| 81 | criteria, |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | // Accept accepts visitor |
| 86 | func (e *Join) Accept(visitor AstVisitor, ctx interface{}) interface{} { |
no test coverage detected