tanishq-chugh commented on code in PR #6443:
URL: https://github.com/apache/hive/pull/6443#discussion_r3159129172
##########
ql/src/java/org/apache/hadoop/hive/ql/parse/ColumnStatsSemanticAnalyzer.java:
##########
@@ -102,38 +103,38 @@ private boolean shouldRewrite(ASTNode tree) {
return rwt;
}
+ private record StatsEligibleColumns(List<String> columnNames, List<String>
columnTypes) {
+ }
+
/**
- * Get the names of the columns that support column statistics.
+ * Get the names and types of the columns that support column statistics.
*/
- private static List<String> getColumnNamesSupportingStats(Table tbl) {
+ private static StatsEligibleColumns getStatsEligibleColumns(Table tbl) {
List<String> colNames = new ArrayList<>();
+ List<String> colTypes = new ArrayList<>();
for (FieldSchema col : tbl.getCols()) {
String type = col.getType();
TypeInfo typeInfo = TypeInfoUtils.getTypeInfoFromTypeString(type);
boolean isSupported =
ColumnStatsAutoGatherContext.isColumnSupported(typeInfo.getCategory(), () ->
typeInfo);
if (isSupported) {
colNames.add(col.getName());
+ colTypes.add(col.getType());
}
}
- return colNames;
+ return new StatsEligibleColumns(colNames, colTypes);
}
private List<String> getColumnName(ASTNode tree) throws SemanticException {
Review Comment:
Renamed the function to `getExplicitColumnNamesFromAst` in commit -
[84d81f9](https://github.com/apache/hive/pull/6443/commits/84d81f933cf7ecd8112293895c3d3997cc7292f1)
--
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]