public class SqlImplementor.Result extends Object
| Modifier and Type | Field and Description |
|---|---|
private Map<String,RelDataType> |
aliases |
(package private) Expressions.FluentList<SqlImplementor.Clause> |
clauses |
private String |
neededAlias |
private RelDataType |
neededType |
(package private) SqlNode |
node |
| Constructor and Description |
|---|
Result(SqlNode node,
Collection<SqlImplementor.Clause> clauses,
String neededAlias,
RelDataType neededType,
Map<String,RelDataType> aliases) |
| Modifier and Type | Method and Description |
|---|---|
SqlNode |
asFrom()
Returns a node that can be included in the FROM clause or a JOIN.
|
SqlNode |
asQueryOrValues()
Converts a non-query node into a SELECT node.
|
SqlSelect |
asSelect()
Converts a non-query node into a SELECT node.
|
SqlNode |
asStatement()
Converts a non-query node into a SELECT node.
|
SqlImplementor.Builder |
builder(RelNode rel,
SqlImplementor.Clause... clauses)
Once you have a Result of implementing a child relational expression,
call this method to create a Builder to implement the current relational
expression by adding additional clauses to the SQL query.
|
private boolean |
hasNestedAggregations(LogicalAggregate rel) |
SqlImplementor.Clause |
maxClause() |
SqlImplementor.Context |
qualifiedContext()
Returns a context that always qualifies identifiers.
|
SqlImplementor.Result |
resetAlias()
In join, when the left and right nodes have been generated,
update their alias with 'neededAlias' if not null.
|
SqlSelect |
subSelect() |
final SqlNode node
private final String neededAlias
private final RelDataType neededType
private final Map<String,RelDataType> aliases
final Expressions.FluentList<SqlImplementor.Clause> clauses
public Result(SqlNode node, Collection<SqlImplementor.Clause> clauses, String neededAlias, RelDataType neededType, Map<String,RelDataType> aliases)
public SqlImplementor.Builder builder(RelNode rel, SqlImplementor.Clause... clauses)
You need to declare which clauses you intend to add. If the clauses are "later", you can add to the same query. For example, "GROUP BY" comes after "WHERE". But if they are the same or earlier, this method will start a new SELECT that wraps the previous result.
When you have called
SqlImplementor.Builder.setSelect(SqlNodeList),
SqlImplementor.Builder.setWhere(SqlNode) etc. call
SqlImplementor.result(SqlNode, Collection, RelNode, Map)
to fix the new query.
rel - Relational expression being implementedclauses - Clauses that will be generated to implement current
relational expressionprivate boolean hasNestedAggregations(LogicalAggregate rel)
public SqlImplementor.Clause maxClause()
public SqlNode asFrom()
public SqlSelect subSelect()
public SqlSelect asSelect()
public SqlNode asStatement()
public SqlNode asQueryOrValues()
public SqlImplementor.Context qualifiedContext()
public SqlImplementor.Result resetAlias()
Copyright © 2012–2018 The Apache Software Foundation. All rights reserved.