OmniSciDB
a5dc49c757
|
Classes | |
class | Blackboard |
class | DeferredLookup |
class | NoOpSubQueryConverter |
class | RexAccessShuttle |
Public Member Functions | |
SqlToRelConverter (RelOptTable.ViewExpander viewExpander, SqlValidator validator, Prepare.CatalogReader catalogReader, RelOptPlanner planner, RexBuilder rexBuilder, SqlRexConvertletTable convertletTable) | |
SqlToRelConverter (RelOptTable.ViewExpander viewExpander, SqlValidator validator, Prepare.CatalogReader catalogReader, RelOptCluster cluster, SqlRexConvertletTable convertletTable) | |
SqlToRelConverter (RelOptTable.ViewExpander viewExpander, SqlValidator validator, Prepare.CatalogReader catalogReader, RelOptCluster cluster, SqlRexConvertletTable convertletTable, Config config) | |
RelOptCluster | getCluster () |
RexBuilder | getRexBuilder () |
int | getDynamicParamCount () |
RelDataType | getDynamicParamType (int index) |
int | getDynamicParamCountInExplain (boolean increment) |
Map< SqlNode, RexNode > | getMapConvertedNonCorrSubqs () |
void | addConvertedNonCorrSubqs (Map< SqlNode, RexNode > alreadyConvertedNonCorrSubqs) |
void | setSubQueryConverter (SubQueryConverter converter) |
void | setDynamicParamCountInExplain (int explainParamCount) |
RelNode | flattenTypes (RelNode rootRel, boolean restructure) |
RelNode | decorrelate (SqlNode query, RelNode rootRel) |
RelNode | trimUnusedFields (boolean ordered, RelNode rootRel) |
RelRoot | convertQuery (SqlNode query, final boolean needsValidation, final boolean top) |
RelNode | convertSelect (SqlSelect select, boolean top) |
RelNode | convertToSingleValueSubq (SqlNode query, RelNode plan) |
RexNode | convertExpression (SqlNode node) |
RexNode | convertExpression (SqlNode node, Map< String, RexNode > nameToNodeMap) |
RexDynamicParam | convertDynamicParam (final SqlDynamicParam dynamicParam) |
boolean | isTrimUnusedFields () |
RelNode | toRel (final RelOptTable table, final List< RelHint > hints) |
RelRoot | convertWith (SqlWith with, boolean top) |
RelNode | convertValues (SqlCall values, RelDataType targetRowType) |
Static Public Member Functions | |
static boolean | isOrdered (SqlNode query) |
Public Attributes | |
final SqlToRelConverter.Config | config |
final RelOptTable.ViewExpander | viewExpander |
Static Public Attributes | |
static final int | DEFAULT_IN_SUB_QUERY_THRESHOLD = 20 |
static final int | DEFAULT_IN_SUBQUERY_THRESHOLD = DEFAULT_IN_SUB_QUERY_THRESHOLD |
Protected Member Functions | |
RelFieldTrimmer | newFieldTrimmer () |
Blackboard | createBlackboard (SqlValidatorScope scope, Map< String, RexNode > nameToNodeMap, boolean top) |
void | convertSelectImpl (final Blackboard bb, SqlSelect select) |
void | convertOrder (SqlSelect select, Blackboard bb, RelCollation collation, List< SqlNode > orderExprList, SqlNode offset, SqlNode fetch) |
int | getInSubqueryThreshold () |
RexNode | convertExtendedExpression (SqlNode node, Blackboard bb) |
void | convertFrom (Blackboard bb, SqlNode from) |
void | convertFrom (Blackboard bb, SqlNode from, List< String > fieldNames) |
void | convertMatchRecognize (Blackboard bb, SqlCall call) |
void | convertCollectionTable (Blackboard bb, SqlCall call) |
void | afterTableFunction (SqlToRelConverter.Blackboard bb, SqlCall call, LogicalTableFunctionScan callRel) |
RelNode | createJoin (Blackboard bb, RelNode leftRel, RelNode rightRel, RexNode joinCond, JoinRelType joinType) |
List< RelDataTypeField > | getSystemFields () |
void | convertAgg (Blackboard bb, SqlSelect select, List< SqlNode > orderExprList) |
final void | createAggImpl (Blackboard bb, final AggConverter aggConverter, SqlNodeList selectList, SqlNodeList groupList, SqlNode having, List< SqlNode > orderExprList) |
RelNode | createAggregate (Blackboard bb, ImmutableBitSet groupSet, ImmutableList< ImmutableBitSet > groupSets, List< AggregateCall > aggCalls) |
void | gatherOrderExprs (Blackboard bb, SqlSelect select, SqlNodeList orderList, List< SqlNode > extraOrderExprs, List< RelFieldCollation > collationList) |
RelFieldCollation | convertOrderItem (SqlSelect select, SqlNode orderItem, List< SqlNode > extraExprs, RelFieldCollation.Direction direction, RelFieldCollation.NullDirection nullDirection) |
boolean | enableDecorrelation () |
RelNode | decorrelateQuery (RelNode rootRel) |
RelRoot | convertQueryRecursive (SqlNode query, boolean top, RelDataType targetRowType) |
RelNode | convertSetOp (SqlCall call) |
RelNode | convertInsert (SqlInsert call) |
RelOptTable | getTargetTable (SqlNode call) |
RelNode | convertColumnList (final SqlInsert call, RelNode source) |
void | collectInsertTargets (SqlInsert call, final RexNode sourceRef, final List< String > targetColumnNames, List< RexNode > columnExprs) |
RexNode | adjustInputRef (Blackboard bb, RexInputRef inputRef) |
void | extraSelectItems (Blackboard bb, SqlSelect select, List< RexNode > exprList, List< String > nameList, Collection< String > aliasList, List< SqlMonotonicity > columnMonotonicityList) |
Protected Attributes | |
final SqlValidator | validator |
final RexBuilder | rexBuilder |
final Prepare.CatalogReader | catalogReader |
final RelOptCluster | cluster |
final Map< RelNode, Integer > | leaves = new HashMap<>() |
final RelDataTypeFactory | typeFactory |
Static Protected Attributes | |
static final Logger | SQL2REL_LOGGER = CalciteTrace.getSqlToRelTracer() |
Private Member Functions | |
void | checkConvertedType (SqlNode query, RelNode result) |
RelCollation | requiredCollation (RelNode r) |
void | distinctify (Blackboard bb, boolean checkForDupExprs) |
void | convertWhere (final Blackboard bb, final SqlNode where) |
void | replaceSubQueries (final Blackboard bb, final SqlNode expr, RelOptUtil.Logic logic) |
void | substituteSubQuery (Blackboard bb, SubQuery subQuery) |
RexNode | translateIn (RelOptUtil.Logic logic, RelNode root, final RexNode rex) |
boolean | convertNonCorrelatedSubQuery (SubQuery subQuery, Blackboard bb, RelNode converted, boolean isExists) |
RexNode | convertInToOr (final Blackboard bb, final List< RexNode > leftKeys, SqlNodeList valuesList, SqlInOperator op) |
RexNode | ensureSqlType (RelDataType type, RexNode node) |
RelOptUtil.Exists | convertExists (SqlNode seek, RelOptUtil.SubQueryType subQueryType, RelOptUtil.Logic logic, boolean notIn, RelDataType targetDataType) |
RelNode | convertQueryOrInList (Blackboard bb, SqlNode seek, RelDataType targetRowType) |
RelNode | convertRowValues (Blackboard bb, SqlNode rowList, Collection< SqlNode > rows, boolean allowLiteralsOnly, RelDataType targetRowType) |
RexLiteral | convertLiteralInValuesList (SqlNode sqlNode, Blackboard bb, RelDataType rowType, int iField) |
boolean | isRowConstructor (SqlNode node) |
void | findSubQueries (Blackboard bb, SqlNode node, RelOptUtil.Logic logic, boolean registerOnlyScalarSubQueries) |
RexNode | convertOver (Blackboard bb, SqlNode node) |
void | convertUnnest (Blackboard bb, SqlCall call, List< String > fieldNames) |
void | convertIdentifier (Blackboard bb, SqlIdentifier id, SqlNodeList extendedColumns, SqlNodeList tableHints) |
void | convertTemporalTable (Blackboard bb, SqlCall call) |
Set< RelColumnMapping > | getColumnMappings (SqlOperator op) |
CorrelationUse | getCorrelationUse (Blackboard bb, final RelNode r0) |
boolean | isSubQueryNonCorrelated (RelNode subq, Blackboard bb) |
RexNode | convertJoinCondition (Blackboard bb, SqlValidatorNamespace leftNamespace, SqlValidatorNamespace rightNamespace, SqlNode condition, JoinConditionType conditionType, RelNode leftRel, RelNode rightRel) |
RexNode | convertUsing (SqlValidatorNamespace leftNamespace, SqlValidatorNamespace rightNamespace, List< String > nameList) |
RelNode | rewriteAggregateWithGroupId (Blackboard bb, AggregatingSelectScope.Resolved r, AggConverter converter) |
boolean | all (SqlCall call) |
RelNode | createModify (RelOptTable targetTable, RelNode source) |
RelNode | createSource (RelOptTable targetTable, RelNode source, ModifiableView modifiableView, RelDataType delegateRowType) |
RelOptTable.ToRelContext | createToRelContext (List< RelHint > hints) |
Blackboard | createInsertBlackboard (RelOptTable targetTable, RexNode sourceRef, List< String > targetColumnNames) |
InitializerExpressionFactory | getInitializerFactory (SqlValidatorTable validatorTable) |
RexNode | castNullLiteralIfNeeded (RexNode node, RelDataType type) |
RelNode | convertDelete (SqlDelete call) |
RelNode | convertUpdate (SqlUpdate call) |
RelNode | convertMerge (SqlMerge call) |
RexNode | convertIdentifier (Blackboard bb, SqlIdentifier identifier) |
RelNode | convertRowConstructor (Blackboard bb, SqlCall rowConstructor) |
RelNode | convertCursor (Blackboard bb, SubQuery subQuery) |
RelNode | convertMultisets (final List< SqlNode > operands, Blackboard bb) |
void | convertSelectList (Blackboard bb, SqlSelect select, List< SqlNode > orderList) |
String | deriveAlias (final SqlNode node, Collection< String > aliases, final int ordinal) |
void | convertValuesImpl (Blackboard bb, SqlCall values, RelDataType targetRowType) |
SqlQuantifyOperator | negate (SqlQuantifyOperator operator) |
Static Private Member Functions | |
static boolean | isStream (SqlNode query) |
static boolean | containsInOperator (SqlNode node) |
static SqlNode | pushDownNotForIn (SqlValidatorScope scope, SqlNode sqlNode) |
static SqlNode | reg (SqlValidatorScope scope, SqlNode e) |
static boolean | containsNullLiteral (SqlNodeList valueList) |
static JoinRelType | convertJoinType (JoinType joinType) |
static boolean | desc (RelFieldCollation.Direction direction) |
static< T > T | unwrap (Object o, Class< T > clazz) |
Private Attributes | |
SubQueryConverter | subQueryConverter |
final List< SqlDynamicParam > | dynamicParamSqlNodes = new ArrayList<>() |
final SqlOperatorTable | opTab |
final SqlNodeToRexConverter | exprConverter |
final HintStrategyTable | hintStrategies |
int | explainParamCount |
final RelBuilder | relBuilder |
final Map< CorrelationId, DeferredLookup > | mapCorrelToDeferred = new HashMap<>() |
final Deque< String > | datasetStack = new ArrayDeque<>() |
final Map< SqlNode, RexNode > | mapConvertedNonCorrSubqs = new HashMap<>() |
Converts a SQL parse tree (consisting of org.apache.calcite.sql.SqlNode objects) into a relational algebra expression (consisting of org.apache.calcite.rel.RelNode objects).
The public entry points are: convertQuery, convertExpression(SqlNode).
Definition at line 233 of file SqlToRelConverter.java.
|
inline |
Creates a converter.
viewExpander | Preparing statement |
validator | Validator |
catalogReader | Schema |
planner | Planner |
rexBuilder | Rex builder |
convertletTable | Expression converter |
Definition at line 296 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.catalogReader, org.apache.calcite.sql2rel.SqlToRelConverter.rexBuilder, org.apache.calcite.sql2rel.SqlToRelConverter.validator, and org.apache.calcite.sql2rel.SqlToRelConverter.viewExpander.
|
inline |
Definition at line 311 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.catalogReader, org.apache.calcite.sql2rel.SqlToRelConverter.cluster, org.apache.calcite.sql2rel.SqlToRelConverter.validator, and org.apache.calcite.sql2rel.SqlToRelConverter.viewExpander.
|
inline |
Definition at line 325 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.catalogReader, org.apache.calcite.sql2rel.SqlToRelConverter.cluster, org.apache.calcite.sql2rel.SqlToRelConverter.config, File_Namespace.create(), org.apache.calcite.sql2rel.SqlToRelConverter.validator, and org.apache.calcite.sql2rel.SqlToRelConverter.viewExpander.
|
inline |
Adds to the current map of non-correlated converted sub-queries the elements from another map that contains non-correlated sub-queries that have been converted by another SqlToRelConverter.
alreadyConvertedNonCorrSubqs | the other map |
Definition at line 419 of file SqlToRelConverter.java.
|
inlineprotected |
Adjusts the type of a reference to an input field to account for nulls introduced by outer joins; and adjusts the offset to match the physical implementation.
bb | Blackboard |
inputRef | Input ref |
Definition at line 3830 of file SqlToRelConverter.java.
References field().
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertIdentifier().
|
inlineprotected |
Definition at line 2399 of file SqlToRelConverter.java.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertCollectionTable().
|
inlineprivate |
Definition at line 3292 of file SqlToRelConverter.java.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertSetOp().
|
inlineprivate |
Definition at line 3561 of file SqlToRelConverter.java.
References run_benchmark_import.type.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertColumnList().
|
inlineprivate |
Definition at line 444 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.catalogReader.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertQuery(), and org.apache.calcite.sql2rel.SqlToRelConverter.decorrelate().
|
inlineprotected |
Given an INSERT statement, collects the list of names to be populated and the expressions to put in them.
call | Insert statement |
sourceRef | Expression representing a row from the source relational expression |
targetColumnNames | List of target column names, to be populated |
columnExprs | List of expressions, to be populated |
Definition at line 3578 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.catalogReader, org.apache.calcite.sql2rel.SqlToRelConverter.createInsertBlackboard(), f(), field(), org.apache.calcite.sql2rel.SqlToRelConverter.getTargetTable(), Fragmenter_Namespace.indexOf(), org.apache.calcite.sql2rel.SqlToRelConverter.typeFactory, and org.apache.calcite.sql2rel.SqlToRelConverter.validator.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertColumnList().
|
inlinestaticprivate |
Returns whether a given node contains a SqlInOperator.
node | a RexNode tree |
Definition at line 855 of file SqlToRelConverter.java.
References Void.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.pushDownNotForIn().
|
inlinestaticprivate |
Definition at line 1340 of file SqlToRelConverter.java.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.substituteSubQuery().
|
inlineprotected |
Converts the SELECT, GROUP BY and HAVING clauses of an aggregate query.
This method extracts SELECT, GROUP BY and HAVING clauses, and creates an AggConverter, then delegates to createAggImpl. Derived class may override this method to change any of those clauses or specify a different AggConverter.
bb | Scope within which to resolve identifiers |
select | Query |
orderExprList | Additional expressions needed to implement ORDER BY |
Definition at line 2770 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.createAggImpl().
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertSelectImpl().
|
inlineprotected |
Definition at line 2348 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.afterTableFunction(), org.apache.calcite.sql2rel.SqlToRelConverter.cluster, org.apache.calcite.sql2rel.SqlToRelConverter.convertQuery(), org.apache.calcite.sql2rel.SqlToRelConverter.getColumnMappings(), org.apache.calcite.sql2rel.SqlToRelConverter.replaceSubQueries(), org.apache.calcite.sql2rel.SqlToRelConverter.Blackboard.scope, org.apache.calcite.sql2rel.SqlToRelConverter.toRel(), and org.apache.calcite.sql2rel.SqlToRelConverter.typeFactory.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertFrom().
|
inlineprotected |
Creates a source for an INSERT statement.
If the column list is not specified, source expressions match target columns in order.
If the column list is specified, Source expressions are mapped to target columns by name via targetColumnList, and may not cover the entire target table. So, we'll make up a full row, using a combination of default values and the source expressions provided.
call | Insert expression |
source | Source relational expression |
Definition at line 3465 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.castNullLiteralIfNeeded(), org.apache.calcite.sql2rel.SqlToRelConverter.collectInsertTargets(), org.apache.calcite.sql2rel.SqlToRelConverter.createInsertBlackboard(), field(), org.apache.calcite.sql2rel.SqlToRelConverter.getInitializerFactory(), org.apache.calcite.sql2rel.SqlToRelConverter.getTargetTable(), and org.apache.calcite.sql2rel.SqlToRelConverter.validator.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertInsert().
|
inlineprivate |
Definition at line 3851 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.convertQuery().
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.substituteSubQuery().
|
inlineprivate |
Definition at line 3638 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.catalogReader, org.apache.calcite.sql2rel.SqlToRelConverter.convertSelect(), and org.apache.calcite.sql2rel.SqlToRelConverter.getTargetTable().
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertQueryRecursive().
|
inline |
Definition at line 3078 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.getDynamicParamType().
|
inlineprivate |
Converts an EXISTS or IN predicate into a join. For EXISTS, the sub-query produces an indicator variable, and the result is a relational expression which outer joins that indicator to the original query. After performing the outer join, the condition will be TRUE if the EXISTS condition holds, NULL otherwise.
seek | A query, for example 'select * from emp' or 'values (1,2,3)' or '('Foo', 34)'. |
subQueryType | Whether sub-query is IN, EXISTS or scalar |
logic | Whether the answer needs to be in full 3-valued logic (TRUE, FALSE, UNKNOWN) will be required, or whether we can accept an approximation (say representing UNKNOWN as FALSE) |
notIn | Whether the operation is NOT IN |
Definition at line 1534 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.convertQueryOrInList(), org.apache.calcite.sql2rel.SqlToRelConverter.createBlackboard(), org.apache.calcite.sql2rel.SqlToRelConverter.relBuilder, and org.apache.calcite.sql2rel.SqlToRelConverter.validator.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.substituteSubQuery().
|
inline |
Converts an expression from SqlNode to RexNode format.
node | Expression to translate |
Definition at line 1801 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.createBlackboard(), and org.apache.calcite.sql2rel.SqlToRelConverter.validator.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertOrder().
|
inline |
Converts an expression from SqlNode to RexNode format, mapping identifier references to predefined expressions.
node | Expression to translate |
nameToNodeMap | map from String to RexNode; when an SqlIdentifier is encountered, it is used as a key and translated to the corresponding value from this map |
Definition at line 1820 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.createBlackboard(), and org.apache.calcite.sql2rel.SqlToRelConverter.validator.
|
inlineprotected |
Converts a non-standard expression.
This method is an extension-point that derived classes can override. If this method returns a null result, the normal expression translation process will proceed. The default implementation always returns null.
node | Expression |
bb | Blackboard |
Definition at line 1843 of file SqlToRelConverter.java.
|
inlineprotected |
Definition at line 1939 of file SqlToRelConverter.java.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertFrom(), org.apache.calcite.sql2rel.SqlToRelConverter.convertIdentifier(), org.apache.calcite.sql2rel.SqlToRelConverter.convertMatchRecognize(), org.apache.calcite.sql2rel.SqlToRelConverter.convertSelectImpl(), and org.apache.calcite.sql2rel.SqlToRelConverter.convertTemporalTable().
|
inlineprotected |
Converts a FROM clause into a relational expression.
bb | Scope within which to resolve identifiers |
from | FROM clause of a query. Examples include: <ul> <li>a single table ("SALES.EMP"), <li>an aliased table ("EMP AS E"), <li>a list of tables ("EMP, DEPT"), <li>an ANSI Join expression ("EMP JOIN DEPT ON EMP.DEPTNO = DEPT.DEPTNO"), <li>a VALUES clause ("VALUES ('Fred', 20)"), <li>a query ("(SELECT * FROM EMP WHERE GENDER = 'F')"), <li>or any combination of the above. </ul> |
fieldNames | Field aliases, usually come from AS clause |
Definition at line 1961 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.cluster, org.apache.calcite.sql2rel.SqlToRelConverter.convertCollectionTable(), org.apache.calcite.sql2rel.SqlToRelConverter.convertFrom(), org.apache.calcite.sql2rel.SqlToRelConverter.convertIdentifier(), org.apache.calcite.sql2rel.SqlToRelConverter.convertJoinCondition(), org.apache.calcite.sql2rel.SqlToRelConverter.convertJoinType(), org.apache.calcite.sql2rel.SqlToRelConverter.convertMatchRecognize(), org.apache.calcite.sql2rel.SqlToRelConverter.convertQueryRecursive(), org.apache.calcite.sql2rel.SqlToRelConverter.convertTemporalTable(), org.apache.calcite.sql2rel.SqlToRelConverter.convertUnnest(), org.apache.calcite.sql2rel.SqlToRelConverter.convertUsing(), org.apache.calcite.sql2rel.SqlToRelConverter.convertValuesImpl(), org.apache.calcite.sql2rel.SqlToRelConverter.createBlackboard(), org.apache.calcite.sql2rel.SqlToRelConverter.createJoin(), join(), report.params, setup.root, org.apache.calcite.sql2rel.SqlToRelConverter.Blackboard.root, and UNION.
|
inlineprivate |
Definition at line 2315 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.catalogReader, org.apache.calcite.sql2rel.SqlToRelConverter.cluster, org.apache.calcite.sql2rel.SqlToRelConverter.convertFrom(), org.apache.calcite.sql2rel.SqlToRelConverter.datasetStack, org.apache.calcite.sql2rel.SqlToRelConverter.hintStrategies, org.apache.calcite.sql2rel.SqlToRelConverter.toRel(), and org.apache.calcite.sql2rel.SqlToRelConverter.validator.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertFrom().
|
inlineprivate |
Converts an identifier into an expression in a given scope. For example, the "empno" in "select empno from emp join dept" becomes "emp.empno".
Definition at line 3771 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.adjustInputRef(), org.apache.calcite.sql2rel.SqlToRelConverter.Blackboard.isPatternVarRef, setup.name, and org.apache.calcite.sql2rel.SqlToRelConverter.Blackboard.scope.
|
inlineprotected |
Definition at line 3296 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.convertColumnList(), org.apache.calcite.sql2rel.SqlToRelConverter.convertQueryRecursive(), org.apache.calcite.sql2rel.SqlToRelConverter.createModify(), and org.apache.calcite.sql2rel.SqlToRelConverter.getTargetTable().
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertMerge(), and org.apache.calcite.sql2rel.SqlToRelConverter.convertQueryRecursive().
|
inlineprivate |
Converts "x IN (1, 2, ...)" to "x=1 OR x=2 OR ...".
leftKeys | LHS |
valuesList | RHS |
op | The operator (IN, NOT IN, > SOME, ...) |
Definition at line 1440 of file SqlToRelConverter.java.
References QueryRunner.ALL, org.apache.calcite.sql2rel.SqlToRelConverter.ensureSqlType(), and org.apache.calcite.sql2rel.SqlToRelConverter.rexBuilder.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.substituteSubQuery().
|
inlineprivate |
Definition at line 2680 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.convertUsing(), setup.name, and org.apache.calcite.sql2rel.SqlToRelConverter.replaceSubQueries().
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertFrom().
|
inlinestaticprivate |
Definition at line 2740 of file SqlToRelConverter.java.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertFrom().
|
inlineprivate |
Definition at line 1638 of file SqlToRelConverter.java.
References field(), and run_benchmark_import.type.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertRowValues().
|
inlineprotected |
Definition at line 2147 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.convertFrom(), org.apache.calcite.sql2rel.SqlToRelConverter.createBlackboard(), org.apache.calcite.sql2rel.SqlToRelConverter.desc(), org.apache.calcite.sql2rel.SqlToRelConverter.replaceSubQueries(), and setup.root.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertFrom().
|
inlineprivate |
Definition at line 3687 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.catalogReader, org.apache.calcite.sql2rel.SqlToRelConverter.convertInsert(), org.apache.calcite.sql2rel.SqlToRelConverter.convertSelect(), field(), org.apache.calcite.sql2rel.SqlToRelConverter.getTargetTable(), join(), and org.apache.calcite.sql2rel.SqlToRelConverter.typeFactory.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertQueryRecursive().
|
inlineprivate |
Definition at line 3862 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.cluster, org.apache.calcite.sql2rel.SqlToRelConverter.convertQuery(), org.apache.calcite.sql2rel.SqlToRelConverter.convertQueryOrInList(), org.apache.calcite.sql2rel.SqlToRelConverter.createBlackboard(), setup.root, org.apache.calcite.sql2rel.SqlToRelConverter.Blackboard.scope, and org.apache.calcite.sql2rel.SqlToRelConverter.validator.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertRowConstructor(), and org.apache.calcite.sql2rel.SqlToRelConverter.substituteSubQuery().
|
inlineprivate |
Determines if a sub-query is non-correlated and if so, converts it to a constant.
subQuery | the call that references the sub-query |
bb | blackboard used to convert the sub-query |
converted | RelNode tree corresponding to the sub-query |
isExists | true if the sub-query is part of an EXISTS expression |
Definition at line 1362 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.isSubQueryNonCorrelated(), and org.apache.calcite.sql2rel.SqlToRelConverter.subQueryConverter.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.substituteSubQuery().
|
inlineprotected |
Converts a query's ORDER BY clause, if any.
Ignores the ORDER BY clause if the query is not top-level and FETCH or OFFSET are not present.
select | Query |
bb | Blackboard |
collation | Collation list |
orderExprList | Method populates this list with orderBy expressions not present in selectList |
offset | Expression for number of rows to discard before returning first row |
fetch | Expression for number of rows to fetch |
Definition at line 804 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.convertExpression(), setup.root, and org.apache.calcite.sql2rel.SqlToRelConverter.Blackboard.top.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertSelectImpl().
|
inlineprotected |
Definition at line 3139 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.desc().
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.gatherOrderExprs().
|
inlineprivate |
|
inline |
Converts an unvalidated query's parse tree into a relational expression.
query | Query to convert |
needsValidation | Whether to validate the query before converting; false if the query has already been validated. |
top | Whether the query is top-level, say if its result will become a JDBC result set; false if the query will be part of a view. |
Definition at line 568 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.checkConvertedType(), org.apache.calcite.sql2rel.SqlToRelConverter.cluster, org.apache.calcite.sql2rel.SqlToRelConverter.convertQueryRecursive(), org.apache.calcite.sql2rel.SqlToRelConverter.hintStrategies, org.apache.calcite.sql2rel.SqlToRelConverter.isOrdered(), org.apache.calcite.sql2rel.SqlToRelConverter.isStream(), org.apache.calcite.sql2rel.SqlToRelConverter.requiredCollation(), run_benchmark_import.result, and org.apache.calcite.sql2rel.SqlToRelConverter.SQL2REL_LOGGER.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertCollectionTable(), org.apache.calcite.sql2rel.SqlToRelConverter.convertCursor(), and org.apache.calcite.sql2rel.SqlToRelConverter.convertMultisets().
|
inlineprivate |
Definition at line 1548 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.convertQueryRecursive(), and org.apache.calcite.sql2rel.SqlToRelConverter.convertRowValues().
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertExists(), org.apache.calcite.sql2rel.SqlToRelConverter.convertMultisets(), and org.apache.calcite.sql2rel.SqlToRelConverter.substituteSubQuery().
|
inlineprotected |
Recursively converts a query to a relational expression.
query | Query |
top | Whether this query is the top-level query of the statement |
targetRowType | Target row type, or null |
Definition at line 3240 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.convertDelete(), org.apache.calcite.sql2rel.SqlToRelConverter.convertInsert(), org.apache.calcite.sql2rel.SqlToRelConverter.convertMerge(), org.apache.calcite.sql2rel.SqlToRelConverter.convertSelect(), org.apache.calcite.sql2rel.SqlToRelConverter.convertSetOp(), org.apache.calcite.sql2rel.SqlToRelConverter.convertUpdate(), org.apache.calcite.sql2rel.SqlToRelConverter.convertValues(), org.apache.calcite.sql2rel.SqlToRelConverter.convertWith(), and UNION.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertFrom(), org.apache.calcite.sql2rel.SqlToRelConverter.convertInsert(), org.apache.calcite.sql2rel.SqlToRelConverter.convertQuery(), org.apache.calcite.sql2rel.SqlToRelConverter.convertQueryOrInList(), and org.apache.calcite.sql2rel.SqlToRelConverter.convertSetOp().
|
inlineprivate |
Converts a row constructor into a relational expression.
bb | Blackboard |
rowConstructor | Row constructor expression |
Definition at line 3845 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.convertMultisets(), and org.apache.calcite.sql2rel.SqlToRelConverter.isRowConstructor().
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertRowValues().
|
inlineprivate |
Definition at line 1564 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.cluster, org.apache.calcite.sql2rel.SqlToRelConverter.config, org.apache.calcite.sql2rel.SqlToRelConverter.convertLiteralInValuesList(), org.apache.calcite.sql2rel.SqlToRelConverter.convertRowConstructor(), org.apache.calcite.sql2rel.SqlToRelConverter.isRowConstructor(), and org.apache.calcite.sql2rel.SqlToRelConverter.typeFactory.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertQueryOrInList().
|
inline |
Converts a SELECT statement's parse tree into a relational expression.
Definition at line 645 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.convertSelectImpl(), org.apache.calcite.sql2rel.SqlToRelConverter.createBlackboard(), and setup.root.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertDelete(), org.apache.calcite.sql2rel.SqlToRelConverter.convertMerge(), org.apache.calcite.sql2rel.SqlToRelConverter.convertQueryRecursive(), and org.apache.calcite.sql2rel.SqlToRelConverter.convertUpdate().
|
inlineprotected |
Implementation of convertSelect(SqlSelect, boolean); derived class may override.
Definition at line 664 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.convertAgg(), org.apache.calcite.sql2rel.SqlToRelConverter.convertFrom(), org.apache.calcite.sql2rel.SqlToRelConverter.convertOrder(), org.apache.calcite.sql2rel.SqlToRelConverter.convertSelectList(), org.apache.calcite.sql2rel.SqlToRelConverter.convertWhere(), org.apache.calcite.sql2rel.SqlToRelConverter.distinctify(), org.apache.calcite.sql2rel.SqlToRelConverter.gatherOrderExprs(), org.apache.calcite.sql2rel.SqlToRelConverter.hintStrategies, setup.root, and org.apache.calcite.sql2rel.SqlToRelConverter.validator.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertSelect().
|
inlineprivate |
Definition at line 3963 of file SqlToRelConverter.java.
References setup.root.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertSelectImpl().
|
inlineprotected |
Converts a set operation (UNION, INTERSECT, MINUS) into relational expressions.
call | Call to set operator |
Definition at line 3274 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.all(), org.apache.calcite.sql2rel.SqlToRelConverter.convertQueryRecursive(), and UNION.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertQueryRecursive().
|
inlineprivate |
Definition at line 2403 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.convertFrom(), and setup.root.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertFrom().
|
inline |
Converts the RelNode tree for a select statement to a select that produces a single value.
query | the query |
plan | the original RelNode tree corresponding to the statement |
Definition at line 1392 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.cluster.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.substituteSubQuery().
|
inlineprivate |
Definition at line 2117 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.cluster, org.apache.calcite.sql2rel.SqlToRelConverter.replaceSubQueries(), setup.root, org.apache.calcite.sql2rel.SqlToRelConverter.Blackboard.root, and org.apache.calcite.sql2rel.SqlToRelConverter.validator.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertFrom().
|
inlineprivate |
Definition at line 3650 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.catalogReader, org.apache.calcite.sql2rel.SqlToRelConverter.convertSelect(), org.apache.calcite.sql2rel.SqlToRelConverter.createBlackboard(), field(), org.apache.calcite.sql2rel.SqlToRelConverter.getTargetTable(), anonymous_namespace{Utm.h}.n, org.apache.calcite.sql2rel.SqlToRelConverter.replaceSubQueries(), and org.apache.calcite.sql2rel.SqlToRelConverter.typeFactory.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertQueryRecursive().
|
inlineprivate |
Returns an expression for matching columns of a USING clause or inferred from NATURAL JOIN. "a JOIN b USING (x, y)" becomes "a.x = b.x AND a.y = b.y". Returns null if the column list is empty.
leftNamespace | Namespace of left input to join |
rightNamespace | Namespace of right input to join |
nameList | List of column names to join on |
Definition at line 2721 of file SqlToRelConverter.java.
References field(), anonymous_namespace{Utm.h}.n, setup.name, and org.apache.calcite.sql2rel.SqlToRelConverter.rexBuilder.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertFrom(), and org.apache.calcite.sql2rel.SqlToRelConverter.convertJoinCondition().
|
inline |
Converts a SELECT statement's parse tree into a relational expression.
Definition at line 4054 of file SqlToRelConverter.java.
References setup.root.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertQueryRecursive().
|
inlineprivate |
Converts a values clause (as in "INSERT INTO T(x,y) VALUES (1,2)") into a relational expression.
bb | Blackboard |
values | Call to SQL VALUES operator |
targetRowType | Target row type |
Definition at line 4070 of file SqlToRelConverter.java.
References setup.root, and org.apache.calcite.sql2rel.SqlToRelConverter.Blackboard.scope.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertFrom().
|
inlineprivate |
Converts a WHERE clause.
bb | Blackboard |
where | WHERE clause, may be null |
Definition at line 979 of file SqlToRelConverter.java.
References f(), org.apache.calcite.sql2rel.SqlToRelConverter.getCorrelationUse(), org.apache.calcite.sql2rel.SqlToRelConverter.pushDownNotForIn(), org.apache.calcite.sql2rel.SqlToRelConverter.replaceSubQueries(), setup.root, org.apache.calcite.sql2rel.SqlToRelConverter.Blackboard.scope, and org.apache.calcite.sql2rel.SqlToRelConverter.typeFactory.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertSelectImpl().
|
inline |
Converts a WITH sub-query into a relational expression.
Definition at line 4047 of file SqlToRelConverter.java.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertQueryRecursive().
|
inlineprotected |
Definition at line 2781 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.createAggregate(), org.apache.calcite.sql2rel.SqlToRelConverter.pushDownNotForIn(), org.apache.calcite.sql2rel.SqlToRelConverter.replaceSubQueries(), org.apache.calcite.sql2rel.SqlToRelConverter.rewriteAggregateWithGroupId(), setup.root, org.apache.calcite.sql2rel.SqlToRelConverter.Blackboard.scope, and org.apache.calcite.sql2rel.SqlToRelConverter.validator.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertAgg().
|
inlineprotected |
Creates an Aggregate.
In case the aggregate rel changes the order in which it projects fields, the groupExprProjection
parameter is provided, and the implementation of this method may modify it.
The sortedCount
parameter is the number of expressions known to be monotonic. These expressions must be on the leading edge of the grouping keys. The default implementation of this method ignores this parameter.
bb | Blackboard |
groupSet | Bit set of ordinals of grouping columns |
groupSets | Grouping sets |
aggCalls | Array of calls to aggregate functions |
Definition at line 3070 of file SqlToRelConverter.java.
References setup.root.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.createAggImpl(), org.apache.calcite.sql2rel.SqlToRelConverter.distinctify(), and org.apache.calcite.sql2rel.SqlToRelConverter.rewriteAggregateWithGroupId().
|
inlineprotected |
Factory method for creating translation workspace.
Definition at line 655 of file SqlToRelConverter.java.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertExists(), org.apache.calcite.sql2rel.SqlToRelConverter.convertExpression(), org.apache.calcite.sql2rel.SqlToRelConverter.convertFrom(), org.apache.calcite.sql2rel.SqlToRelConverter.convertMatchRecognize(), org.apache.calcite.sql2rel.SqlToRelConverter.convertMultisets(), org.apache.calcite.sql2rel.SqlToRelConverter.convertSelect(), org.apache.calcite.sql2rel.SqlToRelConverter.convertUpdate(), org.apache.calcite.sql2rel.SqlToRelConverter.createInsertBlackboard(), and org.apache.calcite.sql2rel.SqlToRelConverter.substituteSubQuery().
|
inlineprivate |
Creates a blackboard for translating the expressions of generated columns in an INSERT statement.
Definition at line 3520 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.createBlackboard().
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.collectInsertTargets(), org.apache.calcite.sql2rel.SqlToRelConverter.convertColumnList(), and org.apache.calcite.sql2rel.SqlToRelConverter.toRel().
|
inlineprotected |
Definition at line 2459 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.getCorrelationUse(), org.apache.calcite.sql2rel.SqlToRelConverter.leaves, and org.apache.calcite.sql2rel.SqlToRelConverter.rexBuilder.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertFrom().
|
inlineprivate |
Creates a relational expression to modify a table or modifiable view.
Definition at line 3309 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.catalogReader, org.apache.calcite.sql2rel.SqlToRelConverter.cluster, org.apache.calcite.sql2rel.SqlToRelConverter.createSource(), and org.apache.calcite.sql2rel.SqlToRelConverter.typeFactory.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertInsert().
|
inlineprivate |
Wraps a relational expression in the projects and filters implied by a ModifiableView.
The input relational expression is suitable for inserting into the view, and the returned relational expression is suitable for inserting into its delegate table.
In principle, the delegate table of a view might be another modifiable view, and if so, the process can be repeated.
Definition at line 3353 of file SqlToRelConverter.java.
References field(), and org.apache.calcite.sql2rel.SqlToRelConverter.rexBuilder.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.createModify().
|
inlineprivate |
Definition at line 3394 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.cluster, and org.apache.calcite.sql2rel.SqlToRelConverter.viewExpander.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.flattenTypes(), and org.apache.calcite.sql2rel.SqlToRelConverter.toRel().
|
inline |
If sub-query is correlated and decorrelation is enabled, performs decorrelation.
query | Query |
rootRel | Root relational expression |
Definition at line 492 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.checkConvertedType(), org.apache.calcite.sql2rel.SqlToRelConverter.config, org.apache.calcite.sql2rel.SqlToRelConverter.decorrelateQuery(), and run_benchmark_import.result.
|
inlineprotected |
Definition at line 3217 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.relBuilder.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.decorrelate().
|
inlineprivate |
Definition at line 4028 of file SqlToRelConverter.java.
|
inlinestaticprivate |
Definition at line 3200 of file SqlToRelConverter.java.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertMatchRecognize(), and org.apache.calcite.sql2rel.SqlToRelConverter.convertOrderItem().
|
inlineprivate |
Having translated 'SELECT ... FROM ... [GROUP BY ...] [HAVING ...]', adds a relational expression to make the results unique.
If the SELECT clause contains duplicate expressions, adds org.apache.calcite.rel.logical.LogicalProjects so that we are grouping on the minimal set of keys. The performance gain isn't huge, but it is difficult to detect these duplicate expressions later.
bb | Blackboard |
checkForDupExprs | Check for duplicate expressions |
Definition at line 722 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.createAggregate(), field(), and setup.root.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertSelectImpl().
|
inlineprotected |
Definition at line 3211 of file SqlToRelConverter.java.
|
inlineprivate |
Ensures that an expression has a given SqlTypeName, applying a cast if necessary. If the expression already has the right type family, returns the expression unchanged.
Definition at line 1494 of file SqlToRelConverter.java.
References run_benchmark_import.type.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertInToOr().
|
inlineprotected |
Adds extra select items. The default implementation adds nothing; derived classes may add columns to exprList, nameList, aliasList and columnMonotonicityList.
bb | Blackboard |
select | Select statement being translated |
exprList | List of expressions in select clause |
nameList | List of names, one per column |
aliasList | Collection of aliases that have been used already |
columnMonotonicityList | List of monotonicity, one per column |
Definition at line 4021 of file SqlToRelConverter.java.
|
inlineprivate |
Builds a list of all IN
or EXISTS
operators inside SQL parse tree. Does not traverse inside queries.
bb | blackboard |
node | the SQL parse tree |
logic | Whether the answer needs to be in full 3-valued logic (TRUE, FALSE, UNKNOWN) will be required, or whether we can accept an approximation (say representing UNKNOWN as FALSE) |
registerOnlyScalarSubQueries | if set to true and the parse tree corresponds to a variation of a select node, only register it if it's a scalar sub-query |
Definition at line 1709 of file SqlToRelConverter.java.
References QueryRunner.ALL, and run_benchmark_import.type.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.replaceSubQueries().
|
inline |
Definition at line 478 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.createToRelContext(), org.apache.calcite.sql2rel.SqlToRelConverter.relBuilder, and org.apache.calcite.sql2rel.SqlToRelConverter.rexBuilder.
|
inlineprotected |
Creates a list of collations required to implement the ORDER BY clause, if there is one. Populates extraOrderExprs
with any sort expressions which are not in the select clause.
bb | Scope within which to resolve identifiers |
select | Select clause. Never null, because we invent a dummy SELECT if ORDER BY is applied to a set operation (UNION etc.) |
orderList | Order by clause, may be null |
extraOrderExprs | Sort expressions which are not in the select clause (output) |
collationList | List of collations (output) |
Definition at line 3106 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.convertOrderItem(), and org.apache.calcite.sql2rel.SqlToRelConverter.Blackboard.top.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertSelectImpl().
|
inline |
Returns the RelOptCluster in use.
Definition at line 354 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.cluster.
|
inlineprivate |
Definition at line 2416 of file SqlToRelConverter.java.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertCollectionTable().
|
inlineprivate |
Definition at line 2516 of file SqlToRelConverter.java.
References field(), org.apache.calcite.sql2rel.SqlToRelConverter.Blackboard.mapRootRelToFieldProjection, org.apache.calcite.sql2rel.SqlToRelConverter.rexBuilder, setup.root, and org.apache.calcite.sql2rel.SqlToRelConverter.Blackboard.root.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertWhere(), and org.apache.calcite.sql2rel.SqlToRelConverter.createJoin().
|
inline |
Returns the number of dynamic parameters encountered during translation; this must only be called after convertQuery.
Definition at line 371 of file SqlToRelConverter.java.
|
inline |
Returns the current count of the number of dynamic parameters in an EXPLAIN PLAN statement.
increment | if true, increment the count |
Definition at line 396 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.explainParamCount.
|
inline |
Returns the type inferred for a dynamic parameter.
index | 0-based index of dynamic parameter |
Definition at line 381 of file SqlToRelConverter.java.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertDynamicParam().
|
inlineprivate |
Definition at line 3541 of file SqlToRelConverter.java.
References f(), and org.apache.calcite.sql2rel.SqlToRelConverter.unwrap().
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertColumnList().
|
inlineprotected |
Gets the list size threshold under which convertInToOr is used. Lists of this size or greater will instead be converted to use a join against an inline table (org.apache.calcite.rel.logical.LogicalValues) rather than a predicate. A threshold of 0 forces usage of an inline table in all cases; a threshold of Integer.MAX_VALUE forces usage of OR in all cases
Definition at line 1513 of file SqlToRelConverter.java.
|
inline |
Returns the mapping of non-correlated sub-queries that have been converted to the constants that they evaluate to.
Definition at line 408 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.mapConvertedNonCorrSubqs.
|
inline |
Returns the row-expression builder.
Definition at line 361 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.rexBuilder.
|
inlineprotected |
Returns a list of fields to be prefixed to each relational expression.
Definition at line 2676 of file SqlToRelConverter.java.
|
inlineprotected |
Definition at line 3437 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.catalogReader.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.collectInsertTargets(), org.apache.calcite.sql2rel.SqlToRelConverter.convertColumnList(), org.apache.calcite.sql2rel.SqlToRelConverter.convertDelete(), org.apache.calcite.sql2rel.SqlToRelConverter.convertInsert(), org.apache.calcite.sql2rel.SqlToRelConverter.convertMerge(), and org.apache.calcite.sql2rel.SqlToRelConverter.convertUpdate().
|
inlinestatic |
Definition at line 615 of file SqlToRelConverter.java.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertQuery().
|
inlineprivate |
Definition at line 1685 of file SqlToRelConverter.java.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertRowConstructor(), and org.apache.calcite.sql2rel.SqlToRelConverter.convertRowValues().
|
inlinestaticprivate |
Definition at line 610 of file SqlToRelConverter.java.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertQuery().
|
inlineprivate |
Determines whether a sub-query is non-correlated. Note that a non-correlated sub-query can contain correlated references, provided those references do not reference select statements that are parents of the sub-query.
subq | the sub-query |
bb | blackboard used while converting the sub-query, i.e., the blackboard of the parent query of this sub-query |
Definition at line 2639 of file SqlToRelConverter.java.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertNonCorrelatedSubQuery().
|
inline |
Returns whether to trim unused fields as part of the conversion process.
Definition at line 3227 of file SqlToRelConverter.java.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.trimUnusedFields().
|
inlineprivate |
Definition at line 4810 of file SqlToRelConverter.java.
References QueryRunner.ALL.
|
inlineprotected |
Creates a RelFieldTrimmer.
Definition at line 553 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.relBuilder, and org.apache.calcite.sql2rel.SqlToRelConverter.validator.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.trimUnusedFields().
|
inlinestaticprivate |
Push down all the NOT logical operators into any IN/NOT IN operators.
scope | Scope where sqlNode
|
sqlNode | the root node from which to look for NOT operators |
Definition at line 880 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.containsInOperator(), and org.apache.calcite.sql2rel.SqlToRelConverter.reg().
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertWhere(), and org.apache.calcite.sql2rel.SqlToRelConverter.createAggImpl().
|
inlinestaticprivate |
Registers with the validator a SqlNode that has been created during the Sql-to-Rel process.
Definition at line 968 of file SqlToRelConverter.java.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.pushDownNotForIn().
|
inlineprivate |
Definition at line 1010 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.findSubQueries(), org.apache.calcite.sql2rel.SqlToRelConverter.Blackboard.subQueryList, and org.apache.calcite.sql2rel.SqlToRelConverter.substituteSubQuery().
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertCollectionTable(), org.apache.calcite.sql2rel.SqlToRelConverter.convertJoinCondition(), org.apache.calcite.sql2rel.SqlToRelConverter.convertMatchRecognize(), org.apache.calcite.sql2rel.SqlToRelConverter.convertUnnest(), org.apache.calcite.sql2rel.SqlToRelConverter.convertUpdate(), org.apache.calcite.sql2rel.SqlToRelConverter.convertWhere(), and org.apache.calcite.sql2rel.SqlToRelConverter.createAggImpl().
|
inlineprivate |
Definition at line 629 of file SqlToRelConverter.java.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertQuery().
|
inlineprivate |
The
function is used to distinguish duplicate groups. However, as Aggregate normalizes group sets to canonical form (i.e., flatten, sorting, redundancy removal), this information is lost in RelNode. Therefore, it is impossible to implement the function in runtime.
To fill this gap, an aggregation query that contains
function will generally be rewritten into UNION when converting to RelNode.
Also see the discussion in JIRA [CALCITE-1824] GROUP_ID returns wrong result.
Definition at line 2963 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.createAggregate(), and Integer.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.createAggImpl().
|
inline |
Sets the number of dynamic parameters in the current EXPLAIN PLAN statement.
explainParamCount | number of dynamic parameters in the statement |
Definition at line 439 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.explainParamCount.
|
inline |
Sets a new SubQueryConverter. To have any effect, this must be called before any convert method.
converter | new SubQueryConverter |
Definition at line 430 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.subQueryConverter.
|
inlineprivate |
Definition at line 1018 of file SqlToRelConverter.java.
References QueryRunner.ALL, run_benchmark_import.args, org.apache.calcite.sql2rel.SqlToRelConverter.config, org.apache.calcite.sql2rel.SqlToRelConverter.containsNullLiteral(), org.apache.calcite.sql2rel.SqlToRelConverter.convertCursor(), org.apache.calcite.sql2rel.SqlToRelConverter.convertExists(), org.apache.calcite.sql2rel.SqlToRelConverter.convertInToOr(), org.apache.calcite.sql2rel.SqlToRelConverter.convertMultisets(), org.apache.calcite.sql2rel.SqlToRelConverter.convertNonCorrelatedSubQuery(), org.apache.calcite.sql2rel.SqlToRelConverter.convertQueryOrInList(), org.apache.calcite.sql2rel.SqlToRelConverter.convertToSingleValueSubq(), org.apache.calcite.sql2rel.SqlToRelConverter.createBlackboard(), Double, org.apache.calcite.sql2rel.SqlToRelConverter.Blackboard.getTopNode(), join(), org.apache.calcite.sql2rel.SqlToRelConverter.relBuilder, org.apache.calcite.sql2rel.SqlToRelConverter.rexBuilder, setup.root, org.apache.calcite.sql2rel.SqlToRelConverter.Blackboard.root, org.apache.calcite.sql2rel.SqlToRelConverter.translateIn(), org.apache.calcite.sql2rel.SqlToRelConverter.typeFactory, and org.apache.calcite.sql2rel.SqlToRelConverter.validator.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.replaceSubQueries().
|
inline |
Definition at line 3398 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.createInsertBlackboard(), org.apache.calcite.sql2rel.SqlToRelConverter.createToRelContext(), and f().
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertCollectionTable(), and org.apache.calcite.sql2rel.SqlToRelConverter.convertIdentifier().
|
inlineprivate |
Definition at line 1260 of file SqlToRelConverter.java.
References run_benchmark_import.args, join(), org.apache.calcite.sql2rel.SqlToRelConverter.rexBuilder, and setup.root.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.substituteSubQuery().
|
inline |
Walks over a tree of relational expressions, replacing each RelNode with a 'slimmed down' relational expression that projects only the fields required by its consumer.
This may make things easier for the optimizer, by removing crud that would expand the search space, but is difficult for the optimizer itself to do it, because optimizer rules must preserve the number and type of fields. Hence, this transform that operates on the entire tree, similar to the type-flattening transform.
Currently this functionality is disabled in farrago/luciddb; the default implementation of this method does nothing.
ordered | Whether the relational expression must produce results in a particular order (typically because it has an ORDER BY at top level) |
rootRel | Relational expression that is at the root of the tree |
Definition at line 525 of file SqlToRelConverter.java.
References org.apache.calcite.sql2rel.SqlToRelConverter.isTrimUnusedFields(), org.apache.calcite.sql2rel.SqlToRelConverter.newFieldTrimmer(), and org.apache.calcite.sql2rel.SqlToRelConverter.SQL2REL_LOGGER.
|
inlinestaticprivate |
Definition at line 3554 of file SqlToRelConverter.java.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.getInitializerFactory().
|
protected |
Definition at line 251 of file SqlToRelConverter.java.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.checkConvertedType(), org.apache.calcite.sql2rel.SqlToRelConverter.collectInsertTargets(), org.apache.calcite.sql2rel.SqlToRelConverter.convertDelete(), org.apache.calcite.sql2rel.SqlToRelConverter.convertIdentifier(), org.apache.calcite.sql2rel.SqlToRelConverter.convertMerge(), org.apache.calcite.sql2rel.SqlToRelConverter.convertUpdate(), org.apache.calcite.sql2rel.SqlToRelConverter.createModify(), org.apache.calcite.sql2rel.SqlToRelConverter.getTargetTable(), and org.apache.calcite.sql2rel.SqlToRelConverter.SqlToRelConverter().
|
protected |
Definition at line 252 of file SqlToRelConverter.java.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertCollectionTable(), org.apache.calcite.sql2rel.SqlToRelConverter.convertFrom(), org.apache.calcite.sql2rel.SqlToRelConverter.convertIdentifier(), org.apache.calcite.sql2rel.SqlToRelConverter.convertMultisets(), org.apache.calcite.sql2rel.SqlToRelConverter.convertQuery(), org.apache.calcite.sql2rel.SqlToRelConverter.convertRowValues(), org.apache.calcite.sql2rel.SqlToRelConverter.convertToSingleValueSubq(), org.apache.calcite.sql2rel.SqlToRelConverter.convertUnnest(), org.apache.calcite.sql2rel.SqlToRelConverter.createModify(), org.apache.calcite.sql2rel.SqlToRelConverter.createToRelContext(), org.apache.calcite.sql2rel.SqlToRelConverter.getCluster(), and org.apache.calcite.sql2rel.SqlToRelConverter.SqlToRelConverter().
final SqlToRelConverter.Config org.apache.calcite.sql2rel.SqlToRelConverter.config |
Definition at line 261 of file SqlToRelConverter.java.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertRowValues(), org.apache.calcite.sql2rel.SqlToRelConverter.decorrelate(), org.apache.calcite.sql2rel.SqlToRelConverter.SqlToRelConverter(), and org.apache.calcite.sql2rel.SqlToRelConverter.substituteSubQuery().
|
private |
Stack of names of datasets requested by the TABLE(SAMPLE(<datasetName>, <query>))
construct.
Definition at line 273 of file SqlToRelConverter.java.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertIdentifier().
|
static |
Size of the smallest IN list that will be converted to a semijoin to a static table.
Definition at line 242 of file SqlToRelConverter.java.
|
static |
Definition at line 245 of file SqlToRelConverter.java.
|
private |
Definition at line 255 of file SqlToRelConverter.java.
|
private |
Definition at line 260 of file SqlToRelConverter.java.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.getDynamicParamCountInExplain(), and org.apache.calcite.sql2rel.SqlToRelConverter.setDynamicParamCountInExplain().
|
private |
Definition at line 258 of file SqlToRelConverter.java.
|
private |
Definition at line 259 of file SqlToRelConverter.java.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertIdentifier(), org.apache.calcite.sql2rel.SqlToRelConverter.convertQuery(), and org.apache.calcite.sql2rel.SqlToRelConverter.convertSelectImpl().
|
protected |
Definition at line 254 of file SqlToRelConverter.java.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.createJoin().
|
private |
Mapping of non-correlated sub-queries that have been converted to their equivalent constants. Used to avoid re-evaluating the sub-query if it's already been evaluated.
Definition at line 280 of file SqlToRelConverter.java.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.getMapConvertedNonCorrSubqs().
|
private |
Fields used in name resolution for correlated sub-queries.
Definition at line 267 of file SqlToRelConverter.java.
|
private |
Definition at line 256 of file SqlToRelConverter.java.
|
private |
Definition at line 262 of file SqlToRelConverter.java.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertExists(), org.apache.calcite.sql2rel.SqlToRelConverter.decorrelateQuery(), org.apache.calcite.sql2rel.SqlToRelConverter.flattenTypes(), org.apache.calcite.sql2rel.SqlToRelConverter.newFieldTrimmer(), and org.apache.calcite.sql2rel.SqlToRelConverter.substituteSubQuery().
|
protected |
Definition at line 250 of file SqlToRelConverter.java.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertInToOr(), org.apache.calcite.sql2rel.SqlToRelConverter.convertUsing(), org.apache.calcite.sql2rel.SqlToRelConverter.createJoin(), org.apache.calcite.sql2rel.SqlToRelConverter.createSource(), org.apache.calcite.sql2rel.SqlToRelConverter.flattenTypes(), org.apache.calcite.sql2rel.SqlToRelConverter.getCorrelationUse(), org.apache.calcite.sql2rel.SqlToRelConverter.getRexBuilder(), org.apache.calcite.sql2rel.SqlToRelConverter.SqlToRelConverter(), org.apache.calcite.sql2rel.SqlToRelConverter.substituteSubQuery(), and org.apache.calcite.sql2rel.SqlToRelConverter.translateIn().
|
staticprotected |
Definition at line 236 of file SqlToRelConverter.java.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertQuery(), and org.apache.calcite.sql2rel.SqlToRelConverter.trimUnusedFields().
|
private |
Definition at line 253 of file SqlToRelConverter.java.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.convertNonCorrelatedSubQuery(), and org.apache.calcite.sql2rel.SqlToRelConverter.setSubQueryConverter().
|
protected |
Definition at line 257 of file SqlToRelConverter.java.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.collectInsertTargets(), org.apache.calcite.sql2rel.SqlToRelConverter.convertCollectionTable(), org.apache.calcite.sql2rel.SqlToRelConverter.convertMerge(), org.apache.calcite.sql2rel.SqlToRelConverter.convertRowValues(), org.apache.calcite.sql2rel.SqlToRelConverter.convertUpdate(), org.apache.calcite.sql2rel.SqlToRelConverter.convertWhere(), org.apache.calcite.sql2rel.SqlToRelConverter.createModify(), and org.apache.calcite.sql2rel.SqlToRelConverter.substituteSubQuery().
|
protected |
Definition at line 249 of file SqlToRelConverter.java.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.collectInsertTargets(), org.apache.calcite.sql2rel.SqlToRelConverter.convertColumnList(), org.apache.calcite.sql2rel.SqlToRelConverter.convertExists(), org.apache.calcite.sql2rel.SqlToRelConverter.convertExpression(), org.apache.calcite.sql2rel.SqlToRelConverter.convertIdentifier(), org.apache.calcite.sql2rel.SqlToRelConverter.convertMultisets(), org.apache.calcite.sql2rel.SqlToRelConverter.convertSelectImpl(), org.apache.calcite.sql2rel.SqlToRelConverter.convertUnnest(), org.apache.calcite.sql2rel.SqlToRelConverter.createAggImpl(), org.apache.calcite.sql2rel.SqlToRelConverter.newFieldTrimmer(), org.apache.calcite.sql2rel.SqlToRelConverter.SqlToRelConverter(), and org.apache.calcite.sql2rel.SqlToRelConverter.substituteSubQuery().
final RelOptTable.ViewExpander org.apache.calcite.sql2rel.SqlToRelConverter.viewExpander |
Definition at line 282 of file SqlToRelConverter.java.
Referenced by org.apache.calcite.sql2rel.SqlToRelConverter.createToRelContext(), and org.apache.calcite.sql2rel.SqlToRelConverter.SqlToRelConverter().