org.apache.lens.server.api.driver
Class DriverQueryPlan

java.lang.Object
  extended by org.apache.lens.server.api.driver.DriverQueryPlan
Direct Known Subclasses:
HiveQueryPlan

public abstract class DriverQueryPlan
extends Object

The Class DriverQueryPlan.


Nested Class Summary
static class DriverQueryPlan.ExecMode
          The Enum ExecMode.
static class DriverQueryPlan.ScanMode
          The Enum ScanMode.
 
Constructor Summary
DriverQueryPlan()
           
 
Method Summary
abstract  QueryCost getCost()
          Get the cost associated with the plan
 DriverQueryPlan.ExecMode getExecMode()
          Get the exec mode
 Double getFilterWeight()
          Set the weight associated with filter expressions.
 Double getGbyWeight()
          Set the weight associated with group by expressions.
 QueryHandle getHandle()
          Deprecated.  
 Double getHavingWeight()
          Set the weight associated with having expressions.
 Double getJoinWeight()
          Get the weight associated with joins
 int getNumAggreagateExprs()
           
 int getNumFilters()
          Get the number of filters in query
 int getNumGbys()
          Get the number of group by expressions on query
 int getNumHaving()
          Get the number of having expressions on query
 int getNumJoins()
          Get number of joins in the query
 int getNumOrderBys()
          Get the number of order by expressions on query
 int getNumSelDistincts()
          Get the number distinct select expressions
 int getNumSels()
          Get the number of select expressions
 Double getObyWeight()
          Get the weight associated with order by expressions.
 Map<String,List<String>> getPartitions()
          Get list of partitions queried for each table
abstract  String getPlan()
          Get the query plan
 QueryPrepareHandle getPrepareHandle()
           
 String getResultDestination()
          Get the result destination
 DriverQueryPlan.ScanMode getScanMode()
          Get the scan mode.
 Double getSelectWeight()
          Get the weight associated with select expressions.
 List<String> getTablesQueried()
          Get the list of tables to be queried
 Double getTableWeight(String tableName)
          Get the weight of the table.
 Map<String,Double> getTableWeights()
          Get the table weights
 boolean hasSubQuery()
          Get if the query has a subquery or not.
 void setPrepareHandle(QueryPrepareHandle handle)
           
 QueryPlan toQueryPlan()
          To query plan.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DriverQueryPlan

public DriverQueryPlan()
Method Detail

getPlan

public abstract String getPlan()
Get the query plan

Returns:
The string representation of the plan

getCost

public abstract QueryCost getCost()
Get the cost associated with the plan

Returns:
QueryCost object

getNumGbys

public int getNumGbys()
Get the number of group by expressions on query

Returns:
the numGbys

getNumSels

public int getNumSels()
Get the number of select expressions

Returns:
the numSels

getNumSelDistincts

public int getNumSelDistincts()
Get the number distinct select expressions

Returns:
the numSelDi

getNumJoins

public int getNumJoins()
Get number of joins in the query

Returns:
the numJoins

getNumHaving

public int getNumHaving()
Get the number of having expressions on query

Returns:
the numHaving

getNumOrderBys

public int getNumOrderBys()
Get the number of order by expressions on query

Returns:
the numObys

getTablesQueried

public List<String> getTablesQueried()
Get the list of tables to be queried

Returns:
the tablesQueried

getNumFilters

public int getNumFilters()
Get the number of filters in query

Returns:
the numFilters

hasSubQuery

public boolean hasSubQuery()
Get if the query has a subquery or not.

Returns:
the hasSubQuery true if query has subquery, false otherwise

getResultDestination

public String getResultDestination()
Get the result destination

Returns:
the resultDestination The destination can be another table or filesystem path or inmemory result

getTableWeights

public Map<String,Double> getTableWeights()
Get the table weights

Returns:
the tableWeights

getTableWeight

public Double getTableWeight(String tableName)
Get the weight of the table.

Parameters:
tableName - the table name
Returns:
the weight

getExecMode

public DriverQueryPlan.ExecMode getExecMode()
Get the exec mode

Returns:
the DriverQueryPlan.ExecMode

getScanMode

public DriverQueryPlan.ScanMode getScanMode()
Get the scan mode.

Returns:
the DriverQueryPlan.ScanMode

getJoinWeight

public Double getJoinWeight()
Get the weight associated with joins

Returns:
the joinWeight

getGbyWeight

public Double getGbyWeight()
Set the weight associated with group by expressions.

Returns:
the gbyWeight

getFilterWeight

public Double getFilterWeight()
Set the weight associated with filter expressions.

Returns:
the filterWeight

getObyWeight

public Double getObyWeight()
Get the weight associated with order by expressions.

Returns:
the obyWeight

getHavingWeight

public Double getHavingWeight()
Set the weight associated with having expressions.

Returns:
the havingWeight

getSelectWeight

public Double getSelectWeight()
Get the weight associated with select expressions.

Returns:
the selectWeight

getHandle

public QueryHandle getHandle()
Deprecated. 

Returns:
the handle

getPrepareHandle

public QueryPrepareHandle getPrepareHandle()
Returns:
the prepare handle

setPrepareHandle

public void setPrepareHandle(QueryPrepareHandle handle)
Parameters:
handle - the handle to set

getNumAggreagateExprs

public int getNumAggreagateExprs()

getPartitions

public Map<String,List<String>> getPartitions()
Get list of partitions queried for each table

Returns:

toQueryPlan

public QueryPlan toQueryPlan()
                      throws UnsupportedEncodingException
To query plan.

Returns:
the query plan
Throws:
UnsupportedEncodingException - the unsupported encoding exception


Copyright © 2014–2015 Apache Software Foundation. All rights reserved.