Skip to content

Commit

Permalink
Change to field name pattern, trying to get UnresolvedAttribute from it
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosdelest committed Aug 7, 2024
1 parent b57b046 commit 15d96c1
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
4 changes: 2 additions & 2 deletions x-pack/plugin/esql/src/main/antlr/EsqlBaseParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ parsedMatchQuery
;

queryStringFields
: fieldName=UNQUOTED_IDENTIFIER COLON queryStringNoFields
: fieldName=qualifiedNamePattern COLON queryStringNoFields
;

queryStringNoFields
Expand All @@ -329,5 +329,5 @@ fieldQueryStringExpression

// TODO Define a lexer rule for query terms and fields - probably we can't tell each other apart
queryStringTerm
: UNQUOTED_IDENTIFIER
: qualifiedNamePattern
;

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.antlr.v4.runtime.Token;
import org.antlr.v4.runtime.tree.ParseTree;
import org.elasticsearch.Build;
import org.elasticsearch.common.Strings;
import org.elasticsearch.core.Tuple;
import org.elasticsearch.dissect.DissectException;
import org.elasticsearch.dissect.DissectParser;
Expand Down Expand Up @@ -378,7 +379,8 @@ public StringQueryPredicate visitUnparsedMatchQuery(EsqlBaseParser.UnparsedMatch

@Override public StringQueryPredicate visitQueryStringFields(EsqlBaseParser.QueryStringFieldsContext ctx) {
Source source = source(ctx);
String fieldName = ctx.fieldName.getText();
// TODO HERE get qualified name and do something similar in Validator like MatchOperator
NamedExpression fieldName = visitQualifiedNamePattern(ctx.fieldName);
return new StringQueryPredicate(source, ctx.queryStringNoFields().getText(), "fields=" + fieldName);
}

Expand Down

0 comments on commit 15d96c1

Please sign in to comment.