Package org.apache.calcite.sql2rel
Interface SqlToRelConverter.Config
-
- Enclosing class:
- SqlToRelConverter
@Immutable(singleton=false) public static interface SqlToRelConverter.Config
Interface to define the configuration for a SqlToRelConverter. Provides methods to set each configuration option.- See Also:
SqlToRelConverter.CONFIG
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default SqlToRelConverter.Config
addRelBuilderConfigTransform(UnaryOperator<RelBuilder.Config> transform)
Adds a transform togetRelBuilderConfigTransform()
.org.apache.calcite.rel.hint.HintStrategyTable
getHintStrategyTable()
Returns the hint strategies used to decide how the hints are propagated to the relational expressions.default int
getInSubQueryThreshold()
Returns theinSubQueryThreshold
option, defaultSqlToRelConverter.DEFAULT_IN_SUB_QUERY_THRESHOLD
.UnaryOperator<RelBuilder.Config>
getRelBuilderConfigTransform()
Returns a function that takes aRelBuilder.Config
and returns another.org.apache.calcite.tools.RelBuilderFactory
getRelBuilderFactory()
Returns the factory to createRelBuilder
, never null.default boolean
isAddJsonTypeOperatorEnabled()
Whether addSqlStdOperatorTable.JSON_TYPE_OPERATOR
for between json functions.default boolean
isCreateValuesRel()
Returns thecreateValuesRel
option.default boolean
isDecorrelationEnabled()
Returns thedecorrelationEnabled
option.default boolean
isExpand()
Returns theexpand
option.default boolean
isExplain()
Returns theexplain
option.default boolean
isRemoveSortInSubQuery()
Returns whether to remove Sort operator for a sub-query if the Sort has no offset and fetch limit attributes.default boolean
isTrimUnusedFields()
Returns thetrimUnusedFields
option.SqlToRelConverter.Config
withAddJsonTypeOperatorEnabled(boolean addJsonTypeOperatorEnabled)
SqlToRelConverter.Config
withCreateValuesRel(boolean createValuesRel)
SetsisCreateValuesRel()
.SqlToRelConverter.Config
withDecorrelationEnabled(boolean decorrelationEnabled)
SetsisDecorrelationEnabled()
.SqlToRelConverter.Config
withExpand(boolean expand)
SetsisExpand()
.SqlToRelConverter.Config
withExplain(boolean explain)
SetsisExplain()
.SqlToRelConverter.Config
withHintStrategyTable(org.apache.calcite.rel.hint.HintStrategyTable hintStrategyTable)
SetsgetHintStrategyTable()
.SqlToRelConverter.Config
withInSubQueryThreshold(int threshold)
SetsgetInSubQueryThreshold()
.SqlToRelConverter.Config
withRelBuilderConfigTransform(UnaryOperator<RelBuilder.Config> transform)
SqlToRelConverter.Config
withRelBuilderFactory(org.apache.calcite.tools.RelBuilderFactory factory)
SetsgetRelBuilderFactory()
.SqlToRelConverter.Config
withRemoveSortInSubQuery(boolean removeSortInSubQuery)
SetsisRemoveSortInSubQuery()
.SqlToRelConverter.Config
withTrimUnusedFields(boolean trimUnusedFields)
SetsisTrimUnusedFields()
.
-
-
-
Method Detail
-
isDecorrelationEnabled
@Default default boolean isDecorrelationEnabled()
Returns thedecorrelationEnabled
option. Controls whether to disable sub-query decorrelation when needed. e.g. if outer joins are not supported.
-
withDecorrelationEnabled
SqlToRelConverter.Config withDecorrelationEnabled(boolean decorrelationEnabled)
SetsisDecorrelationEnabled()
.
-
isTrimUnusedFields
@Default default boolean isTrimUnusedFields()
Returns thetrimUnusedFields
option. Controls whether to trim unused fields as part of the conversion process.
-
withTrimUnusedFields
SqlToRelConverter.Config withTrimUnusedFields(boolean trimUnusedFields)
SetsisTrimUnusedFields()
.
-
isCreateValuesRel
@Default default boolean isCreateValuesRel()
Returns thecreateValuesRel
option. Controls whether instances ofLogicalValues
are generated. These may not be supported by all physical implementations.
-
withCreateValuesRel
SqlToRelConverter.Config withCreateValuesRel(boolean createValuesRel)
SetsisCreateValuesRel()
.
-
isExplain
@Default default boolean isExplain()
Returns theexplain
option. Describes whether the current statement is part of an EXPLAIN PLAN statement.
-
withExplain
SqlToRelConverter.Config withExplain(boolean explain)
SetsisExplain()
.
-
isExpand
@Default default boolean isExpand()
Returns theexpand
option. Controls whether to expand sub-queries. If false (the default), each sub-query becomes aRexSubQuery
.Setting
expand
to true is deprecated. Expansion still works, but there will be less development effort in that area.
-
withExpand
SqlToRelConverter.Config withExpand(boolean expand)
SetsisExpand()
.Expansion is deprecated. We recommend that you do not call this method, and use the default value of
isExpand()
, false.
-
getInSubQueryThreshold
@Default default int getInSubQueryThreshold()
Returns theinSubQueryThreshold
option, defaultSqlToRelConverter.DEFAULT_IN_SUB_QUERY_THRESHOLD
. Controls the list size threshold under whichSqlToRelConverter.convertInToOr(org.apache.calcite.sql2rel.SqlToRelConverter.Blackboard, java.util.List<org.apache.calcite.rex.RexNode>, org.apache.calcite.sql.SqlNodeList, org.apache.calcite.sql.fun.SqlInOperator)
is used. Lists of this size or greater will instead be converted to use a join against an inline table (LogicalValues
) rather than a predicate. A threshold of 0 forces usage of an inline table in all cases; a threshold ofInteger.MAX_VALUE
forces usage of OR in all cases.
-
withInSubQueryThreshold
SqlToRelConverter.Config withInSubQueryThreshold(int threshold)
SetsgetInSubQueryThreshold()
.
-
isRemoveSortInSubQuery
@Default default boolean isRemoveSortInSubQuery()
Returns whether to remove Sort operator for a sub-query if the Sort has no offset and fetch limit attributes. Because the remove does not change the semantics, in many cases this is a promotion. Default is true.
-
withRemoveSortInSubQuery
SqlToRelConverter.Config withRemoveSortInSubQuery(boolean removeSortInSubQuery)
SetsisRemoveSortInSubQuery()
.
-
getRelBuilderFactory
org.apache.calcite.tools.RelBuilderFactory getRelBuilderFactory()
Returns the factory to createRelBuilder
, never null. Default isRelFactories.LOGICAL_BUILDER
.
-
withRelBuilderFactory
SqlToRelConverter.Config withRelBuilderFactory(org.apache.calcite.tools.RelBuilderFactory factory)
SetsgetRelBuilderFactory()
.
-
getRelBuilderConfigTransform
UnaryOperator<RelBuilder.Config> getRelBuilderConfigTransform()
Returns a function that takes aRelBuilder.Config
and returns another. Default is the identity function.
-
withRelBuilderConfigTransform
SqlToRelConverter.Config withRelBuilderConfigTransform(UnaryOperator<RelBuilder.Config> transform)
-
addRelBuilderConfigTransform
default SqlToRelConverter.Config addRelBuilderConfigTransform(UnaryOperator<RelBuilder.Config> transform)
Adds a transform togetRelBuilderConfigTransform()
.
-
getHintStrategyTable
org.apache.calcite.rel.hint.HintStrategyTable getHintStrategyTable()
Returns the hint strategies used to decide how the hints are propagated to the relational expressions. Default isHintStrategyTable.EMPTY
.
-
withHintStrategyTable
SqlToRelConverter.Config withHintStrategyTable(org.apache.calcite.rel.hint.HintStrategyTable hintStrategyTable)
SetsgetHintStrategyTable()
.
-
isAddJsonTypeOperatorEnabled
@Default default boolean isAddJsonTypeOperatorEnabled()
Whether addSqlStdOperatorTable.JSON_TYPE_OPERATOR
for between json functions.
-
withAddJsonTypeOperatorEnabled
SqlToRelConverter.Config withAddJsonTypeOperatorEnabled(boolean addJsonTypeOperatorEnabled)
-
-