Class EsqlParser
java.lang.Object
org.elasticsearch.xpack.esql.parser.EsqlParser
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intMaximum number of characters in an ESQL query. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateStatement(String query) createStatement(String query, QueryParams params) parse(String query, QueryParams params, InferenceSettings inferenceSettings) Parses the given query into anEsqlStatement.parseQuery(String query) parseQuery(String query, QueryParams params) parseQuery(String query, QueryParams params, InferenceSettings inferenceSettings) parseView(String query, QueryParams params, SettingsValidationContext settingsValidationCtx, InferenceSettings inferenceSettings, String viewName) Parse a view query with the given view name.unvalidatedStatement(String query, QueryParams params)
-
Field Details
-
MAX_LENGTH
public static final int MAX_LENGTHMaximum number of characters in an ESQL query. Antlr may parse the entire query into tokens to make the choices, buffering the world. There's a lot we can do in the grammar to prevent that, but let's be paranoid and assume we'll fail at preventing antlr from slurping in the world. Instead, let's make sure that the world just isn't that big.- See Also:
-
-
Constructor Details
-
EsqlParser
-
-
Method Details
-
parseQuery
-
parseQuery
-
parseQuery
public LogicalPlan parseQuery(String query, QueryParams params, InferenceSettings inferenceSettings) -
createStatement
-
unvalidatedStatement
-
createStatement
-
parse
Parses the given query into anEsqlStatement. Note that query settings (accessible viaEsqlStatement.settings()) are not validated by this method — the caller is responsible for performing any necessary validation before using them. -
parseView
public EsqlStatement parseView(String query, QueryParams params, SettingsValidationContext settingsValidationCtx, InferenceSettings inferenceSettings, String viewName) Parse a view query with the given view name. The view name is used to tag all Source objects so they can be correctly deserialized when the view positions exceed the outer query's length.Unlike the top-level query, which is validated inside
EsqlQueryRequest.parse(org.elasticsearch.xpack.esql.parser.EsqlParser, org.elasticsearch.xpack.esql.plan.SettingsValidationContext, org.elasticsearch.xpack.esql.inference.InferenceSettings), view bodies are parsed inside a callback that has no request object — so settings validation is performed here, where theSettingsValidationContextis available, rather than at the call site.
-