()
| 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() { |
nothing calls this directly
no test coverage detected