Class Configuration
java.lang.Object
org.elasticsearch.xpack.esql.session.Configuration
- All Implemented Interfaces:
Writeable
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TransportVersionTransport version for view queries support.static final int -
Constructor Summary
ConstructorsConstructorDescriptionConfiguration(ZoneId zi, Instant now, Locale locale, String username, String clusterName, QueryPragmas pragmas, int resultTruncationMaxSizeRegular, int resultTruncationDefaultSizeRegular, String query, boolean profile, Map<String, Map<String, Column>> tables, long queryStartTimeNanos, boolean allowPartialResults, int resultTruncationMaxSizeTimeseries, int resultTruncationDefaultSizeTimeseries, String projectRouting, ApproximationSettings approximationSettings, Map<String, String> viewQueries) Configuration(ZoneId zi, Instant now, Locale locale, String username, String clusterName, QueryPragmas pragmas, int resultTruncationMaxSizeRegular, int resultTruncationDefaultSizeRegular, String query, boolean profile, Map<String, Map<String, Column>> tables, long queryStartTimeNanos, boolean allowPartialResults, int resultTruncationMaxSizeTimeseries, int resultTruncationDefaultSizeTimeseries, String projectRouting, ApproximationSettings approximationSettings, Map<String, String> viewQueries, boolean explainOnly) -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the current time in milliseconds from the time epoch for the execution of this request.booleanWhether this request can return partial results instead of failing fast on failuresbooleanbooleanWhether this is an explain-only request.inthashCode()locale()Create a newFoldContextwith the limit configured in theQueryPragmas.now()pragmas()booleanprofile()Enable profiling, sacrificing performance to return information about what operations are taking the most time.query()longstatic ConfigurationReads aConfigurationthat doesn't contain anytables().intresultTruncationDefaultSize(boolean isTimeseries) intresultTruncationMaxSize(boolean isTimeseries) tables()Tables specified in the request.toString()username()Returns the map of view names to their query strings.Returns a new Configuration with profile and explainOnly enabled.withViewQueries(Map<String, String> viewQueries) Returns a new Configuration with the given view queries added.voidwriteTo(StreamOutput out) zoneId()
-
Field Details
-
QUERY_COMPRESS_THRESHOLD_CHARS
public static final int QUERY_COMPRESS_THRESHOLD_CHARS -
ESQL_VIEW_QUERIES
Transport version for view queries support. This is needed to correctly serialize/deserialize Source objects that originated from views (which have positions relative to the view query, not the main query).
-
-
Constructor Details
-
Configuration
public Configuration(ZoneId zi, Instant now, Locale locale, String username, String clusterName, QueryPragmas pragmas, int resultTruncationMaxSizeRegular, int resultTruncationDefaultSizeRegular, @Nullable String query, boolean profile, Map<String, Map<String, Column>> tables, long queryStartTimeNanos, boolean allowPartialResults, int resultTruncationMaxSizeTimeseries, int resultTruncationDefaultSizeTimeseries, String projectRouting, ApproximationSettings approximationSettings, Map<String, String> viewQueries) -
Configuration
- Throws:
IOException
-
Configuration
public Configuration(ZoneId zi, Instant now, Locale locale, String username, String clusterName, QueryPragmas pragmas, int resultTruncationMaxSizeRegular, int resultTruncationDefaultSizeRegular, @Nullable String query, boolean profile, Map<String, Map<String, Column>> tables, long queryStartTimeNanos, boolean allowPartialResults, int resultTruncationMaxSizeTimeseries, int resultTruncationDefaultSizeTimeseries, String projectRouting, ApproximationSettings approximationSettings, Map<String, String> viewQueries, boolean explainOnly)
-
-
Method Details
-
writeTo
- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
zoneId
-
now
-
clusterName
-
username
-
pragmas
-
resultTruncationMaxSize
public int resultTruncationMaxSize(boolean isTimeseries) -
resultTruncationDefaultSize
public int resultTruncationDefaultSize(boolean isTimeseries) -
locale
-
query
-
absoluteStartedTimeInMillis
public long absoluteStartedTimeInMillis()Returns the current time in milliseconds from the time epoch for the execution of this request. It ensures consistency by using the same value on all nodes involved in the search request. -
queryStartTimeNanos
public long queryStartTimeNanos()- Returns:
- Start time of the ESQL query in nanos
-
newFoldContext
Create a newFoldContextwith the limit configured in theQueryPragmas. -
tables
Tables specified in the request. -
withoutTables
-
profile
public boolean profile()Enable profiling, sacrificing performance to return information about what operations are taking the most time. -
allowPartialResults
public boolean allowPartialResults()Whether this request can return partial results instead of failing fast on failures -
explainOnly
public boolean explainOnly()Whether this is an explain-only request. This flag is propagated to data nodes and could be used for future optimization to skip actual computation. Currently, the EXPLAIN command executes the query normally with profile=true. -
withExplainOnly
Returns a new Configuration with profile and explainOnly enabled. Used for EXPLAIN queries that need to capture plan information. -
projectRouting
-
approximationSettings
-
viewQueries
Returns the map of view names to their query strings. -
withViewQueries
Returns a new Configuration with the given view queries added. -
equals
-
hashCode
public int hashCode() -
toString
-
readWithoutTables
Reads aConfigurationthat doesn't contain anytables().- Throws:
IOException
-