mirror of https://github.com/apache/druid.git
Fix UnknownComplexTypeColumn#makeVectorObjectSelector. Add a warning … (#10123)
* Fix UnknownComplexTypeColumn#makeVectorObjectSelector. Add a warning message to indicate failure in deserializing.
This commit is contained in:
parent
c5540f46ed
commit
e2c5bcc22d
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue