Aggarwal-Raghav commented on code in PR #6443:
URL: https://github.com/apache/hive/pull/6443#discussion_r3224921882
##########
ql/src/java/org/apache/hadoop/hive/ql/parse/ColumnStatsSemanticAnalyzer.java:
##########
@@ -726,33 +717,46 @@ public ASTNode rewriteAST(ASTNode ast,
ColumnStatsAutoGatherContext context)
partTransformSpec =
tbl.getStorageHandler().getPartitionTransformSpec(tbl);
}
}
- colType = getColumnTypes(tbl, colNames);
+ rewrittenColumnSchemas = new FieldSchemas(columnSchemas);
isTableLevel = !isPartitionStats;
- rewrittenQuery = genRewrittenQuery(colNames, colType, conf,
partTransformSpec, -1,
+ rewrittenQuery = genRewrittenQuery(rewrittenColumnSchemas, conf,
partTransformSpec, -1,
partSpec, isPartitionStats);
rewrittenTree = genRewrittenTree(rewrittenQuery);
return rewrittenTree;
}
+ protected List<FieldSchema> getColumnsFromAst(ASTNode ast) throws
SemanticException {
+ List<FieldSchema> statsEligibleFS = null;
+ List<String> columnNames;
+ if (ast.getChildCount() == 2) {
+ FieldSchemas eligibleFS = getStatsEligibleFieldSchemas(tbl);
+ statsEligibleFS = eligibleFS.getSchemas();
+ columnNames = eligibleFS.getColName();
+ } else {
+ columnNames = getExplicitColumnNamesFromAst(ast);
+ }
+
+ checkForPartitionColumns(columnNames,
Utilities.getColumnNamesFromFieldSchema(tbl.getPartitionKeys()));
Review Comment:
@tanishq-chugh , can you please check `checkForPartitionColumns` it also has
nested for loop and `validateSpecifiedColumnNames` is using for `loop +
contains()` which is also O(N*M). Both are used in `getColumnsFromAst()`
I haven't gone though the full PR yet, just wanted to hightlight.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]