Class SqlQueryPlus

java.lang.Object
org.apache.druid.sql.SqlQueryPlus

public class SqlQueryPlus extends Object
Captures the inputs to a SQL execution request: the statement (as a string), the parsed statement, the context, parameters, and the authorization result. The request can evolve: the context and parameters can be filled in later as needed.

SQL requests come from a variety of sources in a variety of formats. Use the SqlQueryPlus.Builder class to create an instance from the information available at each point in the code.

Each instance of SqlQueryPlus can only be used once, because sqlNode is a mutable data structure, modified during CalcitePlanner.validate(org.apache.calcite.sql.SqlNode). If you need to use one again, call freshCopy() to create a fresh copy with a new SqlNode.

The query context has a complex lifecycle. The copy here is immutable: it is the set of values which the user requested. Planning will add (and sometimes remove) values: that work should be done on a copy of the context so that we have a clean record of the user's original requested values. This original record is required to perform security on the set of user-provided context keys.