(Analyzer analyzer)
| 147 | } |
| 148 | |
| 149 | @Override |
| 150 | protected void analyzeImpl(Analyzer analyzer) throws AnalysisException { |
| 151 | // TODO: derived slot refs (e.g., star-expanded) will not have rawPath set. |
| 152 | // Change construction to properly handle such cases. |
| 153 | Preconditions.checkState(rawPath_ != null); |
| 154 | try { |
| 155 | resolvedPath_ = analyzer.resolvePathWithMasking(rawPath_, PathType.SLOT_REF); |
| 156 | } catch (TableLoadingException e) { |
| 157 | // Should never happen because we only check registered table aliases. |
| 158 | Preconditions.checkState(false); |
| 159 | } |
| 160 | |
| 161 | Preconditions.checkNotNull(resolvedPath_); |
| 162 | desc_ = analyzer.registerSlotRef(resolvedPath_, false /*duplicateIfCollections*/); |
| 163 | type_ = desc_.getType(); |
| 164 | if (!type_.isSupported()) { |
| 165 | throw new UnsupportedFeatureException("Unsupported type '" |
| 166 | + type_.toSql() + "' in '" + toSql() + "'."); |
| 167 | } |
| 168 | if (type_.isInvalid()) { |
| 169 | // In this case, the metastore contained a string we can't parse at all |
| 170 | // e.g. map. We could report a better error if we stored the original |
| 171 | // HMS string. |
| 172 | throw new UnsupportedFeatureException("Unsupported type in '" + toSql() + "'."); |
| 173 | } |
| 174 | // Register columns of a catalog table for column masking. |
| 175 | if (!resolvedPath_.getMatchedTypes().isEmpty()) { |
| 176 | analyzer.registerColumnForMasking(desc_); |
| 177 | } |
| 178 | |
| 179 | numDistinctValues_ = adjustNumDistinctValues(); |
| 180 | FeTable rootTable = resolvedPath_.getRootTable(); |
| 181 | if (rootTable != null && rootTable.getNumRows() > 0) { |
| 182 | // The NDV cannot exceed the #rows in the table. |
| 183 | numDistinctValues_ = Math.min(numDistinctValues_, rootTable.getNumRows()); |
| 184 | } |
| 185 | |
| 186 | if (type_.isStructType()) { |
| 187 | addStructChildrenAsSlotRefs(); |
| 188 | checkForUnsupportedStructFeatures(); |
| 189 | } |
| 190 | } |
| 191 | |
| 192 | /** |
| 193 | * Re-expands the struct: recreates the item tuple descriptor of 'desc_' and the child |
nothing calls this directly
no test coverage detected