Package org.apache.calcite.rel.rel2sql
Class SqlImplementor.Result
java.lang.Object
org.apache.calcite.rel.rel2sql.SqlImplementor.Result
- Enclosing class:
SqlImplementor
Result of implementing a node.
-
Constructor Summary
ConstructorDescriptionResult
(SqlNode node, Collection<SqlImplementor.Clause> clauses, @Nullable String neededAlias, @Nullable RelDataType neededType, Map<String, RelDataType> aliases) -
Method Summary
Modifier and TypeMethodDescriptionasFrom()
Returns a node that can be included in the FROM clause or a JOIN.Converts a non-query node into a SELECT node.asSelect()
Converts a non-query node into a SELECT node.Converts a non-query node into a SELECT node.Creates a builder for the SQL of the given relational expression, using the clauses that you declared when you calledSqlImplementor.visitInput(RelNode, int, Set)
.builder
(RelNode rel, SqlImplementor.Clause clause, SqlImplementor.Clause... clauses) Deprecated.Deprecated.Returns a context that always qualifies identifiers.In join, when the left and right nodes have been generated, update their alias with 'neededAlias' if not null.resetAlias
(String alias, RelDataType type) Sets the alias of the join or correlate just created.void
stripTrivialAliases
(SqlNode node)
-
Constructor Details
-
Result
public Result(SqlNode node, Collection<SqlImplementor.Clause> clauses, @Nullable String neededAlias, @Nullable RelDataType neededType, Map<String, RelDataType> aliases)
-
-
Method Details
-
builder
Creates a builder for the SQL of the given relational expression, using the clauses that you declared when you calledSqlImplementor.visitInput(RelNode, int, Set)
. -
builder
@Deprecated public SqlImplementor.Builder builder(RelNode rel, SqlImplementor.Clause clause, SqlImplementor.Clause... clauses) Deprecated.Provide the expected clauses up-front, when you callSqlImplementor.visitInput(RelNode, int, Set)
, then create a builder usingbuilder(RelNode)
. -
maxClause
Deprecated.Returns the highest clause that is in use. -
asFrom
Returns a node that can be included in the FROM clause or a JOIN. It has an alias that is unique within the query. The alias is implicit if it can be derived using the usual rules (For example, "SELECT * FROM emp" is equivalent to "SELECT * FROM emp AS emp".) -
subSelect
-
asSelect
Converts a non-query node into a SELECT node. Set operators (UNION, INTERSECT, EXCEPT) remain as is. -
stripTrivialAliases
-
asStatement
Converts a non-query node into a SELECT node. Set operators (UNION, INTERSECT, EXCEPT) and DML operators (INSERT, UPDATE, DELETE, MERGE) remain as is. -
asQueryOrValues
Converts a non-query node into a SELECT node. Set operators (UNION, INTERSECT, EXCEPT) and VALUES remain as is. -
qualifiedContext
Returns a context that always qualifies identifiers. Useful if the Context deals with just one arm of a join, yet we wish to generate a join condition that qualifies column names to disambiguate them. -
resetAlias
In join, when the left and right nodes have been generated, update their alias with 'neededAlias' if not null. -
resetAlias
Sets the alias of the join or correlate just created.- Parameters:
alias
- New aliastype
- type of the node associated with the alias
-
SqlImplementor.visitInput(RelNode, int, Set)
, then create a builder usingbuilder(RelNode)
.