@ VisibleForTesting public Object optimize ( SymbolResolver inputs ) { checkState ( optimize , "optimize(SymbolResolver) not allowed for interpreter" ) ; Object result = expression . accept ( visitor , inputs ) ; if ( ! ( result instanceof RowExpression ) ) { // constant folding return result ; } return new ExpressionOptimizer ( metadata . getFunctionManager ( ) , session ) . optimize ( ( RowExpression ) result ) ; }
For test only ; convenient to replace symbol with constants . Production code should not replace any symbols ; use the interface above