|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.sf.saffron.oj.xlat.InternalTranslator
Converts an Openjava expression
into a
row-expression
.
For example, the filter expression emp.sal > 50
from
select * from emp where emp.sal > 50
becomes
$input0.sal > 50
. And emp.deptno ==
dept.deptno
becomes $input.$0.deptno ==
$input.$1.deptno
.
Any queries are wrapped as InternalTranslator.RexQuery
nodes. They will be expanded
later.
AggInternalTranslator
Nested Class Summary | |
(package private) static class |
InternalTranslator.RexQuery
Temporary holder for a scalar query which has not been translated yet. |
Field Summary | |
(package private) SaffronRel[] |
inputs
|
private static HashMap |
mapUnaryOpToRex
|
protected QueryEnvironment |
qenv
|
(package private) QueryInfo |
queryInfo
|
protected JavaRexBuilder |
rexBuilder
|
Constructor Summary | |
(package private) |
InternalTranslator(QueryInfo queryInfo,
SaffronRel[] inputs,
JavaRexBuilder rexBuilder)
|
Method Summary | |
private SqlOperator |
binaryOpToSql(int op)
Translates an operator code from Openjava ( BinaryExpression.DIVIDE et cetera) to row-expression. |
private static HashMap |
createBinaryMap()
|
private static HashMap |
createUnaryMap()
|
RexNode |
evaluateDown(BinaryExpression p)
|
RexNode |
evaluateDown(ConditionalExpression p)
|
RexNode |
evaluateDown(FieldAccess p)
|
private RexNode |
evaluateDown(Literal literal)
|
RexNode |
evaluateDown(MethodCall call)
|
RexNode |
evaluateDown(UnaryExpression p)
|
RexNode |
evaluateDown(Variable p)
|
Expression |
evaluateUp(AliasedExpression p)
|
RexNode |
go(ParseTree p)
|
(package private) QueryInfo.LookupResult |
lookupExp(String name)
Returns an expression with which to reference a from-list item. |
private SqlOperator |
translateFun(String name)
|
private RexKind |
unaryOpToRex(int op)
Translates an operator code from Openjava ( UnaryExpression.BIT_NOT et cetera) to row-expression. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
QueryInfo queryInfo
SaffronRel[] inputs
protected final JavaRexBuilder rexBuilder
protected final QueryEnvironment qenv
private static final HashMap mapUnaryOpToRex
Constructor Detail |
InternalTranslator(QueryInfo queryInfo, SaffronRel[] inputs, JavaRexBuilder rexBuilder)
Method Detail |
private static HashMap createUnaryMap()
private static HashMap createBinaryMap()
public RexNode go(ParseTree p)
private RexNode evaluateDown(Literal literal)
public RexNode evaluateDown(FieldAccess p)
public RexNode evaluateDown(UnaryExpression p)
private RexKind unaryOpToRex(int op)
UnaryExpression.BIT_NOT
et cetera) to row-expression.
private SqlOperator binaryOpToSql(int op)
BinaryExpression.DIVIDE
et cetera) to row-expression.
public RexNode evaluateDown(BinaryExpression p)
public RexNode evaluateDown(ConditionalExpression p)
public RexNode evaluateDown(MethodCall call)
private SqlOperator translateFun(String name)
public RexNode evaluateDown(Variable p)
public Expression evaluateUp(AliasedExpression p)
QueryInfo.LookupResult lookupExp(String name)
name
- the alias of the from item
Variable
or FieldAccess
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |