Package org.apache.calcite.sql2rel
Class SqlToRelConverter.ConfigImpl
- java.lang.Object
-
- org.apache.calcite.sql2rel.SqlToRelConverter.ConfigImpl
-
- All Implemented Interfaces:
SqlToRelConverter.Config
- Enclosing class:
- SqlToRelConverter
private static class SqlToRelConverter.ConfigImpl extends java.lang.Object implements SqlToRelConverter.Config
Implementation ofSqlToRelConverter.Config
. Called by builder; all values are in private final fields.
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
convertTableAccess
private boolean
createValuesRel
private boolean
decorrelationEnabled
private boolean
expand
private boolean
explain
private int
inSubQueryThreshold
private RelBuilderFactory
relBuilderFactory
private boolean
trimUnusedFields
-
Fields inherited from interface org.apache.calcite.sql2rel.SqlToRelConverter.Config
DEFAULT
-
-
Constructor Summary
Constructors Modifier Constructor Description private
ConfigImpl(boolean convertTableAccess, boolean decorrelationEnabled, boolean trimUnusedFields, boolean createValuesRel, boolean explain, boolean expand, int inSubQueryThreshold, RelBuilderFactory relBuilderFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getInSubQueryThreshold()
Returns theinSubQueryThreshold
option, defaultSqlToRelConverter.DEFAULT_IN_SUB_QUERY_THRESHOLD
.RelBuilderFactory
getRelBuilderFactory()
Returns the factory to createRelBuilder
, never null.boolean
isConvertTableAccess()
Returns theconvertTableAccess
option.boolean
isCreateValuesRel()
Returns thecreateValuesRel
option.boolean
isDecorrelationEnabled()
Returns thedecorrelationEnabled
option.boolean
isExpand()
Returns theexpand
option.boolean
isExplain()
Returns theexplain
option.boolean
isTrimUnusedFields()
Returns thetrimUnusedFields
option.
-
-
-
Field Detail
-
convertTableAccess
private final boolean convertTableAccess
-
decorrelationEnabled
private final boolean decorrelationEnabled
-
trimUnusedFields
private final boolean trimUnusedFields
-
createValuesRel
private final boolean createValuesRel
-
explain
private final boolean explain
-
expand
private final boolean expand
-
inSubQueryThreshold
private final int inSubQueryThreshold
-
relBuilderFactory
private final RelBuilderFactory relBuilderFactory
-
-
Constructor Detail
-
ConfigImpl
private ConfigImpl(boolean convertTableAccess, boolean decorrelationEnabled, boolean trimUnusedFields, boolean createValuesRel, boolean explain, boolean expand, int inSubQueryThreshold, RelBuilderFactory relBuilderFactory)
-
-
Method Detail
-
isConvertTableAccess
public boolean isConvertTableAccess()
Description copied from interface:SqlToRelConverter.Config
Returns theconvertTableAccess
option. Controls whether table access references are converted to physical rels immediately. The optimizer doesn't like leaf rels to haveConvention.NONE
. However, if we are doing further conversion passes (e.g.RelStructuredTypeFlattener
), then we may need to defer conversion.- Specified by:
isConvertTableAccess
in interfaceSqlToRelConverter.Config
-
isDecorrelationEnabled
public boolean isDecorrelationEnabled()
Description copied from interface:SqlToRelConverter.Config
Returns thedecorrelationEnabled
option. Controls whether to disable sub-query decorrelation when needed. e.g. if outer joins are not supported.- Specified by:
isDecorrelationEnabled
in interfaceSqlToRelConverter.Config
-
isTrimUnusedFields
public boolean isTrimUnusedFields()
Description copied from interface:SqlToRelConverter.Config
Returns thetrimUnusedFields
option. Controls whether to trim unused fields as part of the conversion process.- Specified by:
isTrimUnusedFields
in interfaceSqlToRelConverter.Config
-
isCreateValuesRel
public boolean isCreateValuesRel()
Description copied from interface:SqlToRelConverter.Config
Returns thecreateValuesRel
option. Controls whether instances ofLogicalValues
are generated. These may not be supported by all physical implementations.- Specified by:
isCreateValuesRel
in interfaceSqlToRelConverter.Config
-
isExplain
public boolean isExplain()
Description copied from interface:SqlToRelConverter.Config
Returns theexplain
option. Describes whether the current statement is part of an EXPLAIN PLAN statement.- Specified by:
isExplain
in interfaceSqlToRelConverter.Config
-
isExpand
public boolean isExpand()
Description copied from interface:SqlToRelConverter.Config
Returns theexpand
option. Controls whether to expand sub-queries. If false, each sub-query becomes aRexSubQuery
.- Specified by:
isExpand
in interfaceSqlToRelConverter.Config
-
getInSubQueryThreshold
public int getInSubQueryThreshold()
Description copied from interface:SqlToRelConverter.Config
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.- Specified by:
getInSubQueryThreshold
in interfaceSqlToRelConverter.Config
-
getRelBuilderFactory
public RelBuilderFactory getRelBuilderFactory()
Description copied from interface:SqlToRelConverter.Config
Returns the factory to createRelBuilder
, never null. Default isRelFactories.LOGICAL_BUILDER
.- Specified by:
getRelBuilderFactory
in interfaceSqlToRelConverter.Config
-
-