|
18 | 18 | import org.elasticsearch.xpack.sql.parser.SqlBaseParser.GroupByContext; |
19 | 19 | import org.elasticsearch.xpack.sql.parser.SqlBaseParser.JoinCriteriaContext; |
20 | 20 | import org.elasticsearch.xpack.sql.parser.SqlBaseParser.JoinRelationContext; |
21 | | -import org.elasticsearch.xpack.sql.parser.SqlBaseParser.JoinTypeContext; |
22 | 21 | import org.elasticsearch.xpack.sql.parser.SqlBaseParser.LimitClauseContext; |
23 | 22 | import org.elasticsearch.xpack.sql.parser.SqlBaseParser.NamedQueryContext; |
24 | 23 | import org.elasticsearch.xpack.sql.parser.SqlBaseParser.QueryContext; |
|
33 | 32 | import org.elasticsearch.xpack.sql.plan.logical.Distinct; |
34 | 33 | import org.elasticsearch.xpack.sql.plan.logical.Filter; |
35 | 34 | import org.elasticsearch.xpack.sql.plan.logical.Join; |
36 | | -import org.elasticsearch.xpack.sql.plan.logical.Join.JoinType; |
37 | 35 | import org.elasticsearch.xpack.sql.plan.logical.Limit; |
38 | 36 | import org.elasticsearch.xpack.sql.plan.logical.LocalRelation; |
39 | 37 | import org.elasticsearch.xpack.sql.plan.logical.LogicalPlan; |
@@ -168,41 +166,20 @@ public LogicalPlan visitRelation(RelationContext ctx) { |
168 | 166 |
|
169 | 167 | LogicalPlan result = plan(ctx.relationPrimary()); |
170 | 168 | for (JoinRelationContext j : ctx.joinRelation()) { |
171 | | - result = doJoin(result, j); |
| 169 | + result = doJoin(j); |
172 | 170 | } |
173 | 171 |
|
174 | 172 | return result; |
175 | 173 | } |
176 | 174 |
|
177 | | - private Join doJoin(LogicalPlan left, JoinRelationContext ctx) { |
178 | | - JoinTypeContext joinType = ctx.joinType(); |
| 175 | + private Join doJoin(JoinRelationContext ctx) { |
179 | 176 |
|
180 | | - @SuppressWarnings("unused") |
181 | | - Join.JoinType type = JoinType.INNER; |
182 | | - if (joinType != null) { |
183 | | - if (joinType.FULL() != null) { |
184 | | - type = JoinType.FULL; |
185 | | - } |
186 | | - if (joinType.LEFT() != null) { |
187 | | - type = JoinType.LEFT; |
188 | | - } |
189 | | - if (joinType.RIGHT() != null) { |
190 | | - type = JoinType.RIGHT; |
191 | | - } |
192 | | - } |
193 | | - |
194 | | - @SuppressWarnings("unused") |
195 | | - Expression condition = null; |
196 | 177 | JoinCriteriaContext criteria = ctx.joinCriteria(); |
197 | 178 | if (criteria != null) { |
198 | 179 | if (criteria.USING() != null) { |
199 | 180 | throw new UnsupportedOperationException(); |
200 | 181 | } |
201 | | - if (criteria.booleanExpression() != null) { |
202 | | - condition = expression(criteria.booleanExpression()); |
203 | | - } |
204 | 182 | } |
205 | | - |
206 | 183 | // We would return this if we actually supported JOINs, but we don't yet. |
207 | 184 | // new Join(source(ctx), left, plan(ctx.right), type, condition); |
208 | 185 | throw new ParsingException(source(ctx), "Queries with JOIN are not yet supported"); |
|
0 commit comments