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

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


The following commit(s) were added to refs/heads/master by this push:
     new e2c5bcc  Fix UnknownComplexTypeColumn#makeVectorObjectSelector. Add a 
warning … (#10123)
e2c5bcc is described below

commit e2c5bcc22d2c175bba51fbb2a9c90303ecdf6f44
Author: Samarth Jain <sama...@apache.org>
AuthorDate: Wed Jul 1 20:06:23 2020 -0700

    Fix UnknownComplexTypeColumn#makeVectorObjectSelector. Add a warning … 
(#10123)
    
    * Fix UnknownComplexTypeColumn#makeVectorObjectSelector. Add a warning 
message to indicate failure in deserializing.
---
 .../segment/column/UnknownTypeComplexColumn.java      | 19 +------------------
 .../druid/segment/serde/ComplexColumnPartSerde.java   |  7 +++++++
 2 files changed, 8 insertions(+), 18 deletions(-)

diff --git 
a/processing/src/main/java/org/apache/druid/segment/column/UnknownTypeComplexColumn.java
 
b/processing/src/main/java/org/apache/druid/segment/column/UnknownTypeComplexColumn.java
index 7332a5c..ce4db70 100644
--- 
a/processing/src/main/java/org/apache/druid/segment/column/UnknownTypeComplexColumn.java
+++ 
b/processing/src/main/java/org/apache/druid/segment/column/UnknownTypeComplexColumn.java
@@ -25,7 +25,6 @@ import org.apache.druid.segment.data.ReadableOffset;
 import org.apache.druid.segment.vector.NilVectorSelector;
 import org.apache.druid.segment.vector.ReadableVectorOffset;
 import org.apache.druid.segment.vector.VectorObjectSelector;
-import org.apache.druid.segment.vector.VectorSizeInspector;
 
 import javax.annotation.Nullable;
 
@@ -38,22 +37,6 @@ public class UnknownTypeComplexColumn implements 
ComplexColumn
     return INSTANCE;
   }
 
-  private static final NilVectorSelector NIL_VECTOR_SELECTOR_INSTANCE =
-      NilVectorSelector.create(new VectorSizeInspector()
-      {
-        @Override
-        public int getMaxVectorSize()
-        {
-          return 0;
-        }
-
-        @Override
-        public int getCurrentVectorSize()
-        {
-          return 0;
-        }
-      });
-
   @Override
   public Class<?> getClazz()
   {
@@ -94,6 +77,6 @@ public class UnknownTypeComplexColumn implements ComplexColumn
   @Override
   public VectorObjectSelector makeVectorObjectSelector(ReadableVectorOffset 
offset)
   {
-    return NIL_VECTOR_SELECTOR_INSTANCE;
+    return NilVectorSelector.create(offset);
   }
 }
diff --git 
a/processing/src/main/java/org/apache/druid/segment/serde/ComplexColumnPartSerde.java
 
b/processing/src/main/java/org/apache/druid/segment/serde/ComplexColumnPartSerde.java
index f10f53b..dc0278b 100644
--- 
a/processing/src/main/java/org/apache/druid/segment/serde/ComplexColumnPartSerde.java
+++ 
b/processing/src/main/java/org/apache/druid/segment/serde/ComplexColumnPartSerde.java
@@ -21,6 +21,7 @@ package org.apache.druid.segment.serde;
 
 import com.fasterxml.jackson.annotation.JsonCreator;
 import com.fasterxml.jackson.annotation.JsonProperty;
+import org.apache.druid.java.util.common.logger.Logger;
 import org.apache.druid.segment.GenericColumnSerializer;
 
 import javax.annotation.Nullable;
@@ -33,11 +34,17 @@ public class ComplexColumnPartSerde implements 
ColumnPartSerde
   @Nullable
   private final ComplexMetricSerde serde;
   private final Serializer serializer;
+  private static final Logger log = new Logger(ComplexColumnPartSerde.class);
 
   private ComplexColumnPartSerde(String typeName, Serializer serializer)
   {
     this.typeName = typeName;
     this.serde = ComplexMetrics.getSerdeForType(typeName);
+    if (this.serde == null) {
+      // Not choosing to fail here since this gets handled as
+      // an UnknownTypeComplexColumn. See SimpleColumnHolder#getColumn.
+      log.warn("Unknown complex column of type %s detected", typeName);
+    }
     this.serializer = serializer;
   }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org
For additional commands, e-mail: commits-h...@druid.apache.org

Reply via email to