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

Public Member Functions

 ExprSubstitutionMap ()
 
 ExprSubstitutionMap (List< Expr > lhs, List< Expr > rhs)
 
void put (Expr lhsExpr, Expr rhsExpr)
 
Expr get (Expr lhsExpr)
 
boolean containsMappingFor (Expr lhsExpr)
 
void substituteLhs (ExprSubstitutionMap lhsSmap, Analyzer analyzer)
 
List< ExprgetLhs ()
 
List< ExprgetRhs ()
 
int size ()
 
String debugString ()
 
void clear ()
 

Static Public Member Functions

static ExprSubstitutionMap compose (ExprSubstitutionMap f, ExprSubstitutionMap g, Analyzer analyzer)
 
static ExprSubstitutionMap combine (ExprSubstitutionMap f, ExprSubstitutionMap g)
 

Private Member Functions

void verify ()
 

Private Attributes

List< Exprlhs_
 
List< Exprrhs_
 

Static Private Attributes

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

Detailed Description

Map of expression substitutions: lhs[i] gets substituted with rhs[i]. To support expression substitution across query blocks, rhs exprs must already be analyzed when added to this map. Otherwise, analysis of a SlotRef may fail after substitution, e.g., because the table it refers to is in a different query block that is not visible. See Expr.substitute() and related functions for details on the actual substitution.

Definition at line 20 of file ExprSubstitutionMap.java.

Constructor & Destructor Documentation

com.cloudera.impala.analysis.ExprSubstitutionMap.ExprSubstitutionMap ( )
inline
com.cloudera.impala.analysis.ExprSubstitutionMap.ExprSubstitutionMap ( List< Expr lhs,
List< Expr rhs 
)
inline

Member Function Documentation

void com.cloudera.impala.analysis.ExprSubstitutionMap.clear ( )
inline

Definition at line 150 of file ExprSubstitutionMap.java.

static ExprSubstitutionMap com.cloudera.impala.analysis.ExprSubstitutionMap.combine ( ExprSubstitutionMap  f,
ExprSubstitutionMap  g 
)
inlinestatic

Returns the union of two substitution maps. Always returns a non-null map.

Definition at line 101 of file ExprSubstitutionMap.java.

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

static ExprSubstitutionMap com.cloudera.impala.analysis.ExprSubstitutionMap.compose ( ExprSubstitutionMap  f,
ExprSubstitutionMap  g,
Analyzer  analyzer 
)
inlinestatic

Return a map which is equivalent to applying f followed by g, i.e., g(f()). Always returns a non-null map.

Definition at line 67 of file ExprSubstitutionMap.java.

References com.cloudera.impala.analysis.ExprSubstitutionMap.ExprSubstitutionMap(), and com.cloudera.impala.analysis.ExprSubstitutionMap.lhs_.

boolean com.cloudera.impala.analysis.ExprSubstitutionMap.containsMappingFor ( Expr  lhsExpr)
inline

Returns true if the smap contains a mapping for lhsExpr.

Definition at line 58 of file ExprSubstitutionMap.java.

Referenced by com.cloudera.impala.analysis.UnionStmt.createMetadata().

String com.cloudera.impala.analysis.ExprSubstitutionMap.debugString ( )
inline
Expr com.cloudera.impala.analysis.ExprSubstitutionMap.get ( Expr  lhsExpr)
inline

Returns the expr mapped to lhsExpr or null if no mapping to lhsExpr exists.

Definition at line 48 of file ExprSubstitutionMap.java.

References com.cloudera.impala.analysis.ExprSubstitutionMap.lhs_.

List<Expr> com.cloudera.impala.analysis.ExprSubstitutionMap.getLhs ( )
inline
List<Expr> com.cloudera.impala.analysis.ExprSubstitutionMap.getRhs ( )
inline
void com.cloudera.impala.analysis.ExprSubstitutionMap.put ( Expr  lhsExpr,
Expr  rhsExpr 
)
inline

Add an expr mapping. The rhsExpr must be analyzed to support correct substitution across query blocks. It is not required that the lhsExpr is analyzed.

Definition at line 39 of file ExprSubstitutionMap.java.

int com.cloudera.impala.analysis.ExprSubstitutionMap.size ( )
inline

Definition at line 122 of file ExprSubstitutionMap.java.

void com.cloudera.impala.analysis.ExprSubstitutionMap.substituteLhs ( ExprSubstitutionMap  lhsSmap,
Analyzer  analyzer 
)
inline
void com.cloudera.impala.analysis.ExprSubstitutionMap.verify ( )
inlineprivate

Verifies the internal state of this smap: Checks that the lhs_ has no duplicates, and that all rhs exprs are analyzed.

Definition at line 138 of file ExprSubstitutionMap.java.

References com.cloudera.impala.analysis.ExprSubstitutionMap.lhs_.

Member Data Documentation

final Logger com.cloudera.impala.analysis.ExprSubstitutionMap.LOG = LoggerFactory.getLogger(ExprSubstitutionMap.class)
staticprivate

Definition at line 21 of file ExprSubstitutionMap.java.


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