@@ -165,7 +165,6 @@ public void setIsSubquery() {
165
165
isSubquery_ = true ;
166
166
globalState_ .containsSubquery = true ;
167
167
}
168
- public boolean isSubquery () { return isSubquery_ ; }
169
168
public boolean setHasPlanHints () { return globalState_ .hasPlanHints = true ; }
170
169
public boolean hasPlanHints () { return globalState_ .hasPlanHints ; }
171
170
public void setIsWithClause () { isWithClause_ = true ; }
@@ -316,12 +315,6 @@ public GlobalState(ImpaladCatalog catalog, TQueryCtx queryCtx,
316
315
317
316
public boolean containsSubquery () { return globalState_ .containsSubquery ; }
318
317
319
- /**
320
- * Helper function to reset the global state information about the existence of
321
- * subqueries.
322
- */
323
- public void resetSubquery () { globalState_ .containsSubquery = false ; }
324
-
325
318
// An analyzer stores analysis state for a single select block. A select block can be
326
319
// a top level select statement, or an inline view select block.
327
320
// ancestors contains the Analyzers of the enclosing select blocks of 'this'
@@ -1587,35 +1580,6 @@ public ArrayList<Expr> getBoundPredicates(TupleId destTid) {
1587
1580
return getBoundPredicates (destTid , new HashSet <SlotId >(), true );
1588
1581
}
1589
1582
1590
- /**
1591
- * Modifies the analysis state associated with the rhs table ref of an outer join
1592
- * to accomodate a join inversion that changes the rhs table ref of the join from
1593
- * oldRhsTbl to newRhsTbl.
1594
- * TODO: Revisit this function and how outer joins are inverted. This function
1595
- * should not be necessary because the semantics of an inverted outer join do
1596
- * not change. This function will naturally become obsolete when we can transform
1597
- * outer joins with otherPredicates into inner joins.
1598
- */
1599
- public void invertOuterJoinState (TableRef oldRhsTbl , TableRef newRhsTbl ) {
1600
- Preconditions .checkState (oldRhsTbl .getJoinOp ().isOuterJoin ());
1601
- // Invert analysis state for an outer join.
1602
- List <ExprId > conjunctIds =
1603
- globalState_ .conjunctsByOjClause .remove (oldRhsTbl .getId ());
1604
- if (conjunctIds != null ) {
1605
- globalState_ .conjunctsByOjClause .put (newRhsTbl .getId (), conjunctIds );
1606
- for (ExprId eid : conjunctIds ) {
1607
- globalState_ .ojClauseByConjunct .put (eid , newRhsTbl );
1608
- }
1609
- } else {
1610
- // An outer join is allowed not to have an On-clause if the rhs table ref is
1611
- // correlated or relative.
1612
- Preconditions .checkState (oldRhsTbl .isCorrelated () || oldRhsTbl .isRelative ());
1613
- }
1614
- for (Map .Entry <TupleId , TableRef > e : globalState_ .outerJoinedTupleIds .entrySet ()) {
1615
- if (e .getValue () == oldRhsTbl ) e .setValue (newRhsTbl );
1616
- }
1617
- }
1618
-
1619
1583
/**
1620
1584
* For each equivalence class, adds/removes predicates from conjuncts such that it
1621
1585
* contains a minimum set of <lhsSlot> = <rhsSlot> predicates that establish the known
@@ -2086,11 +2050,6 @@ public EquivalenceClassId getEquivClassId(SlotId slotId) {
2086
2050
return globalState_ .equivClassBySlotId .get (slotId );
2087
2051
}
2088
2052
2089
- public Collection <SlotId > getEquivSlots (SlotId slotId ) {
2090
- EquivalenceClassId classId = globalState_ .equivClassBySlotId .get (slotId );
2091
- return globalState_ .equivClassMembers .get (classId );
2092
- }
2093
-
2094
2053
public ExprSubstitutionMap getEquivClassSmap () { return globalState_ .equivClassSmap ; }
2095
2054
2096
2055
/**
@@ -2117,27 +2076,6 @@ public boolean equivExprs(Expr e1, Expr e2) {
2117
2076
return substE1 .equals (substE2 );
2118
2077
}
2119
2078
2120
- /**
2121
- * Removes redundant expressions from exprs based on equivalence classes, as follows:
2122
- * First, normalizes the exprs using the canonical SlotRef representative of each
2123
- * equivalence class. Then retains the first original element of exprs that is
2124
- * non-redundant in the normalized exprs. Returns a new list with the unique exprs.
2125
- */
2126
- public List <Expr > removeRedundantExprs (List <Expr > exprs ) {
2127
- List <Expr > result = Lists .newArrayList ();
2128
- List <Expr > normalizedExprs =
2129
- Expr .substituteList (exprs , globalState_ .equivClassSmap , this , false );
2130
- Preconditions .checkState (exprs .size () == normalizedExprs .size ());
2131
- List <Expr > uniqueExprs = Lists .newArrayList ();
2132
- for (int i = 0 ; i < normalizedExprs .size (); ++i ) {
2133
- if (!uniqueExprs .contains (normalizedExprs .get (i ))) {
2134
- uniqueExprs .add (normalizedExprs .get (i ));
2135
- result .add (exprs .get (i ).clone ());
2136
- }
2137
- }
2138
- return result ;
2139
- }
2140
-
2141
2079
/**
2142
2080
* Mark predicates as assigned.
2143
2081
*/
@@ -2155,10 +2093,6 @@ public void markConjunctAssigned(Expr conjunct) {
2155
2093
globalState_ .assignedConjuncts .add (conjunct .getId ());
2156
2094
}
2157
2095
2158
- public boolean isConjunctAssigned (Expr conjunct ) {
2159
- return globalState_ .assignedConjuncts .contains (conjunct .getId ());
2160
- }
2161
-
2162
2096
public Set <ExprId > getAssignedConjuncts () {
2163
2097
return Sets .newHashSet (globalState_ .assignedConjuncts );
2164
2098
}
@@ -2167,19 +2101,6 @@ public void setAssignedConjuncts(Set<ExprId> assigned) {
2167
2101
globalState_ .assignedConjuncts = Sets .newHashSet (assigned );
2168
2102
}
2169
2103
2170
- /**
2171
- * Return true if there's at least one unassigned non-auxiliary conjunct.
2172
- */
2173
- public boolean hasUnassignedConjuncts () {
2174
- for (ExprId id : globalState_ .conjuncts .keySet ()) {
2175
- if (globalState_ .assignedConjuncts .contains (id )) continue ;
2176
- Expr e = globalState_ .conjuncts .get (id );
2177
- if (e .isAuxExpr ()) continue ;
2178
- return true ;
2179
- }
2180
- return false ;
2181
- }
2182
-
2183
2104
/**
2184
2105
* Mark all slots that are referenced in exprs as materialized.
2185
2106
*/
@@ -2486,10 +2407,6 @@ public String getTargetDbName(TableName tableName) {
2486
2407
return tableName .isFullyQualified () ? tableName .getDb () : getDefaultDb ();
2487
2408
}
2488
2409
2489
- public String getTargetDbName (FunctionName fnName ) {
2490
- return fnName .isFullyQualified () ? fnName .getDb () : getDefaultDb ();
2491
- }
2492
-
2493
2410
/**
2494
2411
* Returns the fully-qualified table name of tableName. If tableName
2495
2412
* is already fully qualified, returns tableName.
@@ -2519,12 +2436,6 @@ public void setHasLimitOffsetClause(boolean hasLimitOffset) {
2519
2436
public List <Expr > getConjuncts () {
2520
2437
return new ArrayList <Expr >(globalState_ .conjuncts .values ());
2521
2438
}
2522
- public Expr getConjunct (ExprId exprId ) {
2523
- return globalState_ .conjuncts .get (exprId );
2524
- }
2525
- public Map <TupleId , List <ExprId >> getEqJoinConjuncts () {
2526
- return globalState_ .eqJoinConjuncts ;
2527
- }
2528
2439
2529
2440
public int incrementCallDepth () { return ++callDepth_ ; }
2530
2441
public int decrementCallDepth () { return --callDepth_ ; }
0 commit comments