|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eigenbase.sql2rel.SqlToRelConverter.AggConverter
protected class SqlToRelConverter.AggConverter
Converts expressions to aggregates.
Consider the expression SELECT deptno, SUM(2 * sal) FROM emp GROUP BY deptno Then
| Field Summary | |
|---|---|
private Map<AggregateCall,RexNode> |
aggCallMapping
|
private List<AggregateCall> |
aggCalls
|
private Map<SqlNode,RexNode> |
aggMapping
|
private SqlToRelConverter.Blackboard |
bb
|
private List<String> |
convertedInputExprNames
Names of convertedInputExprs, where the expressions are
simple mappings to input fields. |
private List<RexNode> |
convertedInputExprs
Input expressions for the group columns and aggregates, in RexNode format. |
private SqlNodeList |
groupExprs
The group-by expressions, in SqlNode format. |
private List<RexInputRef> |
inputRefs
|
private Map<String,String> |
nameMap
|
| Constructor Summary | |
|---|---|
SqlToRelConverter.AggConverter(SqlToRelConverter.Blackboard bb,
SqlSelect select)
Creates an AggConverter. |
|
| Method Summary | |
|---|---|
private void |
addExpr(RexNode expr,
String name)
Adds an expression, deducing an appropriate name if possible. |
void |
addGroupExpr(SqlNode expr)
|
List<AggregateCall> |
getAggCalls()
|
List<RexNode> |
getPreExprs()
|
List<String> |
getPreNames()
|
RelDataTypeFactory |
getTypeFactory()
|
RexNode |
lookupAggregates(SqlCall call)
|
RexNode |
lookupGroupExpr(SqlNode expr)
If an expression is structurally identical to one of the group-by expressions, returns a reference to the expression, otherwise returns null. |
private int |
lookupOrCreateGroupExpr(RexNode expr)
|
Void |
visit(SqlCall call)
Visits a call to a SqlOperator. |
Void |
visit(SqlDataTypeSpec type)
Visits a datatype specification. |
Void |
visit(SqlDynamicParam param)
Visits a dynamic parameter. |
Void |
visit(SqlIdentifier id)
Visits an identifier. |
Void |
visit(SqlIntervalQualifier intervalQualifier)
Visits an interval qualifier |
Void |
visit(SqlLiteral lit)
Visits a literal. |
Void |
visit(SqlNodeList nodeList)
Visits a list of SqlNode objects. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final SqlToRelConverter.Blackboard bb
private final Map<String,String> nameMap
private final SqlNodeList groupExprs
SqlNode format.
private final List<RexNode> convertedInputExprs
RexNode format. The first elements of the list correspond to the
elements in groupExprs; the remaining elements are for
aggregates.
private final List<String> convertedInputExprNames
convertedInputExprs, where the expressions are
simple mappings to input fields.
private final List<RexInputRef> inputRefs
private final List<AggregateCall> aggCalls
private final Map<SqlNode,RexNode> aggMapping
private final Map<AggregateCall,RexNode> aggCallMapping
| Constructor Detail |
|---|
public SqlToRelConverter.AggConverter(SqlToRelConverter.Blackboard bb,
SqlSelect select)
The select parameter provides enough context to name
aggregate calls which are top-level select list items.
bb - Blackboardselect - Query being translated; provides context to give| Method Detail |
|---|
public void addGroupExpr(SqlNode expr)
private void addExpr(RexNode expr,
String name)
expr - Expressionname - Suggested namepublic Void visit(SqlIdentifier id)
SqlVisitor
visit in interface SqlVisitor<Void>id - identifierSqlIdentifier.accept(SqlVisitor)public Void visit(SqlNodeList nodeList)
SqlVisitorSqlNode objects.
visit in interface SqlVisitor<Void>nodeList - list of nodesSqlNodeList.accept(SqlVisitor)public Void visit(SqlLiteral lit)
SqlVisitor
visit in interface SqlVisitor<Void>lit - LiteralSqlLiteral.accept(SqlVisitor)public Void visit(SqlDataTypeSpec type)
SqlVisitor
visit in interface SqlVisitor<Void>type - datatype specificationSqlDataTypeSpec.accept(SqlVisitor)public Void visit(SqlDynamicParam param)
SqlVisitor
visit in interface SqlVisitor<Void>param - Dynamic parameterSqlDynamicParam.accept(SqlVisitor)public Void visit(SqlIntervalQualifier intervalQualifier)
SqlVisitor
visit in interface SqlVisitor<Void>intervalQualifier - Interval qualifierSqlIntervalQualifier.accept(SqlVisitor)public Void visit(SqlCall call)
SqlVisitorSqlOperator.
visit in interface SqlVisitor<Void>call - CallSqlCall.accept(SqlVisitor)private int lookupOrCreateGroupExpr(RexNode expr)
public RexNode lookupGroupExpr(SqlNode expr)
public RexNode lookupAggregates(SqlCall call)
public List<RexNode> getPreExprs()
public List<String> getPreNames()
public List<AggregateCall> getAggCalls()
public RelDataTypeFactory getTypeFactory()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||