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

Public Member Functions

 TableRef (List< String > path, String alias)
 
void analyze (Analyzer analyzer) throws AnalysisException
 
TupleDescriptor createTupleDescriptor (Analyzer analyzer) throws AnalysisException
 
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< TupleIdgetMaterializedTupleIds ()
 
List< TupleIdgetAllMaterializedTupleIds ()
 
List< TupleIdgetAllTupleIds ()
 
void analyzeJoin (Analyzer analyzer) throws AnalysisException
 
void invertJoin (List< Pair< TableRef, PlanNode >> refPlans, Analyzer analyzer)
 
String toSql ()
 
Privilege getPrivilegeRequirement ()
 
TableRef clone ()
 

Protected Member Functions

 TableRef (TableRef other)
 
void setJoinAttrs (TableRef other)
 
String tableRefToSql ()
 

Protected Attributes

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 Member Functions

void analyzeJoinHints (Analyzer analyzer) throws AnalysisException
 

Private Attributes

boolean isBroadcastJoin_
 
boolean isPartitionedJoin_
 

Detailed Description

Superclass of all table references, including references to views, base tables (Hdfs, HBase or DataSource tables), and nested collections. Contains the join specification. An instance of a TableRef (and not a subclass thereof) represents an unresolved table reference that must be resolved during analysis. All resolved table references are subclasses of TableRef. TODO: Rename this class to CollectionRef and re-consider the naming of all subclasses.

Definition at line 45 of file TableRef.java.

Constructor & Destructor Documentation

com.cloudera.impala.analysis.TableRef.TableRef ( TableRef  other)
inlineprotected

Member Function Documentation

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

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().

TableRef com.cloudera.impala.analysis.TableRef.clone ( )
inline

Definition at line 502 of file TableRef.java.

References com.cloudera.impala.analysis.TableRef.TableRef().

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

Creates and returns a empty TupleDescriptor registered with the analyzer based on the resolvedPath_. This method is called from the analyzer when registering this table reference.

Definition at line 169 of file TableRef.java.

References com.cloudera.impala.analysis.TableRef.getUniqueAlias(), and com.cloudera.impala.analysis.TableRef.resolvedPath_.

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

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 ( )
inline

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 ( )
inline

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().

ArrayList<String> com.cloudera.impala.analysis.TableRef.getJoinHints ( )
inline

Definition at line 233 of file TableRef.java.

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

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

Definition at line 234 of file TableRef.java.

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

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

Definition at line 199 of file TableRef.java.

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

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

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 
)
inline

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 ( )
inline
boolean com.cloudera.impala.analysis.TableRef.isChildRef ( )
inline

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 ( )
inline
boolean com.cloudera.impala.analysis.TableRef.isResolved ( )
inline

Definition at line 245 of file TableRef.java.

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

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)
inline

Definition at line 241 of file TableRef.java.

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

Definition at line 236 of file TableRef.java.

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

Definition at line 240 of file TableRef.java.

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

Definition at line 237 of file TableRef.java.

void com.cloudera.impala.analysis.TableRef.setUsingClause ( List< String >  colNames)
inline

Definition at line 238 of file TableRef.java.

String com.cloudera.impala.analysis.TableRef.tableRefToSql ( )
inlineprotected

Member Data Documentation

boolean com.cloudera.impala.analysis.TableRef.hasExplicitAlias_
protected
boolean com.cloudera.impala.analysis.TableRef.isBroadcastJoin_
private
boolean com.cloudera.impala.analysis.TableRef.isPartitionedJoin_
private
List<TupleId> com.cloudera.impala.analysis.TableRef.onClauseTupleIds_ = Lists.newArrayList()
protected

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