net.sf.farrago.query
Class FarragoReentrantStmtExecutor

java.lang.Object
  extended by net.sf.farrago.query.FarragoReentrantStmt
      extended by net.sf.farrago.query.FarragoReentrantStmtExecutor
Direct Known Subclasses:
FarragoReduceExpressionsRule.ReentrantValuesStmt, FarragoReentrantSubquery

public abstract class FarragoReentrantStmtExecutor
extends FarragoReentrantStmt

FarragoReentrantStmtExecutor extends FarragoReentrantStmt by providing a base method for executing a query plan and returning its result.

Version:
$Id: //open/dev/farrago/src/net/sf/farrago/query/FarragoReentrantStmtExecutor.java#4 $
Author:
John V. Sichi

Field Summary
protected  boolean failed
           
protected  List<RexNode> results
           
protected  RexBuilder rexBuilder
           
private static Logger tracer
           
 
Constructor Summary
FarragoReentrantStmtExecutor(FarragoSessionStmtContext rootStmtContext, RexBuilder rexBuilder, List<RexNode> results)
          Constructs a FarragoReentrantStmtExecutor.
 
Method Summary
private  SqlTypeName broadenType(SqlTypeName typeName)
           
protected  void executePlan(RelNode plan, List<RexNode> exprs, boolean isExists, boolean excludeReduceExprRule)
          Executes a query given a plan containing the corresponding RelNode tree.
private  void getResultRow(List<RexNode> exprs, ResultSet resultSet)
           
 
Methods inherited from class net.sf.farrago.query.FarragoReentrantStmt
execute, executeImpl, getPreparingStmt, getRootStmtContext, getStmtContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tracer

private static final Logger tracer

rexBuilder

protected final RexBuilder rexBuilder

results

protected final List<RexNode> results

failed

protected boolean failed
Constructor Detail

FarragoReentrantStmtExecutor

FarragoReentrantStmtExecutor(FarragoSessionStmtContext rootStmtContext,
                             RexBuilder rexBuilder,
                             List<RexNode> results)
Constructs a FarragoReentrantStmtExecutor.

Parameters:
rootStmtContext - statement context for the root statement of this reentrant statement
rexBuilder - rex builder
results - the resulting evaluated expressions
Method Detail

executePlan

protected void executePlan(RelNode plan,
                           List<RexNode> exprs,
                           boolean isExists,
                           boolean excludeReduceExprRule)
                    throws Exception
Executes a query given a plan containing the corresponding RelNode tree.

Parameters:
plan - the query to be executed
exprs - list of expressions that will be evaluated
isExists - whether the query being executed is part of an EXISTS expression; in this case, the result is either a TRUE or FALSE boolean literal, depending on whether the query returns zero or at least one row
excludeReduceExprRule - true if this execution is already being done to reduce individual expressions
Throws:
Exception

getResultRow

private void getResultRow(List<RexNode> exprs,
                          ResultSet resultSet)
                   throws Exception
Throws:
Exception

broadenType

private SqlTypeName broadenType(SqlTypeName typeName)