Class CalcitePrepareImpl
- All Implemented Interfaces:
- CalcitePrepare
This class is public so that projects that create their own JDBC driver and server can fine-tune preferences. However, this class and its methods are subject to change without notice.
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classHolds state for the process of preparing a SQL statement.Nested classes/interfaces inherited from interface org.apache.calcite.jdbc.CalcitePrepareCalcitePrepare.AnalyzeViewResult, CalcitePrepare.CalciteSignature<T>, CalcitePrepare.Context, CalcitePrepare.ConvertResult, CalcitePrepare.Dummy, CalcitePrepare.ParseResult, CalcitePrepare.Query<T>, CalcitePrepare.SparkHandler
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final booleanDeprecated.static final booleanDeprecated.final booleanWhether the bindable convention should be the root convention of any plan.static final List<RelOptRule>Deprecated.Fields inherited from interface org.apache.calcite.jdbc.CalcitePrepareDEFAULT_FACTORY, THREAD_CONTEXT_STACK
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionanalyzeView(CalcitePrepare.Context context, String sql, boolean fail) Analyzes a view.convert(CalcitePrepare.Context context, String sql) protected RelOptClustercreateCluster(RelOptPlanner planner, RexBuilder rexBuilder) Factory method for cluster.protected SqlRexConvertletTableFactory method for default convertlet table.protected SqlParsercreateParser(String sql) Factory method for default SQL parser.protected SqlParsercreateParser(String sql, SqlParser.Config parserConfig) Factory method for SQL parser with a given configuration.protected SqlParsercreateParser(String sql, SqlParser.ConfigBuilder parserConfig) Deprecated.protected SqlParser.ConfigBuilderDeprecated.protected RelOptPlannercreatePlanner(CalcitePrepare.Context prepareContext) Creates a query planner and initializes it with a default set of rules.protected RelOptPlannercreatePlanner(CalcitePrepare.Context prepareContext, @Nullable Context externalContext, @Nullable RelOptCostFactory costFactory) Creates a query planner and initializes it with a default set of rules.protected List<Function1<CalcitePrepare.Context,RelOptPlanner>> Creates a collection of planner factories.voidexecuteDdl(CalcitePrepare.Context context, SqlNode node) Executes a DDL statement.protected CalcitePrepareImpl.CalcitePreparingStmtgetPreparingStmt(CalcitePrepare.Context context, Type elementType, CalciteCatalogReader catalogReader, RelOptPlanner planner) Returns CalcitePreparingStmtparse(CalcitePrepare.Context context, String sql) protected SqlParser.ConfigFactory method for SQL parser configuration.<R> Rperform(CalciteServerStatement statement, FrameworkConfig config, Frameworks.BasePrepareAction<R> action) Executes a prepare action.<R> Rperform(CalciteServerStatement statement, Frameworks.PrepareAction<R> action) Deprecated.protected voidpopulateMaterializations(CalcitePrepare.Context context, RelOptCluster cluster, Prepare.Materialization materialization) prepareQueryable(CalcitePrepare.Context context, Queryable<T> queryable) prepareSql(CalcitePrepare.Context context, CalcitePrepare.Query<T> query, Type elementType, long maxRowCount) 
- 
Field Details- 
ENABLE_ENUMERABLEDeprecated.
- 
ENABLE_STREAMDeprecated.
- 
ENUMERABLE_RULESDeprecated.
- 
enableBindablepublic final boolean enableBindableWhether the bindable convention should be the root convention of any plan. If not, enumerable convention is the default.
 
- 
- 
Constructor Details- 
CalcitePrepareImplpublic CalcitePrepareImpl()
 
- 
- 
Method Details- 
parse- Specified by:
- parsein interface- CalcitePrepare
 
- 
convert- Specified by:
- convertin interface- CalcitePrepare
 
- 
analyzeViewpublic CalcitePrepare.AnalyzeViewResult analyzeView(CalcitePrepare.Context context, String sql, boolean fail) Description copied from interface:CalcitePrepareAnalyzes a view.- Specified by:
- analyzeViewin interface- CalcitePrepare
- Parameters:
- context- Context
- sql- View SQL
- fail- Whether to fail (and throw a descriptive error message) if the view is not modifiable
- Returns:
- Result of analyzing the view
 
- 
executeDdlDescription copied from interface:CalcitePrepareExecutes a DDL statement.The statement identified itself as DDL in the CalcitePrepare.ParseResult.kind()field.- Specified by:
- executeDdlin interface- CalcitePrepare
 
- 
createParserFactory method for default SQL parser.
- 
createParserFactory method for SQL parser with a given configuration.
- 
createParserDeprecated.
- 
parserConfigFactory method for SQL parser configuration.
- 
createParserConfigDeprecated.
- 
createConvertletTableFactory method for default convertlet table.
- 
createClusterFactory method for cluster.
- 
createPlannerFactoriesCreates a collection of planner factories.The collection must have at least one factory, and each factory must create a planner. If the collection has more than one planner, Calcite will try each planner in turn. One of the things you can do with this mechanism is to try a simpler, faster, planner with a smaller rule set first, then fall back to a more complex planner for complex and costly queries. The default implementation returns a factory that calls createPlanner(org.apache.calcite.jdbc.CalcitePrepare.Context).
- 
createPlannerCreates a query planner and initializes it with a default set of rules.
- 
createPlannerprotected RelOptPlanner createPlanner(CalcitePrepare.Context prepareContext, @Nullable Context externalContext, @Nullable RelOptCostFactory costFactory) Creates a query planner and initializes it with a default set of rules.
- 
prepareQueryablepublic <T> CalcitePrepare.CalciteSignature<T> prepareQueryable(CalcitePrepare.Context context, Queryable<T> queryable) - Specified by:
- prepareQueryablein interface- CalcitePrepare
 
- 
prepareSqlpublic <T> CalcitePrepare.CalciteSignature<T> prepareSql(CalcitePrepare.Context context, CalcitePrepare.Query<T> query, Type elementType, long maxRowCount) - Specified by:
- prepareSqlin interface- CalcitePrepare
 
- 
getPreparingStmtprotected CalcitePrepareImpl.CalcitePreparingStmt getPreparingStmt(CalcitePrepare.Context context, Type elementType, CalciteCatalogReader catalogReader, RelOptPlanner planner) Returns CalcitePreparingStmtOverride this function to return a custom CalcitePrepareImpl.CalcitePreparingStmtandcreateSqlValidator(org.apache.calcite.jdbc.CalcitePrepare.Context, org.apache.calcite.prepare.CalciteCatalogReader, java.util.function.UnaryOperator<org.apache.calcite.sql.validate.SqlValidator.Config>)to enable custom validation logic.
- 
populateMaterializationsprotected void populateMaterializations(CalcitePrepare.Context context, RelOptCluster cluster, Prepare.Materialization materialization) 
- 
perform@Deprecated public <R> R perform(CalciteServerStatement statement, Frameworks.PrepareAction<R> action) Deprecated.
- 
performpublic <R> R perform(CalciteServerStatement statement, FrameworkConfig config, Frameworks.BasePrepareAction<R> action) Executes a prepare action.
 
-