Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
com.cloudera.impala.analysis.InlineViewRef Class Reference
Inheritance diagram for com.cloudera.impala.analysis.InlineViewRef:
Collaboration diagram for com.cloudera.impala.analysis.InlineViewRef:

Public Member Functions

 InlineViewRef (String alias, QueryStmt queryStmt)
 
 InlineViewRef (String alias, QueryStmt queryStmt, List< String > colLabels)
 
 InlineViewRef (View view, TableRef origTblRef)
 
 InlineViewRef (InlineViewRef other)
 
void analyze (Analyzer analyzer) throws AnalysisException
 
boolean createAuxPredicate (Expr e)
 
TupleDescriptor createTupleDescriptor (Analyzer analyzer) throws AnalysisException
 
List< TupleIdgetMaterializedTupleIds ()
 
Analyzer getAnalyzer ()
 
ExprSubstitutionMap getSmap ()
 
ExprSubstitutionMap getBaseTblSmap ()
 
QueryStmt getViewStmt ()
 
void setRewrittenViewStmt (QueryStmt stmt)
 
List< String > getExplicitColLabels ()
 
List< String > getColLabels ()
 
TableRef clone ()
 
JoinOperator getJoinOp ()
 
boolean isChildRef ()
 
List< String > getPath ()
 
Path getResolvedPath ()
 
String[] getAliases ()
 
String getUniqueAlias ()
 
boolean hasExplicitAlias ()
 
String getExplicitAlias ()
 
Table getTable ()
 
ArrayList< String > getJoinHints ()
 
Expr getOnClause ()
 
List< String > getUsingClause ()
 
void setJoinOp (JoinOperator op)
 
void setOnClause (Expr e)
 
void setUsingClause (List< String > colNames)
 
TableRef getLeftTblRef ()
 
void setLeftTblRef (TableRef leftTblRef)
 
void setJoinHints (ArrayList< String > hints)
 
boolean isBroadcastJoin ()
 
boolean isPartitionedJoin ()
 
List< TupleIdgetOnClauseTupleIds ()
 
boolean isResolved ()
 
TupleDescriptor getDesc ()
 
TupleId getId ()
 
List< TupleIdgetAllMaterializedTupleIds ()
 
List< TupleIdgetAllTupleIds ()
 
void analyzeJoin (Analyzer analyzer) throws AnalysisException
 
void invertJoin (List< Pair< TableRef, PlanNode >> refPlans, Analyzer analyzer)
 
String toSql ()
 
Privilege getPrivilegeRequirement ()
 

Protected Member Functions

String tableRefToSql ()
 
void setJoinAttrs (TableRef other)
 

Protected Attributes

QueryStmt queryStmt_
 
Analyzer inlineViewAnalyzer_
 
final ArrayList< TupleIdmaterializedTupleIds_ = Lists.newArrayList()
 
final ExprSubstitutionMap smap_ = new ExprSubstitutionMap()
 
final ExprSubstitutionMap baseTblSmap_ = new ExprSubstitutionMap()
 
List< String > rawPath_
 
Path resolvedPath_
 
String[] aliases_
 
boolean hasExplicitAlias_
 
JoinOperator joinOp_
 
ArrayList< String > joinHints_
 
Expr onClause_
 
List< String > usingColNames_
 
TableRef leftTblRef_
 
boolean isAnalyzed_
 
List< TupleIdonClauseTupleIds_ = Lists.newArrayList()
 
TupleDescriptor desc_
 

Private Attributes

final View view_
 
List< String > explicitColLabels_
 

Static Private Attributes

static final Logger LOG = LoggerFactory.getLogger(SelectStmt.class)
 

Detailed Description

An inline view is a query statement with an alias. Inline views can be parsed directly from a query string or represent a reference to a local or catalog view.

Definition at line 37 of file InlineViewRef.java.

Constructor & Destructor Documentation

com.cloudera.impala.analysis.InlineViewRef.InlineViewRef ( String  alias,
QueryStmt  queryStmt 
)
inline

C'tor for creating inline views parsed directly from the a query string.

Definition at line 68 of file InlineViewRef.java.

References com.cloudera.impala.analysis.InlineViewRef.queryStmt_, and com.cloudera.impala.analysis.InlineViewRef.view_.

Referenced by com.cloudera.impala.analysis.InlineViewRef.clone().

com.cloudera.impala.analysis.InlineViewRef.InlineViewRef ( String  alias,
QueryStmt  queryStmt,
List< String >  colLabels 
)
inline
com.cloudera.impala.analysis.InlineViewRef.InlineViewRef ( InlineViewRef  other)
inline

Member Function Documentation

void com.cloudera.impala.analysis.TableRef.analyzeJoin ( Analyzer  analyzer) throws AnalysisException
inlineinherited

Analyze the join clause. The join clause can only be analyzed after the left table has been analyzed and the TupleDescriptor (desc) of this table has been created.

Definition at line 339 of file TableRef.java.

References com.cloudera.impala.analysis.TableRef.analyzeJoinHints(), com.cloudera.impala.analysis.Path.createRawPath(), com.cloudera.impala.analysis.JoinOperator.CROSS_JOIN, com.cloudera.impala.analysis.TableRef.desc_, com.cloudera.impala.analysis.JoinOperator.FULL_OUTER_JOIN, com.cloudera.impala.analysis.Expr.getConjuncts(), com.cloudera.impala.analysis.TableRef.getDesc(), com.cloudera.impala.analysis.TableRef.getId(), com.cloudera.impala.analysis.TableRef.getJoinOp(), com.cloudera.impala.analysis.TableRef.getUniqueAlias(), com.cloudera.impala.analysis.Expr.isAggregatePredicate(), com.cloudera.impala.analysis.TableRef.isBroadcastJoin_, com.cloudera.impala.analysis.TableRef.isChildRef(), com.cloudera.impala.analysis.TableRef.joinOp_, com.cloudera.impala.analysis.JoinOperator.LEFT_ANTI_JOIN, com.cloudera.impala.analysis.JoinOperator.LEFT_OUTER_JOIN, com.cloudera.impala.analysis.JoinOperator.LEFT_SEMI_JOIN, com.cloudera.impala.analysis.TableRef.leftTblRef_, com.cloudera.impala.analysis.JoinOperator.NULL_AWARE_LEFT_ANTI_JOIN, com.cloudera.impala.analysis.TableRef.onClause_, com.cloudera.impala.analysis.Path.resolve(), com.cloudera.impala.analysis.JoinOperator.RIGHT_ANTI_JOIN, com.cloudera.impala.analysis.JoinOperator.RIGHT_OUTER_JOIN, com.cloudera.impala.analysis.JoinOperator.RIGHT_SEMI_JOIN, com.cloudera.impala.analysis.TableRef.toSql(), com.cloudera.impala.analysis.JoinOperator.toString(), and com.cloudera.impala.analysis.TableRef.usingColNames_.

Referenced by com.cloudera.impala.analysis.BaseTableRef.analyze(), com.cloudera.impala.analysis.CollectionTableRef.analyze(), and com.cloudera.impala.analysis.InlineViewRef.analyze().

boolean com.cloudera.impala.analysis.InlineViewRef.createAuxPredicate ( Expr  e)
inline

Checks if an auxiliary predicate should be created for an expr. Returns False if the inline view has a SELECT stmt with analytic functions and the expr is not in the common partition exprs of all the analytic functions computed by this inline view.

Definition at line 195 of file InlineViewRef.java.

Referenced by com.cloudera.impala.analysis.InlineViewRef.analyze().

TupleDescriptor com.cloudera.impala.analysis.InlineViewRef.createTupleDescriptor ( Analyzer  analyzer) throws AnalysisException
inline

Create and register a non-materialized tuple descriptor for this inline view. This method is called from the analyzer when registering this inline view. Create a non-materialized tuple descriptor for this inline view.

Definition at line 210 of file InlineViewRef.java.

References com.cloudera.impala.analysis.InlineViewRef.getColLabels(), com.cloudera.impala.analysis.Expr.getType(), and com.cloudera.impala.analysis.TableRef.getUniqueAlias().

String [] com.cloudera.impala.analysis.TableRef.getAliases ( )
inlineinherited

Returns all legal aliases of this table ref.

Definition at line 205 of file TableRef.java.

References com.cloudera.impala.analysis.TableRef.aliases_.

List<TupleId> com.cloudera.impala.analysis.TableRef.getAllMaterializedTupleIds ( )
inlineinherited

Return the list of tuple ids materialized by the full sequence of table refs up to this one.

Definition at line 278 of file TableRef.java.

References com.cloudera.impala.analysis.TableRef.getMaterializedTupleIds(), and com.cloudera.impala.analysis.TableRef.leftTblRef_.

List<TupleId> com.cloudera.impala.analysis.TableRef.getAllTupleIds ( )
inlineinherited

Return the list of tuple ids of the full sequence of table refs up to this one.

Definition at line 292 of file TableRef.java.

References com.cloudera.impala.analysis.TableRef.isAnalyzed_, and com.cloudera.impala.analysis.TableRef.leftTblRef_.

Referenced by com.cloudera.impala.analysis.Analyzer.canEvalPredicate().

ExprSubstitutionMap com.cloudera.impala.analysis.InlineViewRef.getBaseTblSmap ( )
inline
List<String> com.cloudera.impala.analysis.InlineViewRef.getColLabels ( )
inline
List<String> com.cloudera.impala.analysis.InlineViewRef.getExplicitColLabels ( )
inline
ArrayList<String> com.cloudera.impala.analysis.TableRef.getJoinHints ( )
inlineinherited

Definition at line 233 of file TableRef.java.

References com.cloudera.impala.analysis.TableRef.joinHints_.

TableRef com.cloudera.impala.analysis.TableRef.getLeftTblRef ( )
inlineinherited
List<TupleId> com.cloudera.impala.analysis.InlineViewRef.getMaterializedTupleIds ( )
inline
Expr com.cloudera.impala.analysis.TableRef.getOnClause ( )
inlineinherited

Definition at line 234 of file TableRef.java.

References com.cloudera.impala.analysis.TableRef.onClause_.

List<TupleId> com.cloudera.impala.analysis.TableRef.getOnClauseTupleIds ( )
inlineinherited
List<String> com.cloudera.impala.analysis.TableRef.getPath ( )
inlineinherited

Definition at line 199 of file TableRef.java.

References com.cloudera.impala.analysis.TableRef.rawPath_.

Privilege com.cloudera.impala.analysis.TableRef.getPrivilegeRequirement ( )
inlineinherited
Path com.cloudera.impala.analysis.TableRef.getResolvedPath ( )
inlineinherited
ExprSubstitutionMap com.cloudera.impala.analysis.InlineViewRef.getSmap ( )
inline
Table com.cloudera.impala.analysis.TableRef.getTable ( )
inlineinherited
String com.cloudera.impala.analysis.TableRef.getUniqueAlias ( )
inlineinherited
List<String> com.cloudera.impala.analysis.TableRef.getUsingClause ( )
inlineinherited
boolean com.cloudera.impala.analysis.TableRef.hasExplicitAlias ( )
inlineinherited

Returns true if this table ref has an explicit alias. Note that getAliases().length() == 1 does not imply an explicit alias because nested collection refs have only a single implicit alias.

Definition at line 219 of file TableRef.java.

References com.cloudera.impala.analysis.TableRef.hasExplicitAlias_.

Referenced by com.cloudera.impala.analysis.BaseTableRef.BaseTableRef(), com.cloudera.impala.analysis.CollectionTableRef.CollectionTableRef(), com.cloudera.impala.analysis.TableRef.getExplicitAlias(), and com.cloudera.impala.analysis.InlineViewRef.InlineViewRef().

void com.cloudera.impala.analysis.TableRef.invertJoin ( List< Pair< TableRef, PlanNode >>  refPlans,
Analyzer  analyzer 
)
inlineinherited

Inverts the join whose rhs is represented by this table ref. If necessary, this function modifies the registered analysis state associated with this table ref, as well as the chain of left table references in refPlans as appropriate. Requires that this is the very first join in a series of joins.

Definition at line 447 of file TableRef.java.

References com.cloudera.impala.analysis.TableRef.getJoinOp(), com.cloudera.impala.analysis.Analyzer.invertOuterJoinState(), com.cloudera.impala.analysis.JoinOperator.isOuterJoin(), com.cloudera.impala.analysis.TableRef.joinOp_, com.cloudera.impala.analysis.TableRef.leftTblRef_, and com.cloudera.impala.analysis.TableRef.onClause_.

boolean com.cloudera.impala.analysis.TableRef.isBroadcastJoin ( )
inlineinherited
boolean com.cloudera.impala.analysis.TableRef.isChildRef ( )
inlineinherited

Returns true if the path of this table ref is is rooted at a registered parent ref.

Definition at line 197 of file TableRef.java.

Referenced by com.cloudera.impala.analysis.TableRef.analyzeJoin().

boolean com.cloudera.impala.analysis.TableRef.isPartitionedJoin ( )
inlineinherited
boolean com.cloudera.impala.analysis.TableRef.isResolved ( )
inlineinherited

Definition at line 245 of file TableRef.java.

void com.cloudera.impala.analysis.TableRef.setJoinAttrs ( TableRef  other)
inlineprotectedinherited

Set this table's context-dependent join attributes from the given table. Does not clone the attributes.

Definition at line 181 of file TableRef.java.

Referenced by com.cloudera.impala.analysis.InlineViewRef.InlineViewRef().

void com.cloudera.impala.analysis.TableRef.setJoinHints ( ArrayList< String >  hints)
inlineinherited

Definition at line 241 of file TableRef.java.

void com.cloudera.impala.analysis.TableRef.setJoinOp ( JoinOperator  op)
inlineinherited

Definition at line 236 of file TableRef.java.

void com.cloudera.impala.analysis.TableRef.setLeftTblRef ( TableRef  leftTblRef)
inlineinherited

Definition at line 240 of file TableRef.java.

void com.cloudera.impala.analysis.TableRef.setOnClause ( Expr  e)
inlineinherited

Definition at line 237 of file TableRef.java.

void com.cloudera.impala.analysis.InlineViewRef.setRewrittenViewStmt ( QueryStmt  stmt)
inline
void com.cloudera.impala.analysis.TableRef.setUsingClause ( List< String >  colNames)
inlineinherited

Definition at line 238 of file TableRef.java.

Member Data Documentation

final ExprSubstitutionMap com.cloudera.impala.analysis.InlineViewRef.baseTblSmap_ = new ExprSubstitutionMap()
protected
boolean com.cloudera.impala.analysis.TableRef.hasExplicitAlias_
protectedinherited
Analyzer com.cloudera.impala.analysis.InlineViewRef.inlineViewAnalyzer_
protected
final Logger com.cloudera.impala.analysis.InlineViewRef.LOG = LoggerFactory.getLogger(SelectStmt.class)
staticprivate

Definition at line 38 of file InlineViewRef.java.

final ArrayList<TupleId> com.cloudera.impala.analysis.InlineViewRef.materializedTupleIds_ = Lists.newArrayList()
protected
List<TupleId> com.cloudera.impala.analysis.TableRef.onClauseTupleIds_ = Lists.newArrayList()
protectedinherited
QueryStmt com.cloudera.impala.analysis.InlineViewRef.queryStmt_
protected
final ExprSubstitutionMap com.cloudera.impala.analysis.InlineViewRef.smap_ = new ExprSubstitutionMap()
protected
List<String> com.cloudera.impala.analysis.TableRef.usingColNames_
protectedinherited

The documentation for this class was generated from the following file: