public class CalcitePrepareImpl extends Object implements 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.
CalcitePrepare.AnalyzeViewResult, CalcitePrepare.CalciteSignature<T>, CalcitePrepare.Context, CalcitePrepare.ConvertResult, CalcitePrepare.Dummy, CalcitePrepare.ParseResult, CalcitePrepare.Query<T>, CalcitePrepare.SparkHandler| Modifier and Type | Field and Description |
|---|---|
static boolean |
ENABLE_ENUMERABLE
Deprecated.
|
static boolean |
ENABLE_STREAM
Deprecated.
|
boolean |
enableBindable
Whether the bindable convention should be the root convention of any
plan.
|
static List<RelOptRule> |
ENUMERABLE_RULES
Deprecated.
|
DEFAULT_FACTORY, THREAD_CONTEXT_STACK| Constructor and Description |
|---|
CalcitePrepareImpl() |
| Modifier and Type | Method and Description |
|---|---|
CalcitePrepare.AnalyzeViewResult |
analyzeView(CalcitePrepare.Context context,
String sql,
boolean fail)
Analyzes a view.
|
CalcitePrepare.ConvertResult |
convert(CalcitePrepare.Context context,
String sql) |
protected RelOptCluster |
createCluster(RelOptPlanner planner,
RexBuilder rexBuilder)
Factory method for cluster.
|
protected SqlRexConvertletTable |
createConvertletTable()
Factory method for default convertlet table.
|
protected SqlParser |
createParser(String sql)
Factory method for default SQL parser.
|
protected SqlParser |
createParser(String sql,
SqlParser.Config parserConfig)
Factory method for SQL parser with a given configuration.
|
protected SqlParser |
createParser(String sql,
SqlParser.ConfigBuilder parserConfig)
Deprecated.
|
protected SqlParser.ConfigBuilder |
createParserConfig()
Deprecated.
|
protected RelOptPlanner |
createPlanner(CalcitePrepare.Context prepareContext)
Creates a query planner and initializes it with a default set of
rules.
|
protected RelOptPlanner |
createPlanner(CalcitePrepare.Context prepareContext,
Context externalContext,
@Nullable RelOptCostFactory costFactory)
Creates a query planner and initializes it with a default set of
rules.
|
protected List<org.apache.calcite.linq4j.function.Function1<CalcitePrepare.Context,RelOptPlanner>> |
createPlannerFactories()
Creates a collection of planner factories.
|
void |
executeDdl(CalcitePrepare.Context context,
SqlNode node)
Executes a DDL statement.
|
CalcitePrepare.ParseResult |
parse(CalcitePrepare.Context context,
String sql) |
protected SqlParser.Config |
parserConfig()
Factory method for SQL parser configuration.
|
<R> R |
perform(CalciteServerStatement statement,
FrameworkConfig config,
Frameworks.BasePrepareAction<R> action)
Executes a prepare action.
|
<R> R |
perform(CalciteServerStatement statement,
Frameworks.PrepareAction<R> action)
Deprecated.
|
protected void |
populateMaterializations(CalcitePrepare.Context context,
RelOptCluster cluster,
Prepare.Materialization materialization) |
<T> CalcitePrepare.CalciteSignature<T> |
prepareQueryable(CalcitePrepare.Context context,
org.apache.calcite.linq4j.Queryable<T> queryable) |
<T> CalcitePrepare.CalciteSignature<T> |
prepareSql(CalcitePrepare.Context context,
CalcitePrepare.Query<T> query,
Type elementType,
long maxRowCount) |
@Deprecated public static final boolean ENABLE_ENUMERABLE
@Deprecated public static final boolean ENABLE_STREAM
@Deprecated public static final List<RelOptRule> ENUMERABLE_RULES
public final boolean enableBindable
public CalcitePrepare.ParseResult parse(CalcitePrepare.Context context, String sql)
parse in interface CalcitePreparepublic CalcitePrepare.ConvertResult convert(CalcitePrepare.Context context, String sql)
convert in interface CalcitePreparepublic CalcitePrepare.AnalyzeViewResult analyzeView(CalcitePrepare.Context context, String sql, boolean fail)
CalcitePrepareanalyzeView in interface CalcitePreparecontext - Contextsql - View SQLfail - Whether to fail (and throw a descriptive error message) if the
view is not modifiablepublic void executeDdl(CalcitePrepare.Context context, SqlNode node)
CalcitePrepareThe statement identified itself as DDL in the
CalcitePrepare.ParseResult.kind() field.
executeDdl in interface CalcitePrepareprotected SqlParser createParser(String sql, SqlParser.Config parserConfig)
@Deprecated protected SqlParser createParser(String sql, SqlParser.ConfigBuilder parserConfig)
protected SqlParser.Config parserConfig()
@Deprecated protected SqlParser.ConfigBuilder createParserConfig()
protected SqlRexConvertletTable createConvertletTable()
protected RelOptCluster createCluster(RelOptPlanner planner, RexBuilder rexBuilder)
protected List<org.apache.calcite.linq4j.function.Function1<CalcitePrepare.Context,RelOptPlanner>> createPlannerFactories()
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).
protected RelOptPlanner createPlanner(CalcitePrepare.Context prepareContext)
protected RelOptPlanner createPlanner(CalcitePrepare.Context prepareContext, Context externalContext, @Nullable RelOptCostFactory costFactory)
public <T> CalcitePrepare.CalciteSignature<T> prepareQueryable(CalcitePrepare.Context context, org.apache.calcite.linq4j.Queryable<T> queryable)
prepareQueryable in interface CalcitePreparepublic <T> CalcitePrepare.CalciteSignature<T> prepareSql(CalcitePrepare.Context context, CalcitePrepare.Query<T> query, Type elementType, long maxRowCount)
prepareSql in interface CalcitePrepareprotected void populateMaterializations(CalcitePrepare.Context context, RelOptCluster cluster, Prepare.Materialization materialization)
@Deprecated public <R> R perform(CalciteServerStatement statement, Frameworks.PrepareAction<R> action)
public <R> R perform(CalciteServerStatement statement, FrameworkConfig config, Frameworks.BasePrepareAction<R> action)
Copyright © 2012-2022 Apache Software Foundation. All Rights Reserved.