git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[incubator-druid] branch master updated: Fix bug in SegmentAnalyzer.analyzeComplexColumn() #5939 (#5954)


This is an automated email from the ASF dual-hosted git repository.

jihoonson pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-druid.git


The following commit(s) were added to refs/heads/master by this push:
     new b3021ec  Fix bug in SegmentAnalyzer.analyzeComplexColumn() #5939 (#5954)
b3021ec is described below

commit b3021ec802c576edac5ed707be3f497769f0978d
Author: Benedict Jin <1571805553@xxxxxx>
AuthorDate: Tue Jul 10 06:36:16 2018 +0800

    Fix bug in SegmentAnalyzer.analyzeComplexColumn() #5939 (#5954)
---
 .../src/main/java/io/druid/query/metadata/SegmentAnalyzer.java      | 2 +-
 processing/src/main/java/io/druid/segment/column/ComplexColumn.java | 1 +
 .../src/main/java/io/druid/segment/column/IndexedComplexColumn.java | 6 ++++++
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/processing/src/main/java/io/druid/query/metadata/SegmentAnalyzer.java b/processing/src/main/java/io/druid/query/metadata/SegmentAnalyzer.java
index 196bb42..4153aba 100644
--- a/processing/src/main/java/io/druid/query/metadata/SegmentAnalyzer.java
+++ b/processing/src/main/java/io/druid/query/metadata/SegmentAnalyzer.java
@@ -329,7 +329,7 @@ public class SegmentAnalyzer
           return new ColumnAnalysis(typeName, hasMultipleValues, 0, null, null, null, null);
         }
 
-        final int length = column.getLength();
+        final int length = complexColumn.getLength();
         for (int i = 0; i < length; ++i) {
           size += inputSizeFn.apply(complexColumn.getRowValue(i));
         }
diff --git a/processing/src/main/java/io/druid/segment/column/ComplexColumn.java b/processing/src/main/java/io/druid/segment/column/ComplexColumn.java
index 0f5d718..3956539 100644
--- a/processing/src/main/java/io/druid/segment/column/ComplexColumn.java
+++ b/processing/src/main/java/io/druid/segment/column/ComplexColumn.java
@@ -33,6 +33,7 @@ public interface ComplexColumn extends BaseColumn
   Class<?> getClazz();
   String getTypeName();
   Object getRowValue(int rowNum);
+  int getLength();
 
   @Override
   void close();
diff --git a/processing/src/main/java/io/druid/segment/column/IndexedComplexColumn.java b/processing/src/main/java/io/druid/segment/column/IndexedComplexColumn.java
index daf0eb3..0e39d4e 100644
--- a/processing/src/main/java/io/druid/segment/column/IndexedComplexColumn.java
+++ b/processing/src/main/java/io/druid/segment/column/IndexedComplexColumn.java
@@ -53,6 +53,12 @@ public class IndexedComplexColumn implements ComplexColumn
   }
 
   @Override
+  public int getLength()
+  {
+    return column.size();
+  }
+
+  @Override
   public void close()
   {
   }


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: dev-help@xxxxxxxxxxxxxxxx