From 6bc00c65350f465d3367c2fa45e9fdbc8b7a6a14 Mon Sep 17 00:00:00 2001 From: Jon Bratseth Date: Mon, 29 Mar 2021 11:04:45 +0200 Subject: Remove unsupported constructs --- .../src/main/antlr4/com/yahoo/search/yql/yqlplus.g4 | 15 --------------- .../src/main/java/com/yahoo/search/yql/ProgramParser.java | 8 +++----- 2 files changed, 3 insertions(+), 20 deletions(-) (limited to 'container-search') diff --git a/container-search/src/main/antlr4/com/yahoo/search/yql/yqlplus.g4 b/container-search/src/main/antlr4/com/yahoo/search/yql/yqlplus.g4 index b3bb7a3a6bb..ab3537ab4b9 100644 --- a/container-search/src/main/antlr4/com/yahoo/search/yql/yqlplus.g4 +++ b/container-search/src/main/antlr4/com/yahoo/search/yql/yqlplus.g4 @@ -341,21 +341,6 @@ argument[boolean in_select] : expression[$in_select] ; -// -------- join expressions ------------ - -// Limit expression syntax for joins: A single equality test and one field from each source. -// This means it can always turn the join into a query to one source, collecting all of the -// keys from the results, and then a query to the other source (or querying the other source inline). -// Does not support map or index references. - -joinExpression - : joinDereferencedExpression EQ joinDereferencedExpression - ; - -joinDereferencedExpression - : namespaced_name - ; - // --------- expressions ------------ expression [boolean select] diff --git a/container-search/src/main/java/com/yahoo/search/yql/ProgramParser.java b/container-search/src/main/java/com/yahoo/search/yql/ProgramParser.java index 1e17bedc88f..8f7e1d248cc 100644 --- a/container-search/src/main/java/com/yahoo/search/yql/ProgramParser.java +++ b/container-search/src/main/java/com/yahoo/search/yql/ProgramParser.java @@ -339,8 +339,8 @@ final class ProgramParser { Preconditions.checkArgument(node instanceof Select_statementContext || node instanceof Insert_statementContext || node instanceof Update_statementContext || node instanceof Delete_statementContext); - // SELECT^ select_field_spec select_source where? orderby? limit? offset? timeout? - // select is the only place to define where/orderby/limit/offset and joins + // SELECT^ select_field_spec select_source where? orderby? limit? offset? timeout? + // select is the only place to define where/orderby/limit/offset Scope scope = scopeParent.child(); ProjectionBuilder proj = null; OperatorNode source = null; @@ -364,7 +364,6 @@ final class ProgramParser { switch (getParseTreeIndex(sourceNode)) { // ALL_SOURCE and MULTI_SOURCE are how FROM SOURCES // *|source_name,... are parsed - // They can't be used directly with the JOIN syntax at this time case yqlplusParser.RULE_select_source_all: { Location location = toLocation(scope, sourceNode.getChild(2)); source = OperatorNode.create(location, SequenceOperator.ALL); @@ -1068,8 +1067,7 @@ final class ProgramParser { throw new ProgramCompileException(toLocation(scope, parseTree),"Unknown child count " + parseTree.getChildCount() + " of " + parseTree.getText()); } } - case yqlplusParser.RULE_fieldref: - case yqlplusParser.RULE_joinDereferencedExpression: { + case yqlplusParser.RULE_fieldref: { // all in-scope data sources should be defined in scope // the 'first' field in a namespaced reference must be: // - a field name if (and only if) there is exactly one data source -- cgit v1.2.3