Package org.apache.druid.sql
Class SqlQueryPlus.Builder
java.lang.Object
org.apache.druid.sql.SqlQueryPlus.Builder
- Enclosing class:
- SqlQueryPlus
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionauth(AuthenticationResult authResult) build()Parses the providedsqland builds aSqlQueryPluswith SET statements folded into the context, and with the parsed SQL inSqlQueryPlus.sqlNode.parameters(List<org.apache.calcite.avatica.remote.TypedValue> parameters) queryContext(Map<String, Object> queryContext) Sets the user-provided query context.sqlParameters(List<SqlParameter> parameters) systemDefaultContext(Map<String, Object> systemDefaultContext) Sets the system-wide default contexts.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
sql
-
systemDefaultContext
Sets the system-wide default contexts. This context is used to fill in missing values and doesn't go thorough authorization check. -
queryContext
Sets the user-provided query context. This context is used for authorization checks. -
parameters
public SqlQueryPlus.Builder parameters(List<org.apache.calcite.avatica.remote.TypedValue> parameters) -
sqlParameters
-
auth
-
build
Parses the providedsqland builds aSqlQueryPluswith SET statements folded into the context, and with the parsed SQL inSqlQueryPlus.sqlNode.When using this method, the
SqlQueryPlus.sqlNode()must only be run through validation once. (The validator mutates theSqlNode). -
buildJdbc
Builds aSqlQueryPluswith noSqlNodeand withSqlQueryPlus.allowSetStatementsset to false. This is done for JDBC becauase it can runs eachSqlQueryPlusmultiple times, and it needs to keep re-parsing and re-validating the query on each run.When using this method, you must create a copy with
SqlQueryPlus.freshCopy()prior to callingSqlQueryPlus.sqlNode().
-