Class SqlQueryPlus
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.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic SqlQueryPlus.Builderbuilder()static SqlQueryPlus.Buildercontext()Returns a copy of this instance where everything is shared, except thesqlNode, which is re-parsed from the SQL statement.List<org.apache.calcite.avatica.remote.TypedValue>sql()org.apache.calcite.sql.SqlNodesqlNode()Convert parameters list to serde friendlySqlParametertoString()withParameters(List<org.apache.calcite.avatica.remote.TypedValue> parameters)
-
Method Details
-
builder
-
builder
-
sql
-
sqlNode
public org.apache.calcite.sql.SqlNode sqlNode() -
context
-
authContextKeys
-
parameters
-
sqlParameters
Convert parameters list to serde friendlySqlParameter -
authResult
-
withContext
-
withParameters
-
freshCopy
Returns a copy of this instance where everything is shared, except thesqlNode, which is re-parsed from the SQL statement. -
toString
-