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

Classes

class  GlobalState
 
class  ValueTransferGraph
 

Public Member Functions

void setIsSubquery ()
 
boolean isSubquery ()
 
boolean setHasPlanHints ()
 
boolean hasPlanHints ()
 
boolean containsSubquery ()
 
 Analyzer (ImpaladCatalog catalog, TQueryCtx queryCtx, AuthorizationConfig authzConfig)
 
 Analyzer (Analyzer parentAnalyzer)
 
void setVisibleSemiJoinedTuple (TupleId tid)
 
Set< TableNamegetMissingTbls ()
 
boolean hasMissingTbls ()
 
boolean hasAncestors ()
 
Analyzer getParentAnalyzer ()
 
List< String > getWarnings ()
 
void registerLocalView (View view) throws AnalysisException
 
TupleDescriptor registerTableRef (TableRef ref) throws AnalysisException
 
TableRef resolveTableRef (TableRef tableRef) throws AnalysisException
 
void registerFullOuterJoinedConjunct (Expr e)
 
void registerFullOuterJoinedTids (List< TupleId > tids, TableRef rhsRef)
 
void registerOuterJoinedTids (List< TupleId > tids, TableRef rhsRef)
 
void registerSemiJoinedTid (TupleId tid, TableRef rhsRef)
 
TupleDescriptor getDescriptor (String tableAlias) throws AnalysisException
 
TupleDescriptor getTupleDesc (TupleId id)
 
TableRef getTableRef (TupleId tid)
 
SlotDescriptor getSlotDescriptor (String qualifiedColumnName)
 
boolean isRootAnalyzer ()
 
boolean hasEmptyResultSet ()
 
void setHasEmptyResultSet ()
 
boolean hasEmptySpjResultSet ()
 
Path resolvePath (List< String > rawPath, PathType pathType) throws AnalysisException, TableLoadingException
 
SlotDescriptor registerSlotRef (Path slotPath) throws AnalysisException
 
SlotDescriptor addSlotDescriptor (TupleDescriptor tupleDesc)
 
SlotDescriptor copySlotDescriptor (SlotDescriptor srcSlotDesc, TupleDescriptor tupleDesc)
 
void registerConjuncts (List< Expr > l)
 
void registerOnClauseConjuncts (Expr e, TableRef rhsRef)
 
void registerConjuncts (Expr e, boolean fromHavingClause)
 
void createAuxEquivPredicate (Expr lhs, Expr rhs)
 
BinaryPredicate createEqPredicate (SlotId lhsSlotId, SlotId rhsSlotId)
 
List< ExprgetUnassignedConjuncts (List< TupleId > tupleIds, boolean inclOjConjuncts)
 
boolean isOjConjunct (Expr e)
 
TableRef getFullOuterJoinRef (Expr e)
 
boolean isFullOuterJoined (Expr e)
 
List< ExprgetUnassignedConjuncts (PlanNode node)
 
boolean evalByJoin (Expr e)
 
List< ExprgetUnassignedOjConjuncts (TableRef ref)
 
TableRef getLastOjClause (TupleId id)
 
SlotDescriptor getColumnSlot (TupleDescriptor tupleDesc, Column col)
 
DescriptorTable getDescTbl ()
 
ImpaladCatalog getCatalog () throws AnalysisException
 
Set< String > getAliases ()
 
List< ExprgetEqJoinConjuncts (List< TupleId > tids, TableRef joinedTblRef)
 
boolean canEvalFullOuterJoinedConjunct (Expr e, List< TupleId > tids)
 
boolean canEvalPredicate (List< TupleId > tupleIds, Expr e)
 
boolean canEvalAntiJoinedConjunct (Expr e, List< TupleId > nodeTupleIds)
 
ArrayList< ExprgetBoundPredicates (TupleId destTid, Set< SlotId > ignoreSlots, boolean markAssigned)
 
ArrayList< ExprgetBoundPredicates (TupleId destTid)
 
void invertOuterJoinState (TableRef oldRhsTbl, TableRef newRhsTbl)
 
TupleId getTupleId (SlotId slotId)
 
void registerValueTransfer (SlotId id1, SlotId id2)
 
boolean isOuterJoined (TupleId tid)
 
boolean isOuterJoined (SlotId sid)
 
boolean isSemiJoined (TupleId tid)
 
boolean isAntiJoinedConjunct (Expr e)
 
TableRef getAntiJoinRef (Expr e)
 
boolean isFullOuterJoined (TupleId tid)
 
boolean isFullOuterJoined (SlotId sid)
 
boolean isVisible (TupleId tid)
 
boolean containsOuterJoinedTid (List< TupleId > tids)
 
void computeEquivClasses ()
 
void getEquivSlots (SlotId slotId, List< TupleId > tupleIds, List< SlotId > equivSlotIds)
 
EquivalenceClassId getEquivClassId (SlotId slotId)
 
ExprSubstitutionMap getEquivClassSmap ()
 
boolean equivSets (List< Expr > l1, List< Expr > l2)
 
boolean equivExprs (Expr e1, Expr e2)
 
List< ExprremoveRedundantExprs (List< Expr > exprs)
 
void markConjunctsAssigned (List< Expr > conjuncts)
 
void markConjunctAssigned (Expr conjunct)
 
boolean isConjunctAssigned (Expr conjunct)
 
Set< ExprIdgetAssignedConjuncts ()
 
void setAssignedConjuncts (Set< ExprId > assigned)
 
boolean hasUnassignedConjuncts ()
 
void materializeSlots (List< Expr > exprs)
 
void materializeSlots (Expr e)
 
Type getCompatibleType (Type lastCompatibleType, Expr lastCompatibleExpr, Expr expr) throws AnalysisException
 
Type castAllToCompatibleType (List< Expr > exprs) throws AnalysisException
 
void castToUnionCompatibleTypes (List< List< Expr >> exprLists) throws AnalysisException
 
String getDefaultDb ()
 
User getUser ()
 
TQueryCtx getQueryCtx ()
 
AuthorizationConfig getAuthzConfig ()
 
ListMap< TNetworkAddress > getHostIndex ()
 
ColumnLineageGraph getColumnLineageGraph ()
 
String getSerializedLineageGraph ()
 
ImmutableList< PrivilegeRequestgetPrivilegeReqs ()
 
Set< TAccessEvent > getAccessEvents ()
 
void addAccessEvent (TAccessEvent event)
 
Table getTable (String dbName, String tableName) throws AnalysisException, TableLoadingException
 
Table getTable (TableName tableName, Privilege privilege, boolean addAccessEvent) throws AnalysisException
 
Table getTable (TableName tableName, Privilege privilege) throws AnalysisException
 
Db getDb (String dbName, Privilege privilege) throws AnalysisException
 
Db getDb (String dbName, Privilege privilege, boolean throwIfDoesNotExist) throws AnalysisException
 
boolean dbContainsTable (String dbName, String tableName, Privilege privilege) throws AnalysisException
 
String getTargetDbName (TableName tableName)
 
String getTargetDbName (FunctionName fnName)
 
TableName getFqTableName (TableName tableName)
 
void setEnablePrivChecks (boolean value)
 
void setAuthErrMsg (String errMsg)
 
void setIsExplain ()
 
boolean isExplain ()
 
void setUseHiveColLabels (boolean useHiveColLabels)
 
boolean useHiveColLabels ()
 
void setHasLimitOffsetClause (boolean hasLimitOffset)
 
List< ExprgetConjuncts ()
 
Expr getConjunct (ExprId exprId)
 
int incrementCallDepth ()
 
int decrementCallDepth ()
 
int getCallDepth ()
 
boolean hasValueTransfer (SlotId a, SlotId b)
 
EventSequence getTimeline ()
 
void createIdentityEquivClasses ()
 
Map< String, ViewgetLocalViews ()
 
void addWarning (String msg)
 
void registerPrivReq (PrivilegeRequest privReq)
 
void authorize (AuthorizationChecker authzChecker) throws AuthorizationException
 

Static Public Member Functions

static Analyzer createWithNewGlobalState (Analyzer parentAnalyzer)
 

Static Public Attributes

static final String DB_DOES_NOT_EXIST_ERROR_MSG = "Database does not exist: "
 
static final String DB_ALREADY_EXISTS_ERROR_MSG = "Database already exists: "
 
static final String TBL_DOES_NOT_EXIST_ERROR_MSG = "Table does not exist: "
 
static final String TBL_ALREADY_EXISTS_ERROR_MSG = "Table already exists: "
 
static final String FN_DOES_NOT_EXIST_ERROR_MSG = "Function does not exist: "
 
static final String FN_ALREADY_EXISTS_ERROR_MSG = "Function already exists: "
 
static final String DATA_SRC_DOES_NOT_EXIST_ERROR_MSG
 
static final String DATA_SRC_ALREADY_EXISTS_ERROR_MSG
 

Package Functions

public< T extends Expr > void createEquivConjuncts (List< TupleId > lhsTids, TupleId rhsTid, List< T > conjuncts)
 
public< T extends Expr > void createEquivConjuncts (TupleId tid, List< T > conjuncts, Set< SlotId > ignoreSlots)
 
public< T extends Expr > void createEquivConjuncts (TupleId tid, List< T > conjuncts)
 

Private Member Functions

 Analyzer (Analyzer parentAnalyzer, GlobalState globalState)
 
Path resolvePath (List< String > rawPath, PathType pathType, boolean resolveInAncestors) throws AnalysisException, TableLoadingException
 
Path resolvePaths (List< String > rawPath, List< Path > paths, PathType pathType, LinkedList< String > errors)
 
void markConstantConjunct (Expr conjunct, boolean fromHavingClause)
 
void registerConjunct (Expr e)
 
boolean canEvalPredicate (PlanNode node, Expr e)
 
Map< EquivalenceClassId, List
< SlotId > > 
getEquivClasses (List< TupleId > tids)
 
List< List< SlotId > > getEquivDestSlotIds (TupleId srcTid, List< SlotId > srcSids, TupleId destTid, Set< SlotId > ignoreSlots)
 
boolean hasOuterJoinedTuple (EquivalenceClassId eqClassId)
 
boolean isTrueWithNullSlots (Expr p)
 
boolean hasMutualValueTransfer (SlotId slotA, SlotId slotB)
 
boolean checkSystemDbAccess (String dbName, Privilege privilege) throws AuthorizationException
 

Private Attributes

final User user_
 
boolean hasLimitOffsetClause_ = false
 
int callDepth_ = 0
 
boolean isSubquery_ = false
 
String authErrorMsg_
 
boolean enablePrivChecks_ = true
 
TupleId visibleSemiJoinedTupleId_ = null
 
final GlobalState globalState_
 
final ArrayList< Analyzerancestors_
 
final Map< String, ViewlocalViews_ = Maps.newHashMap()
 
final Map< String,
TupleDescriptor
aliasMap_ = Maps.newHashMap()
 
final Map< TupleId, TableReftableRefMap_ = Maps.newHashMap()
 
final Set< String > ambiguousAliases_ = Sets.newHashSet()
 
final Map< String, SlotDescriptorslotRefMap_ = Maps.newHashMap()
 
Set< TableNamemissingTbls_ = new HashSet<TableName>()
 
boolean hasEmptyResultSet_ = false
 
boolean hasEmptySpjResultSet_ = false
 

Static Private Attributes

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

Detailed Description

Repository of analysis state for single select block.

Conjuncts: Conjuncts are registered during analysis (registerConjuncts()) and assigned during the planning process (getUnassigned[Oj]Conjuncts()/isConjunctAssigned()/ markConjunctsAssigned()). All conjuncts are assigned a unique id when initially registered, and all registered conjuncts are referenced by their id (ie, there are no containers other than the one holding the referenced conjuncts), to make substitute() simple.

Slot equivalence classes: Equivalence of individual slots is computed based on registered equality predicates; those predicates are either present directly in the query or are implied by the syntactic elements used in query (example: a GROUP BY clause has implied equality predicates between the grouping exprs and the grouping slots of the aggregation output tuple). Implied equality predicates are registered with createAuxEquivPredicate(); they are never assigned during plan generation. Also tracks each catalog object access, so authorization checks can be performed once analysis is complete. TODO: We often use the terms stmt/block/analyzer interchangeably, although they may have slightly different meanings (sometimes depending on the context). Use the terms more accurately and consistently here and elsewhere.

Definition at line 105 of file Analyzer.java.

Constructor & Destructor Documentation

com.cloudera.impala.analysis.Analyzer.Analyzer ( Analyzer  parentAnalyzer)
inline

Analyzer constructor for nested select block. GlobalState is inherited from the parentAnalyzer.

Definition at line 342 of file Analyzer.java.

com.cloudera.impala.analysis.Analyzer.Analyzer ( Analyzer  parentAnalyzer,
GlobalState  globalState 
)
inlineprivate

Member Function Documentation

void com.cloudera.impala.analysis.Analyzer.addAccessEvent ( TAccessEvent  event)
inline

Definition at line 2087 of file Analyzer.java.

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

SlotDescriptor com.cloudera.impala.analysis.Analyzer.addSlotDescriptor ( TupleDescriptor  tupleDesc)
inline

Creates a new slot descriptor and related state in globalState.

Definition at line 813 of file Analyzer.java.

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

void com.cloudera.impala.analysis.Analyzer.addWarning ( String  msg)
inline

Add a warning that will be displayed to the user. Ignores null messages.

Definition at line 2307 of file Analyzer.java.

References count.

void com.cloudera.impala.analysis.Analyzer.authorize ( AuthorizationChecker  authzChecker) throws AuthorizationException
inline
boolean com.cloudera.impala.analysis.Analyzer.canEvalAntiJoinedConjunct ( Expr  e,
List< TupleId nodeTupleIds 
)
inline

Checks if a conjunct from the On-clause of an anti join can be evaluated in a node that materializes a given list of tuple ids.

Definition at line 1245 of file Analyzer.java.

References com.cloudera.impala.analysis.Analyzer.getAntiJoinRef().

Referenced by com.cloudera.impala.analysis.Analyzer.canEvalPredicate(), and com.cloudera.impala.analysis.Analyzer.getEqJoinConjuncts().

boolean com.cloudera.impala.analysis.Analyzer.canEvalFullOuterJoinedConjunct ( Expr  e,
List< TupleId tids 
)
inline

Checks if a conjunct can be evaluated at a node materializing a list of tuple ids 'tids'.

Definition at line 1153 of file Analyzer.java.

References com.cloudera.impala.analysis.Analyzer.getFullOuterJoinRef().

Referenced by com.cloudera.impala.analysis.Analyzer.canEvalPredicate(), and com.cloudera.impala.analysis.Analyzer.getEqJoinConjuncts().

boolean com.cloudera.impala.analysis.Analyzer.canEvalPredicate ( List< TupleId tupleIds,
Expr  e 
)
inline

Returns true if predicate 'e' can be correctly evaluated by a tree materializing 'tupleIds', otherwise false:

  • the predicate needs to be bound by tupleIds
  • a Where clause predicate can only be correctly evaluated if for all outer-joined referenced tids the last join to outer-join this tid has been materialized
  • an On clause predicate against the non-nullable side of an Outer Join clause can only be correctly evaluated by the join node that materializes the Outer Join clause

Definition at line 1169 of file Analyzer.java.

References com.cloudera.impala.analysis.Analyzer.canEvalAntiJoinedConjunct(), com.cloudera.impala.analysis.Analyzer.canEvalFullOuterJoinedConjunct(), com.cloudera.impala.analysis.Expr.debugString(), com.cloudera.impala.analysis.TableRef.getAllTupleIds(), com.cloudera.impala.analysis.Expr.getId(), com.cloudera.impala.analysis.TableRef.getJoinOp(), com.cloudera.impala.analysis.Analyzer.getLastOjClause(), com.cloudera.impala.analysis.Analyzer.globalState_, com.cloudera.impala.analysis.Analyzer.isAntiJoinedConjunct(), com.cloudera.impala.analysis.Expr.isBoundByTupleIds(), com.cloudera.impala.analysis.Analyzer.isTrueWithNullSlots(), com.cloudera.impala.analysis.Expr.isWhereClauseConjunct(), com.cloudera.impala.analysis.Analyzer.GlobalState.ojClauseByConjunct, and com.cloudera.impala.analysis.Analyzer.GlobalState.outerJoinedTupleIds.

Referenced by com.cloudera.impala.analysis.Analyzer.canEvalPredicate(), com.cloudera.impala.analysis.Analyzer.getUnassignedConjuncts(), and com.cloudera.impala.planner.SingleNodePlanner.migrateConjunctsToInlineView().

boolean com.cloudera.impala.analysis.Analyzer.canEvalPredicate ( PlanNode  node,
Expr  e 
)
inlineprivate
Type com.cloudera.impala.analysis.Analyzer.castAllToCompatibleType ( List< Expr exprs) throws AnalysisException
inline

Determines compatible type for given exprs, and casts them to compatible type. Calls analyze() on each of the exprs. Throw an AnalysisException if the types are incompatible, returns compatible type otherwise.

Definition at line 2014 of file Analyzer.java.

References com.cloudera.impala.analysis.Analyzer.getCompatibleType().

void com.cloudera.impala.analysis.Analyzer.castToUnionCompatibleTypes ( List< List< Expr >>  exprLists) throws AnalysisException
inline

Casts the exprs in the given lists position-by-position such that for every i, the i-th expr among all expr lists is compatible. Throw an AnalysisException if the types are incompatible.

Definition at line 2038 of file Analyzer.java.

References com.cloudera.impala.analysis.Analyzer.getCompatibleType().

boolean com.cloudera.impala.analysis.Analyzer.checkSystemDbAccess ( String  dbName,
Privilege  privilege 
) throws AuthorizationException
inlineprivate

Throws an authorization exception if the dbName is a system db and they are trying to modify it. Returns true if this is a system db and the action is allowed.

Definition at line 2732 of file Analyzer.java.

References com.cloudera.impala.catalog.Db.isSystemDb().

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

void com.cloudera.impala.analysis.Analyzer.computeEquivClasses ( )
inline

Populate globalState.valueTransfer based on the registered equi-join predicates of the form <slotref> = <slotref>.

Definition at line 1777 of file Analyzer.java.

References com.cloudera.impala.analysis.Analyzer.GlobalState.equivClassMembers, com.cloudera.impala.analysis.Analyzer.globalState_, and com.cloudera.impala.analysis.Analyzer.hasValueTransfer().

boolean com.cloudera.impala.analysis.Analyzer.containsOuterJoinedTid ( List< TupleId tids)
inline
boolean com.cloudera.impala.analysis.Analyzer.containsSubquery ( )
inline

Definition at line 292 of file Analyzer.java.

SlotDescriptor com.cloudera.impala.analysis.Analyzer.copySlotDescriptor ( SlotDescriptor  srcSlotDesc,
TupleDescriptor  tupleDesc 
)
inline

Adds a new slot descriptor in tupleDesc that is identical to srcSlotDesc except for the path and slot id.

Definition at line 823 of file Analyzer.java.

void com.cloudera.impala.analysis.Analyzer.createAuxEquivPredicate ( Expr  lhs,
Expr  rhs 
)
inline

Create and register an auxiliary predicate to express an equivalence between two exprs (BinaryPredicate with EQ); this predicate does not need to be assigned, but it's used for equivalence class computation.

Definition at line 969 of file Analyzer.java.

References com.cloudera.impala.analysis.BinaryPredicate.debugString(), and com.cloudera.impala.analysis.Analyzer.registerConjunct().

BinaryPredicate com.cloudera.impala.analysis.Analyzer.createEqPredicate ( SlotId  lhsSlotId,
SlotId  rhsSlotId 
)
inline
public<T extends Expr> void com.cloudera.impala.analysis.Analyzer.createEquivConjuncts ( List< TupleId lhsTids,
TupleId  rhsTid,
List< T >  conjuncts 
)
inlinepackage

For each equivalence class, adds/removes predicates from conjuncts such that it contains a minimum set of <lhsSlot> = <rhsSlot> predicates that establish the known equivalences between slots in lhsTids and rhsTid (lhsTids must not contain rhsTid). Preserves original conjuncts when possible. Assumes that predicates for establishing equivalences among slots in only lhsTids and only rhsTid have already been established. This function adds the remaining predicates to "connect" the disjoin equivalent slot sets of lhsTids and rhsTid. The intent of this function is to enable construction of a minimum spanning tree to cover the known slot equivalences. This function should be called for join nodes during plan generation to (1) remove redundant join predicates, and (2) establish equivalences among slots materialized at that join node. TODO: Consider optimizing for the cheapest minimum set of predicates. TODO: Consider caching the DisjointSet during plan generation instead of re-creating it here on every invocation.

Definition at line 1430 of file Analyzer.java.

References com.cloudera.impala.analysis.Analyzer.createEqPredicate(), com.cloudera.impala.analysis.Analyzer.getEquivClasses(), com.cloudera.impala.analysis.Analyzer.getEquivClassId(), com.cloudera.impala.analysis.Analyzer.getTupleId(), com.cloudera.impala.analysis.Analyzer.hasMutualValueTransfer(), com.cloudera.impala.analysis.Analyzer.isFullOuterJoined(), and com.cloudera.impala.analysis.Analyzer.isOuterJoined().

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

public<T extends Expr> void com.cloudera.impala.analysis.Analyzer.createEquivConjuncts ( TupleId  tid,
List< T >  conjuncts,
Set< SlotId ignoreSlots 
)
inlinepackage

For each equivalence class, adds/removes predicates from conjuncts such that it contains a minimum set of <slot> = <slot> predicates that establish the known equivalences between slots belonging to tid. Preserves original conjuncts when possible. The intent of this function is to enable construction of a minimum spanning tree to cover the known slot equivalences. This function should be called to add conjuncts to plan nodes that materialize a new tuple, e.g., scans and aggregations. Does not enforce equivalence between slots in ignoreSlots. Equivalences (if any) among slots in ignoreSlots are assumed to have already been enforced. TODO: Consider optimizing for the cheapest minimum set of predicates.

Definition at line 1535 of file Analyzer.java.

References com.cloudera.impala.analysis.Analyzer.createEqPredicate(), com.cloudera.impala.analysis.Analyzer.getEquivClasses(), com.cloudera.impala.analysis.Analyzer.getEquivClassId(), and com.cloudera.impala.analysis.Analyzer.hasMutualValueTransfer().

public<T extends Expr> void com.cloudera.impala.analysis.Analyzer.createEquivConjuncts ( TupleId  tid,
List< T >  conjuncts 
)
inlinepackage
void com.cloudera.impala.analysis.Analyzer.createIdentityEquivClasses ( )
inline

Assign all remaining unassigned slots to their own equivalence classes.

Definition at line 2290 of file Analyzer.java.

References com.cloudera.impala.analysis.Analyzer.GlobalState.equivClassBySlotId, and com.cloudera.impala.analysis.Analyzer.globalState_.

static Analyzer com.cloudera.impala.analysis.Analyzer.createWithNewGlobalState ( Analyzer  parentAnalyzer)
inlinestatic
boolean com.cloudera.impala.analysis.Analyzer.dbContainsTable ( String  dbName,
String  tableName,
Privilege  privilege 
) throws AnalysisException
inline

Checks if the given database contains the given table for the given Privilege level. If the table exists in the database, true is returned. Otherwise false.

If the user does not have sufficient privileges to access the table an AuthorizationException is thrown. If the database does not exist in the catalog an AnalysisError is thrown.

Definition at line 2215 of file Analyzer.java.

References com.cloudera.impala.analysis.Analyzer.DB_DOES_NOT_EXIST_ERROR_MSG, com.cloudera.impala.analysis.Analyzer.getCatalog(), and com.cloudera.impala.analysis.Analyzer.registerPrivReq().

int com.cloudera.impala.analysis.Analyzer.decrementCallDepth ( )
inline

Definition at line 2274 of file Analyzer.java.

References com.cloudera.impala.analysis.Analyzer.callDepth_.

boolean com.cloudera.impala.analysis.Analyzer.equivExprs ( Expr  e1,
Expr  e2 
)
inline

Returns true if e1 and e2 are equivalent expressions.

Definition at line 1887 of file Analyzer.java.

Referenced by com.cloudera.impala.planner.DistributedPlanner.getCompatPartition(), and com.cloudera.impala.planner.DistributedPlanner.isCompatPartition().

boolean com.cloudera.impala.analysis.Analyzer.equivSets ( List< Expr l1,
List< Expr l2 
)
inline

Return true if l1 is equivalent to l2 when both lists are interpreted as sets. For this check, each SlotRefs in both l1 and l2 is replaced with its canonical equivalence-class representative, and then duplicate exprs are removed.

Definition at line 1874 of file Analyzer.java.

boolean com.cloudera.impala.analysis.Analyzer.evalByJoin ( Expr  e)
inline
Set<TAccessEvent> com.cloudera.impala.analysis.Analyzer.getAccessEvents ( )
inline

Returns a list of the successful catalog object access events. Does not include accesses that failed due to AuthorizationExceptions. In general, if analysis fails for any reason this list may be incomplete.

Definition at line 2086 of file Analyzer.java.

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

Set<String> com.cloudera.impala.analysis.Analyzer.getAliases ( )
inline

Definition at line 1107 of file Analyzer.java.

Set<ExprId> com.cloudera.impala.analysis.Analyzer.getAssignedConjuncts ( )
inline

Definition at line 1937 of file Analyzer.java.

AuthorizationConfig com.cloudera.impala.analysis.Analyzer.getAuthzConfig ( )
inline

Definition at line 2069 of file Analyzer.java.

ArrayList<Expr> com.cloudera.impala.analysis.Analyzer.getBoundPredicates ( TupleId  destTid,
Set< SlotId ignoreSlots,
boolean  markAssigned 
)
inline

Returns a list of predicates that are fully bound by destTid. Predicates are derived by replacing the slots of a source predicate with slots of the destTid, if for each source slot there is an equivalent slot in destTid. In particular, the returned list contains predicates that must be evaluated at a join node (bound to outer-joined tuple) but can also be safely evaluated by a plan node materializing destTid. Such predicates are not marked as assigned. All other inferred predicates are marked as assigned if 'markAssigned' is true. This function returns bound predicates regardless of whether the source predicated have been assigned. It is up to the caller to decide if a bound predicate should actually be used. Destination slots in destTid can be ignored by passing them in ignoreSlots. TODO: exclude UDFs from predicate propagation? their overloaded variants could have very different semantics

Definition at line 1274 of file Analyzer.java.

References com.cloudera.impala.analysis.Analyzer.GlobalState.descTbl, com.cloudera.impala.analysis.Analyzer.GlobalState.equivClassBySlotId, com.cloudera.impala.analysis.Analyzer.evalByJoin(), com.cloudera.impala.analysis.Analyzer.getEquivDestSlotIds(), com.cloudera.impala.analysis.Expr.getId(), com.cloudera.impala.analysis.TableRef.getJoinOp(), com.cloudera.impala.analysis.DescriptorTable.getSlotDesc(), com.cloudera.impala.analysis.Analyzer.globalState_, com.cloudera.impala.analysis.Analyzer.hasOuterJoinedTuple(), com.cloudera.impala.analysis.Analyzer.hasValueTransfer(), com.cloudera.impala.analysis.Analyzer.isAntiJoinedConjunct(), com.cloudera.impala.analysis.Analyzer.isTrueWithNullSlots(), com.cloudera.impala.analysis.Expr.isWhereClauseConjunct_, com.cloudera.impala.analysis.Analyzer.markConjunctAssigned(), com.cloudera.impala.analysis.Analyzer.GlobalState.ojClauseByConjunct, com.cloudera.impala.analysis.Analyzer.GlobalState.outerJoinedTupleIds, and com.cloudera.impala.analysis.Analyzer.GlobalState.singleTidConjuncts.

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

ArrayList<Expr> com.cloudera.impala.analysis.Analyzer.getBoundPredicates ( TupleId  destTid)
inline
int com.cloudera.impala.analysis.Analyzer.getCallDepth ( )
inline

Definition at line 2275 of file Analyzer.java.

References com.cloudera.impala.analysis.Analyzer.callDepth_.

ColumnLineageGraph com.cloudera.impala.analysis.Analyzer.getColumnLineageGraph ( )
inline

Definition at line 2071 of file Analyzer.java.

SlotDescriptor com.cloudera.impala.analysis.Analyzer.getColumnSlot ( TupleDescriptor  tupleDesc,
Column  col 
)
inline

Return slot descriptor corresponding to column referenced in the context of tupleDesc, or null if no such reference exists.

Definition at line 1088 of file Analyzer.java.

References com.cloudera.impala.analysis.TupleDescriptor.getSlots().

Type com.cloudera.impala.analysis.Analyzer.getCompatibleType ( Type  lastCompatibleType,
Expr  lastCompatibleExpr,
Expr  expr 
) throws AnalysisException
inline

Returns assignment-compatible type of expr.getType() and lastCompatibleType. If lastCompatibleType is null, returns expr.getType() (if valid). If types are not compatible throws an exception reporting the incompatible types and their expr.toSql().

lastCompatibleExpr is passed for error reporting purposes, but note that lastCompatibleExpr may not yet have lastCompatibleType, because it was not cast yet.

Definition at line 1989 of file Analyzer.java.

References com.cloudera.impala.catalog.Type.isValid().

Referenced by com.cloudera.impala.analysis.Analyzer.castAllToCompatibleType(), and com.cloudera.impala.analysis.Analyzer.castToUnionCompatibleTypes().

Expr com.cloudera.impala.analysis.Analyzer.getConjunct ( ExprId  exprId)
inline

Definition at line 2269 of file Analyzer.java.

List<Expr> com.cloudera.impala.analysis.Analyzer.getConjuncts ( )
inline

Definition at line 2266 of file Analyzer.java.

Db com.cloudera.impala.analysis.Analyzer.getDb ( String  dbName,
Privilege  privilege 
) throws AnalysisException
inline

Returns the Catalog Db object for the given database at the given Privilege level. The privilege request is tracked in the analyzer and authorized post-analysis.

If the database does not exist in the catalog an AnalysisError is thrown.

If addAccessEvent is true, this call will add a new entry to accessEvents if the catalog access was successful. If false, no accessEvent will be added.

Definition at line 2185 of file Analyzer.java.

String com.cloudera.impala.analysis.Analyzer.getDefaultDb ( )
inline
TupleDescriptor com.cloudera.impala.analysis.Analyzer.getDescriptor ( String  tableAlias) throws AnalysisException
inline

Returns the descriptor of the given explicit or implicit table alias or null if no such alias has been registered. Throws an AnalysisException if the given table alias is ambiguous.

Definition at line 557 of file Analyzer.java.

References com.cloudera.impala.analysis.Analyzer.ambiguousAliases_.

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

DescriptorTable com.cloudera.impala.analysis.Analyzer.getDescTbl ( )
inline

Definition at line 1095 of file Analyzer.java.

List<Expr> com.cloudera.impala.analysis.Analyzer.getEqJoinConjuncts ( List< TupleId tids,
TableRef  joinedTblRef 
)
inline

Returns list of candidate equi-join conjuncts to be evaluated by the join node that is specified by: a) the tids materialized by one side (lhs or rhs) and, b) joinedTblRef which is the new joined table. If joinedTblRef is an outer join, only equi-join conjuncts from that outer join's On clause are returned. If an equi-join conjunct is full outer joined, it is not added to the candidate list if this is not the plan node to full outer join it.

Definition at line 1119 of file Analyzer.java.

References com.cloudera.impala.analysis.Analyzer.canEvalAntiJoinedConjunct(), com.cloudera.impala.analysis.Analyzer.canEvalFullOuterJoinedConjunct(), and com.cloudera.impala.analysis.TableRef.getJoinOp().

Map<EquivalenceClassId, List<SlotId> > com.cloudera.impala.analysis.Analyzer.getEquivClasses ( List< TupleId tids)
inlineprivate

Returns a map of partial equivalence classes that only contains slot ids belonging to the given tuple ids. Only contains equivalence classes with more than one member.

Definition at line 1612 of file Analyzer.java.

References com.cloudera.impala.analysis.Analyzer.GlobalState.equivClassMembers, com.cloudera.impala.analysis.Analyzer.getEquivClassId(), com.cloudera.impala.analysis.Analyzer.getTupleDesc(), and com.cloudera.impala.analysis.Analyzer.globalState_.

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

EquivalenceClassId com.cloudera.impala.analysis.Analyzer.getEquivClassId ( SlotId  slotId)
inline
ExprSubstitutionMap com.cloudera.impala.analysis.Analyzer.getEquivClassSmap ( )
inline

Definition at line 1867 of file Analyzer.java.

List<List<SlotId> > com.cloudera.impala.analysis.Analyzer.getEquivDestSlotIds ( TupleId  srcTid,
List< SlotId srcSids,
TupleId  destTid,
Set< SlotId ignoreSlots 
)
inlineprivate

Returns a list of slot mappings from srcTid to destTid for the purpose of predicate propagation. Each mapping assigns every slot in srcSids to an equivalent slot in destTid. Does not generate all possible mappings, but limits the results to useful and/or non-redundant mappings, i.e., those mappings that would improve the performance of query execution.

Definition at line 1637 of file Analyzer.java.

References com.cloudera.impala.analysis.Analyzer.getTupleDesc(), and com.cloudera.impala.analysis.Analyzer.hasValueTransfer().

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

void com.cloudera.impala.analysis.Analyzer.getEquivSlots ( SlotId  slotId,
List< TupleId tupleIds,
List< SlotId equivSlotIds 
)
inline

Return in equivSlotIds the ids of slots that are in the same equivalence class as slotId and are part of a tuple in tupleIds.

Definition at line 1850 of file Analyzer.java.

References com.cloudera.impala.analysis.Analyzer.GlobalState.descTbl, com.cloudera.impala.analysis.Analyzer.GlobalState.equivClassMembers, com.cloudera.impala.analysis.DescriptorTable.getSlotDesc(), and com.cloudera.impala.analysis.Analyzer.globalState_.

TableName com.cloudera.impala.analysis.Analyzer.getFqTableName ( TableName  tableName)
inline

Returns the fully-qualified table name of tableName. If tableName is already fully qualified, returns tableName.

Definition at line 2246 of file Analyzer.java.

References com.cloudera.impala.analysis.Analyzer.getDefaultDb(), com.cloudera.impala.analysis.TableName.getTbl(), and com.cloudera.impala.analysis.TableName.isFullyQualified().

TableRef com.cloudera.impala.analysis.Analyzer.getFullOuterJoinRef ( Expr  e)
inline
ListMap<TNetworkAddress> com.cloudera.impala.analysis.Analyzer.getHostIndex ( )
inline
TableRef com.cloudera.impala.analysis.Analyzer.getLastOjClause ( TupleId  id)
inline

Return rhs ref of last Join clause that outer-joined id.

Definition at line 1080 of file Analyzer.java.

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

Map<String, View> com.cloudera.impala.analysis.Analyzer.getLocalViews ( )
inline
Set<TableName> com.cloudera.impala.analysis.Analyzer.getMissingTbls ( )
inline
Analyzer com.cloudera.impala.analysis.Analyzer.getParentAnalyzer ( )
inline
ImmutableList<PrivilegeRequest> com.cloudera.impala.analysis.Analyzer.getPrivilegeReqs ( )
inline

Definition at line 2077 of file Analyzer.java.

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

TQueryCtx com.cloudera.impala.analysis.Analyzer.getQueryCtx ( )
inline
String com.cloudera.impala.analysis.Analyzer.getSerializedLineageGraph ( )
inline

Definition at line 2072 of file Analyzer.java.

SlotDescriptor com.cloudera.impala.analysis.Analyzer.getSlotDescriptor ( String  qualifiedColumnName)
inline

Given a "table alias"."column alias", return the SlotDescriptor

Definition at line 575 of file Analyzer.java.

Table com.cloudera.impala.analysis.Analyzer.getTable ( String  dbName,
String  tableName 
) throws AnalysisException, TableLoadingException
inline

Returns the Catalog Table object for the given database and table name. Adds the table to this analyzer's "missingTbls_" and throws an AnalysisException if the table has not yet been loaded in the local catalog cache. Throws an AnalysisException if the table or the db does not exist in the Catalog. This function does not register authorization requests and does not log access events.

Definition at line 2098 of file Analyzer.java.

References com.cloudera.impala.analysis.Analyzer.DB_DOES_NOT_EXIST_ERROR_MSG, com.cloudera.impala.analysis.Analyzer.getCatalog(), com.cloudera.impala.catalog.Table.getDb(), com.cloudera.impala.catalog.Table.getFullName(), com.cloudera.impala.catalog.Table.getName(), com.cloudera.impala.catalog.Table.isLoaded(), and com.cloudera.impala.analysis.Analyzer.TBL_DOES_NOT_EXIST_ERROR_MSG.

Referenced by com.cloudera.impala.analysis.Analyzer.getTable(), and com.cloudera.impala.analysis.Analyzer.resolvePath().

Table com.cloudera.impala.analysis.Analyzer.getTable ( TableName  tableName,
Privilege  privilege,
boolean  addAccessEvent 
) throws AnalysisException
inline

Returns the Catalog Table object for the TableName. Adds the table to this analyzer's "missingTbls_" and throws an AnalysisException if the table has not yet been loaded in the local catalog cache. Throws an AnalysisException if the table or the db does not exist in the Catalog. Always registers a privilege request for the table at the given privilege level, regardless of the state of the table (i.e. whether it exists, is loaded, etc.). If addAccessEvent is true, adds an access event if the catalog access succeeded.

Definition at line 2134 of file Analyzer.java.

References com.cloudera.impala.analysis.Analyzer.addAccessEvent(), com.cloudera.impala.analysis.Analyzer.getTable(), com.cloudera.impala.analysis.Analyzer.getTargetDbName(), and com.cloudera.impala.analysis.Analyzer.registerPrivReq().

Table com.cloudera.impala.analysis.Analyzer.getTable ( TableName  tableName,
Privilege  privilege 
) throws AnalysisException
inline

Returns the Catalog Table object for the TableName at the given Privilege level and adds an audit event if the access was successful.

If the user does not have sufficient privileges to access the table an AuthorizationException is thrown. If the table or the db does not exist in the Catalog, an AnalysisError is thrown.

Definition at line 2170 of file Analyzer.java.

References com.cloudera.impala.analysis.Analyzer.getTable().

TableRef com.cloudera.impala.analysis.Analyzer.getTableRef ( TupleId  tid)
inline

Definition at line 570 of file Analyzer.java.

String com.cloudera.impala.analysis.Analyzer.getTargetDbName ( TableName  tableName)
inline

If the table name is fully qualified, the database from the TableName object will be returned. Otherwise the default analyzer database will be returned.

Definition at line 2234 of file Analyzer.java.

References com.cloudera.impala.analysis.TableName.getDb(), and com.cloudera.impala.analysis.Analyzer.getDefaultDb().

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

String com.cloudera.impala.analysis.Analyzer.getTargetDbName ( FunctionName  fnName)
inline
EventSequence com.cloudera.impala.analysis.Analyzer.getTimeline ( )
inline

Definition at line 2285 of file Analyzer.java.

TupleDescriptor com.cloudera.impala.analysis.Analyzer.getTupleDesc ( TupleId  id)
inline
List<Expr> com.cloudera.impala.analysis.Analyzer.getUnassignedConjuncts ( List< TupleId tupleIds,
boolean  inclOjConjuncts 
)
inline

Return all unassigned non-constant registered conjuncts that are fully bound by given list of tuple ids. If 'inclOjConjuncts' is false, conjuncts tied to an Outer Join clause are excluded.

Definition at line 994 of file Analyzer.java.

References com.cloudera.impala.analysis.Analyzer.GlobalState.assignedConjuncts, com.cloudera.impala.analysis.Analyzer.GlobalState.conjuncts, com.cloudera.impala.analysis.Analyzer.globalState_, and com.cloudera.impala.analysis.Analyzer.GlobalState.ojClauseByConjunct.

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

List<Expr> com.cloudera.impala.analysis.Analyzer.getUnassignedConjuncts ( PlanNode  node)
inline

Return all unassigned registered conjuncts that are fully bound by node's (logical) tuple ids, can be evaluated by 'node' and are not tied to an Outer Join clause.

Definition at line 1028 of file Analyzer.java.

References com.cloudera.impala.analysis.Analyzer.canEvalPredicate(), and com.cloudera.impala.analysis.Analyzer.getUnassignedConjuncts().

List<Expr> com.cloudera.impala.analysis.Analyzer.getUnassignedOjConjuncts ( TableRef  ref)
inline

Return all unassigned conjuncts of the outer join referenced by right-hand side table ref.

Definition at line 1061 of file Analyzer.java.

References com.cloudera.impala.analysis.Analyzer.GlobalState.assignedConjuncts, and com.cloudera.impala.analysis.Analyzer.globalState_.

User com.cloudera.impala.analysis.Analyzer.getUser ( )
inline
List<String> com.cloudera.impala.analysis.Analyzer.getWarnings ( )
inline

Returns a list of each warning logged, indicating if it was logged more than once.

Definition at line 390 of file Analyzer.java.

References count, com.cloudera.impala.analysis.Analyzer.globalState_, and com.cloudera.impala.analysis.Analyzer.GlobalState.warnings.

boolean com.cloudera.impala.analysis.Analyzer.hasAncestors ( )
inline
boolean com.cloudera.impala.analysis.Analyzer.hasEmptyResultSet ( )
inline

Returns true if the query block corresponding to this analyzer is guaranteed to return an empty result set, e.g., due to a limit 0 or a constant predicate that evaluates to false.

Definition at line 590 of file Analyzer.java.

References com.cloudera.impala.analysis.Analyzer.hasEmptyResultSet_.

boolean com.cloudera.impala.analysis.Analyzer.hasEmptySpjResultSet ( )
inline

Returns true if the select-project-join portion of this query block returns an empty result set.

Definition at line 597 of file Analyzer.java.

References com.cloudera.impala.analysis.Analyzer.hasEmptySpjResultSet_.

boolean com.cloudera.impala.analysis.Analyzer.hasMissingTbls ( )
inline

Definition at line 381 of file Analyzer.java.

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

boolean com.cloudera.impala.analysis.Analyzer.hasMutualValueTransfer ( SlotId  slotA,
SlotId  slotB 
)
inlineprivate
boolean com.cloudera.impala.analysis.Analyzer.hasOuterJoinedTuple ( EquivalenceClassId  eqClassId)
inlineprivate

Returns true if the equivalence class identified by 'eqClassId' contains a slot belonging to an outer-joined tuple.

Definition at line 1688 of file Analyzer.java.

References com.cloudera.impala.analysis.Analyzer.getTupleId(), and com.cloudera.impala.analysis.Analyzer.isOuterJoined().

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

boolean com.cloudera.impala.analysis.Analyzer.hasPlanHints ( )
inline

Definition at line 154 of file Analyzer.java.

boolean com.cloudera.impala.analysis.Analyzer.hasUnassignedConjuncts ( )
inline
int com.cloudera.impala.analysis.Analyzer.incrementCallDepth ( )
inline

Definition at line 2273 of file Analyzer.java.

References com.cloudera.impala.analysis.Analyzer.callDepth_.

void com.cloudera.impala.analysis.Analyzer.invertOuterJoinState ( TableRef  oldRhsTbl,
TableRef  newRhsTbl 
)
inline

Modifies the analysis state associated with the rhs table ref of an outer join to accomodate a join inversion that changes the rhs table ref of the join from oldRhsTbl to newRhsTbl. TODO: Revisit this function and how outer joins are inverted. This function should not be necessary because the semantics of an inverted outer join do not change. This function will naturally become obsolete when we can transform outer joins with otherPredicates into inner joins.

Definition at line 1400 of file Analyzer.java.

References com.cloudera.impala.analysis.Analyzer.globalState_, and com.cloudera.impala.analysis.Analyzer.GlobalState.outerJoinedTupleIds.

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

boolean com.cloudera.impala.analysis.Analyzer.isConjunctAssigned ( Expr  conjunct)
inline

Definition at line 1933 of file Analyzer.java.

boolean com.cloudera.impala.analysis.Analyzer.isExplain ( )
inline

Definition at line 2256 of file Analyzer.java.

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

boolean com.cloudera.impala.analysis.Analyzer.isFullOuterJoined ( Expr  e)
inline
boolean com.cloudera.impala.analysis.Analyzer.isFullOuterJoined ( TupleId  tid)
inline

Definition at line 1754 of file Analyzer.java.

boolean com.cloudera.impala.analysis.Analyzer.isFullOuterJoined ( SlotId  sid)
inline
boolean com.cloudera.impala.analysis.Analyzer.isOjConjunct ( Expr  e)
inline
boolean com.cloudera.impala.analysis.Analyzer.isOuterJoined ( SlotId  sid)
inline
boolean com.cloudera.impala.analysis.Analyzer.isRootAnalyzer ( )
inline

Return true if this analyzer has no ancestors. (i.e. false for the analyzer created for inline views/ union operands, etc.)

Definition at line 583 of file Analyzer.java.

boolean com.cloudera.impala.analysis.Analyzer.isSemiJoined ( TupleId  tid)
inline

Definition at line 1740 of file Analyzer.java.

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

boolean com.cloudera.impala.analysis.Analyzer.isSubquery ( )
inline

Definition at line 152 of file Analyzer.java.

References com.cloudera.impala.analysis.Analyzer.isSubquery_.

boolean com.cloudera.impala.analysis.Analyzer.isTrueWithNullSlots ( Expr  p)
inlineprivate

Returns true if 'p' evaluates to true when all its referenced slots are NULL, false otherwise. TODO: Can we avoid dealing with the exceptions thrown by analysis and eval?

Definition at line 1701 of file Analyzer.java.

References com.cloudera.impala.analysis.NullLiteral.clone(), and com.cloudera.impala.analysis.Analyzer.getQueryCtx().

Referenced by com.cloudera.impala.analysis.Analyzer.canEvalPredicate(), and com.cloudera.impala.analysis.Analyzer.getBoundPredicates().

boolean com.cloudera.impala.analysis.Analyzer.isVisible ( TupleId  tid)
inline
void com.cloudera.impala.analysis.Analyzer.markConjunctAssigned ( Expr  conjunct)
inline
void com.cloudera.impala.analysis.Analyzer.markConjunctsAssigned ( List< Expr conjuncts)
inline

Mark predicates as assigned.

Definition at line 1917 of file Analyzer.java.

void com.cloudera.impala.analysis.Analyzer.markConstantConjunct ( Expr  conjunct,
boolean  fromHavingClause 
)
inlineprivate

If the given conjunct is a constant non-oj conjunct, marks it as assigned, and evaluates the conjunct. If the conjunct evaluates to false, marks this query block as having an empty result set or as having an empty select-project-join portion, if fromHavingClause is true or false, respectively. No-op if the conjunct is not constant or is outer joined.

Definition at line 892 of file Analyzer.java.

References com.cloudera.impala.service.FeSupport.EvalPredicate(), com.cloudera.impala.analysis.Analyzer.globalState_, com.cloudera.impala.analysis.Analyzer.hasEmptyResultSet_, com.cloudera.impala.analysis.Analyzer.hasEmptySpjResultSet_, com.cloudera.impala.analysis.Expr.isConstant(), com.cloudera.impala.analysis.Analyzer.isOjConjunct(), com.cloudera.impala.analysis.Analyzer.markConjunctAssigned(), and com.cloudera.impala.analysis.Analyzer.GlobalState.queryCtx.

Referenced by com.cloudera.impala.analysis.Analyzer.registerConjuncts(), and com.cloudera.impala.analysis.Analyzer.registerOnClauseConjuncts().

void com.cloudera.impala.analysis.Analyzer.materializeSlots ( List< Expr exprs)
inline

Mark all slots that are referenced in exprs as materialized.

Definition at line 1962 of file Analyzer.java.

void com.cloudera.impala.analysis.Analyzer.materializeSlots ( Expr  e)
inline

Definition at line 1971 of file Analyzer.java.

void com.cloudera.impala.analysis.Analyzer.registerConjuncts ( List< Expr l)
inline

Register all conjuncts in a list of predicates as Having-clause conjuncts.

Definition at line 837 of file Analyzer.java.

void com.cloudera.impala.analysis.Analyzer.registerConjuncts ( Expr  e,
boolean  fromHavingClause 
)
inline

Register all conjuncts that make up 'e'. If fromHavingClause is false, this conjunct is assumed to originate from a Where clause.

Definition at line 877 of file Analyzer.java.

References com.cloudera.impala.analysis.Expr.getConjuncts(), com.cloudera.impala.analysis.Analyzer.markConstantConjunct(), and com.cloudera.impala.analysis.Analyzer.registerConjunct().

void com.cloudera.impala.analysis.Analyzer.registerFullOuterJoinedConjunct ( Expr  e)
inline

Register conjuncts that are outer joined by a full outer join. For a given predicate, we record the last full outer join that outer-joined any of its tuple ids. We need this additional information because full-outer joins obey different rules with respect to predicate pushdown compared to left and right outer joins.

Definition at line 508 of file Analyzer.java.

References com.cloudera.impala.analysis.Analyzer.GlobalState.fullOuterJoinedTupleIds, and com.cloudera.impala.analysis.Analyzer.globalState_.

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

void com.cloudera.impala.analysis.Analyzer.registerFullOuterJoinedTids ( List< TupleId tids,
TableRef  rhsRef 
)
inline

Register tids as being outer-joined by a full outer join clause represented by rhsRef.

Definition at line 527 of file Analyzer.java.

void com.cloudera.impala.analysis.Analyzer.registerLocalView ( View  view) throws AnalysisException
inline

Registers a local view definition with this analyzer. Throws an exception if a view definition with the same alias has already been registered.

Definition at line 409 of file Analyzer.java.

References com.cloudera.impala.analysis.Analyzer.localViews_.

void com.cloudera.impala.analysis.Analyzer.registerOnClauseConjuncts ( Expr  e,
TableRef  rhsRef 
)
inline

Register all conjuncts that make up the On-clause 'e' of the given right-hand side of a join. Assigns each conjunct a unique id. If rhsRef is the right-hand side of an outer join, then the conjuncts conjuncts are registered such that they can only be evaluated by the node implementing that join.

Definition at line 849 of file Analyzer.java.

References com.cloudera.impala.analysis.Expr.getConjuncts(), com.cloudera.impala.analysis.TableRef.getJoinOp(), com.cloudera.impala.analysis.Analyzer.markConstantConjunct(), and com.cloudera.impala.analysis.Analyzer.registerConjunct().

void com.cloudera.impala.analysis.Analyzer.registerOuterJoinedTids ( List< TupleId tids,
TableRef  rhsRef 
)
inline

Register tids as being outer-joined by Join clause represented by rhsRef.

Definition at line 538 of file Analyzer.java.

void com.cloudera.impala.analysis.Analyzer.registerPrivReq ( PrivilegeRequest  privReq)
inline

Registers a new PrivilegeRequest in the analyzer. If authErrorMsg_ is set, the privilege request will be added to the list of "masked" privilege requests, using authErrorMsg_ as the auth failure error message. Otherwise it will get added as a normal privilege request that will use the standard error message on authorization failure. If enablePrivChecks_ is false, the registration request will be ignored. This is used when analyzing catalog views since users should be able to query a view even if they do not have privileges on the underlying tables.

Definition at line 2685 of file Analyzer.java.

References com.cloudera.impala.analysis.Analyzer.authErrorMsg_, and com.cloudera.impala.analysis.Analyzer.enablePrivChecks_.

Referenced by com.cloudera.impala.analysis.Analyzer.dbContainsTable(), com.cloudera.impala.analysis.Analyzer.getDb(), and com.cloudera.impala.analysis.Analyzer.getTable().

void com.cloudera.impala.analysis.Analyzer.registerSemiJoinedTid ( TupleId  tid,
TableRef  rhsRef 
)
inline

Register the given tuple id as being the invisible side of a semi-join.

Definition at line 548 of file Analyzer.java.

SlotDescriptor com.cloudera.impala.analysis.Analyzer.registerSlotRef ( Path  slotPath) throws AnalysisException
inline

Creates and returns an empty SlotDescriptor for the given Path if it hasn't previously been registered, otherwise returns the existing descriptor.

Definition at line 797 of file Analyzer.java.

References com.cloudera.impala.analysis.Analyzer.addSlotDescriptor().

TupleDescriptor com.cloudera.impala.analysis.Analyzer.registerTableRef ( TableRef  ref) throws AnalysisException
inline

Creates an returns an empty TupleDescriptor for the given table ref and registers it against all its legal aliases. For tables refs with an explicit alias, only the explicit alias is legal. For tables refs with no explicit alias, the fully-qualified and unqualified table names are legal aliases. Column references against unqualified implicit aliases can be ambiguous, therefore, we register such ambiguous aliases here. Requires that all views have been substituted. Throws if an existing explicit alias or implicit fully-qualified alias has already been registered for another table ref.

Definition at line 427 of file Analyzer.java.

References com.cloudera.impala.analysis.Analyzer.aliasMap_, and com.cloudera.impala.analysis.TupleDescriptor.hasExplicitAlias().

void com.cloudera.impala.analysis.Analyzer.registerValueTransfer ( SlotId  id1,
SlotId  id2 
)
inline

Definition at line 1728 of file Analyzer.java.

List<Expr> com.cloudera.impala.analysis.Analyzer.removeRedundantExprs ( List< Expr exprs)
inline

Removes redundant expressions from exprs based on equivalence classes, as follows: First, normalizes the exprs using the canonical SlotRef representative of each equivalence class. Then retains the first original element of exprs that is non-redundant in the normalized exprs. Returns a new list with the unique exprs.

Definition at line 1899 of file Analyzer.java.

Path com.cloudera.impala.analysis.Analyzer.resolvePath ( List< String >  rawPath,
PathType  pathType 
) throws AnalysisException, TableLoadingException
inline

Resolves the given raw path according to the given path type, as follows: SLOT_REF and STAR: Resolves the path in the context of all registered tuple descriptors, considering qualified as well as unqualified matches. TABLE_REF: Resolves the path in the context of all registered tuple descriptors only considering qualified matches, as well as catalog tables/views.

Path resolution: Regardless of the path type, a raw path can have multiple successful resolutions. A resolution is said to be 'successful' if all raw path elements can be mapped to a corresponding alias/table/column/field.

Path legality: A successful resolution may be illegal with respect to the path type, e.g., a SlotRef cannot reference intermediate collection types, etc.

Path ambiguity: A raw path is ambiguous if it has multiple legal resolutions. Otherwise, the ambiguity is resolved in favor of the legal resolution.

Returns the single legal path resolution if it exists. Throws if there was no legal resolution or if the path is ambiguous.

Definition at line 622 of file Analyzer.java.

References com.cloudera.impala.analysis.Analyzer.isSubquery_, and com.cloudera.impala.analysis.Path.PathType.SLOT_REF.

Path com.cloudera.impala.analysis.Analyzer.resolvePaths ( List< String >  rawPath,
List< Path paths,
PathType  pathType,
LinkedList< String >  errors 
)
inlineprivate

Resolves the given paths and checks them for legality and ambiguity. Returns the single legal path resolution if it exists, null otherwise. Populates 'errors' with a a prioritized list of error messages starting with the most relevant one. The list contains at least one error message if null is returned.

Definition at line 700 of file Analyzer.java.

References com.cloudera.impala.analysis.Analyzer.isVisible(), com.cloudera.impala.analysis.Path.PathType.SLOT_REF, and com.cloudera.impala.analysis.Path.PathType.TABLE_REF.

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

TableRef com.cloudera.impala.analysis.Analyzer.resolveTableRef ( TableRef  tableRef) throws AnalysisException
inline

Resolves the given TableRef into a concrete BaseTableRef, ViewRef or CollectionTableRef. Returns the new resolved table ref or the given table ref if it is already resolved. Adds audit events and privilege requests for the database and/or table.

Definition at line 468 of file Analyzer.java.

void com.cloudera.impala.analysis.Analyzer.setAssignedConjuncts ( Set< ExprId assigned)
inline

Definition at line 1941 of file Analyzer.java.

void com.cloudera.impala.analysis.Analyzer.setAuthErrMsg ( String  errMsg)
inline
void com.cloudera.impala.analysis.Analyzer.setEnablePrivChecks ( boolean  value)
inline
void com.cloudera.impala.analysis.Analyzer.setHasEmptyResultSet ( )
inline
void com.cloudera.impala.analysis.Analyzer.setHasLimitOffsetClause ( boolean  hasLimitOffset)
inline

Definition at line 2262 of file Analyzer.java.

boolean com.cloudera.impala.analysis.Analyzer.setHasPlanHints ( )
inline

Definition at line 153 of file Analyzer.java.

void com.cloudera.impala.analysis.Analyzer.setIsExplain ( )
inline

Definition at line 2255 of file Analyzer.java.

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

void com.cloudera.impala.analysis.Analyzer.setIsSubquery ( )
inline

Definition at line 148 of file Analyzer.java.

References com.cloudera.impala.analysis.Analyzer.isSubquery_.

void com.cloudera.impala.analysis.Analyzer.setUseHiveColLabels ( boolean  useHiveColLabels)
inline
void com.cloudera.impala.analysis.Analyzer.setVisibleSemiJoinedTuple ( TupleId  tid)
inline

Makes the given semi-joined tuple visible such that its slots can be referenced. If tid is null, makes the currently visible semi-joined tuple invisible again.

Definition at line 373 of file Analyzer.java.

References com.cloudera.impala.analysis.Analyzer.visibleSemiJoinedTupleId_.

boolean com.cloudera.impala.analysis.Analyzer.useHiveColLabels ( )
inline

Member Data Documentation

final Map<String, TupleDescriptor> com.cloudera.impala.analysis.Analyzer.aliasMap_ = Maps.newHashMap()
private
final Set<String> com.cloudera.impala.analysis.Analyzer.ambiguousAliases_ = Sets.newHashSet()
private

Definition at line 314 of file Analyzer.java.

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

final ArrayList<Analyzer> com.cloudera.impala.analysis.Analyzer.ancestors_
private
String com.cloudera.impala.analysis.Analyzer.authErrorMsg_
private
final String com.cloudera.impala.analysis.Analyzer.DATA_SRC_ALREADY_EXISTS_ERROR_MSG
static
Initial value:
=
"Data source already exists: "

Definition at line 115 of file Analyzer.java.

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

final String com.cloudera.impala.analysis.Analyzer.DATA_SRC_DOES_NOT_EXIST_ERROR_MSG
static
Initial value:
=
"Data source does not exist: "

Definition at line 113 of file Analyzer.java.

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

final String com.cloudera.impala.analysis.Analyzer.DB_ALREADY_EXISTS_ERROR_MSG = "Database already exists: "
static

Definition at line 108 of file Analyzer.java.

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

boolean com.cloudera.impala.analysis.Analyzer.enablePrivChecks_ = true
private
final String com.cloudera.impala.analysis.Analyzer.FN_ALREADY_EXISTS_ERROR_MSG = "Function already exists: "
static
final String com.cloudera.impala.analysis.Analyzer.FN_DOES_NOT_EXIST_ERROR_MSG = "Function does not exist: "
static
final GlobalState com.cloudera.impala.analysis.Analyzer.globalState_
private
boolean com.cloudera.impala.analysis.Analyzer.hasEmptyResultSet_ = false
private
boolean com.cloudera.impala.analysis.Analyzer.hasEmptySpjResultSet_ = false
private
boolean com.cloudera.impala.analysis.Analyzer.hasLimitOffsetClause_ = false
private
boolean com.cloudera.impala.analysis.Analyzer.isSubquery_ = false
private
final Map<String, View> com.cloudera.impala.analysis.Analyzer.localViews_ = Maps.newHashMap()
private
final Logger com.cloudera.impala.analysis.Analyzer.LOG = LoggerFactory.getLogger(Analyzer.class)
staticprivate

Definition at line 118 of file Analyzer.java.

Set<TableName> com.cloudera.impala.analysis.Analyzer.missingTbls_ = new HashSet<TableName>()
private
final Map<String, SlotDescriptor> com.cloudera.impala.analysis.Analyzer.slotRefMap_ = Maps.newHashMap()
private

Definition at line 317 of file Analyzer.java.

final Map<TupleId, TableRef> com.cloudera.impala.analysis.Analyzer.tableRefMap_ = Maps.newHashMap()
private

Definition at line 311 of file Analyzer.java.

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

final String com.cloudera.impala.analysis.Analyzer.TBL_ALREADY_EXISTS_ERROR_MSG = "Table already exists: "
static
final String com.cloudera.impala.analysis.Analyzer.TBL_DOES_NOT_EXIST_ERROR_MSG = "Table does not exist: "
static
final User com.cloudera.impala.analysis.Analyzer.user_
private
TupleId com.cloudera.impala.analysis.Analyzer.visibleSemiJoinedTupleId_ = null
private

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