You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by GitBox <gi...@apache.org> on 2019/04/07 19:06:16 UTC

[GitHub] [drill] amansinha100 commented on a change in pull request #1728: DRILL-7089: Implement caching for TableMetadataProvider at query level and adapt statistics to use Drill metastore API

amansinha100 commented on a change in pull request #1728: DRILL-7089: Implement caching for TableMetadataProvider at query level and adapt statistics to use Drill metastore API
URL: https://github.com/apache/drill/pull/1728#discussion_r272845354
 
 

 ##########
 File path: exec/java-exec/src/main/java/org/apache/drill/metastore/ColumnStatisticsKind.java
 ##########
 @@ -106,6 +107,53 @@ public boolean isValueStatistic() {
     public boolean isExact() {
       return true;
     }
+  },
+
+  /**
+   * Column statistics kind which represents number of non-null values for the specific column.
+   */
+  NON_NULL_COUNT(Statistic.NNROWCOUNT) {
+    @Override
+    public Double mergeStatistics(List<? extends ColumnStatistics> statisticsList) {
+      double nonNullRowCount = 0;
+      for (ColumnStatistics statistics : statisticsList) {
+        Double nnRowCount = (Double) statistics.getStatistic(this);
+        if (nnRowCount != null) {
+          nonNullRowCount += nnRowCount;
+        }
+      }
+      return nonNullRowCount;
+    }
+  },
+
+  /**
+   * Column statistics kind which represents number of distinct values for the specific column.
+   */
+  NVD(Statistic.NDV) {
+    @Override
+    public Object mergeStatistics(List<? extends ColumnStatistics> statisticsList) {
+      throw new UnsupportedOperationException("Cannot merge statistics for NDV");
+    }
+  },
+
+  /**
+   * Column statistics kind which width of the specific column.
+   */
+  AVG_WIDTH(Statistic.AVG_WIDTH) {
+    @Override
+    public Object mergeStatistics(List<? extends ColumnStatistics> statisticsList) {
+      throw new UnsupportedOperationException("Cannot merge statistics for avg_width");
+    }
+  },
+
+  /**
+   * Column statistics kind which width of the specific column.
+   */
+  HISTOGRAM("histogram") {
+    @Override
+    public Object mergeStatistics(List<? extends ColumnStatistics> statisticsList) {
+      throw new UnsupportedOperationException("Cannot merge statistics for avg_width");
 
 Review comment:
   'statistics for histogram'

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services