ramitg254 commented on code in PR #6089:
URL: https://github.com/apache/hive/pull/6089#discussion_r2583697128


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java:
##########
@@ -2254,6 +2292,69 @@ private List<ColumnStatisticsObj> aggrStatsUseDB(String 
catName, String dbName,
     }
   }
 
+  private ColumnStatisticsObj 
columnStatisticsObjWithAdjustedNDV(List<Object[]> list, int i,
+                                                                 boolean 
useDensityFunctionForNDVEstimation, double ndvTuner)
+          throws MetaException {
+    if (list.isEmpty()) {
+      return null;
+    }
+    ColumnStatisticsData data = new ColumnStatisticsData();
+    int j = i;
+    Object[] row = list.getFirst();
+    String colName = (String) row[j++];
+    String colType = (String) row[j++];
+    ColumnStatisticsObj cso = new ColumnStatisticsObj(colName, colType, data);
+    Object llow = row[j++];
+    Object lhigh = row[j++];
+    Object dlow = row[j++];
+    Object dhigh = row[j++];
+    Object declow = row[j++];
+    Object dechigh = row[j++];
+    Object nulls = row[j++];
+    Object dist = row[j++];
+    Object avglen = row[j++];
+    Object maxlen = row[j++];
+    Object trues = row[j++];
+    Object falses = row[j++];
+    Object sumLong = row[j++];
+    Object countLong = row[j++];
+    Object sumDouble = row[j++];
+    Object countDouble = row[j++];
+    Object sumDecimal = row[j++];
+    Object countDecimal = row[j++];
+    Object sumDist = row[j];
+    for (int k = 1; k < list.size(); k++) {

Review Comment:
   I don't think we should do that as current loops start with `index =1`  and 
it is able to replace the method `prepareCSObjWithAdjustedNDV` and if we try to 
implement it in the other way the we will need to take care of the conditionals 
and return statement inside loop which will not be cleaner than current one



-- 
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]

Reply via email to