MCPcopy Create free account
hub / github.com/apache/impala / reset

Method reset

fe/src/main/java/org/apache/impala/analysis/FromClause.java:193–222  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

191 }
192
193 public void reset() {
194 for (int i = 0; i < size(); ++i) {
195 TableRef origTblRef = get(i);
196 if (origTblRef instanceof UnpivotTableRef || origTblRef instanceof PivotTableRef) {
197 // For UnpivotTableRef and PivotTableRef, clone() creates an unanalyzed clone and
198 // can be used for reset.
199 set(i, origTblRef.clone());
200 continue;
201 }
202 if (origTblRef.isResolved() && !(origTblRef instanceof InlineViewRef)) {
203 // Replace resolved table refs with unresolved ones.
204 TableRef newTblRef = new TableRef(origTblRef);
205 // Use the fully qualified raw path to preserve the original resolution.
206 // Otherwise, non-fully qualified paths might incorrectly match a local view.
207 // TODO(IMPALA-9286): This full qualification preserves analysis state which is
208 // contrary to the intended semantics of reset(). We could address this issue by
209 // changing the WITH-clause analysis to register local views that have
210 // fully-qualified table refs, and then remove the full qualification here.
211 Path oldPath = origTblRef.getResolvedPath();
212 if (oldPath.getRootDesc() == null
213 || !oldPath.getRootDesc().getType().isCollectionStructType()) {
214 newTblRef.rawPath_ = oldPath.getFullyQualifiedRawPath();
215 }
216 set(i, newTblRef);
217 }
218 // recurse for views
219 get(i).reset();
220 }
221 this.analyzed_ = false;
222 }
223
224 @Override
225 public final String toSql() {

Callers

nothing calls this directly

Calls 11

sizeMethod · 0.95
getMethod · 0.95
setMethod · 0.95
cloneMethod · 0.95
isResolvedMethod · 0.95
getResolvedPathMethod · 0.95
getRootDescMethod · 0.95
getTypeMethod · 0.65
resetMethod · 0.65

Tested by

no test coverage detected