From 357d2ff941bda63830c1e219611efa3732c2692b Mon Sep 17 00:00:00 2001 From: Laksh Singla Date: Thu, 7 Sep 2023 20:10:42 +0530 Subject: [PATCH] bugfix, static check --- .../org/apache/druid/frame/field/DoubleFieldWriter.java | 2 -- .../org/apache/druid/frame/field/LongFieldReader.java | 5 ----- .../java/org/apache/druid/frame/read/FrameReader.java | 9 ++++++++- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/processing/src/main/java/org/apache/druid/frame/field/DoubleFieldWriter.java b/processing/src/main/java/org/apache/druid/frame/field/DoubleFieldWriter.java index 991d95238c1b..a68827853e54 100644 --- a/processing/src/main/java/org/apache/druid/frame/field/DoubleFieldWriter.java +++ b/processing/src/main/java/org/apache/druid/frame/field/DoubleFieldWriter.java @@ -29,8 +29,6 @@ */ public class DoubleFieldWriter extends NumericFieldWriter { - public static final int SIZE = Double.BYTES + Byte.BYTES; - private final BaseDoubleColumnValueSelector selector; public static DoubleFieldWriter forPrimitive(final BaseDoubleColumnValueSelector selector) diff --git a/processing/src/main/java/org/apache/druid/frame/field/LongFieldReader.java b/processing/src/main/java/org/apache/druid/frame/field/LongFieldReader.java index c0460048742f..7885bcc2e5d9 100644 --- a/processing/src/main/java/org/apache/druid/frame/field/LongFieldReader.java +++ b/processing/src/main/java/org/apache/druid/frame/field/LongFieldReader.java @@ -60,11 +60,6 @@ public ValueType getValueType() return ValueType.LONG; } - public Class getClassOfObject() - { - return Long.class; - } - @Override public ColumnValueSelector getColumnValueSelector( final Memory memory, diff --git a/processing/src/main/java/org/apache/druid/frame/read/FrameReader.java b/processing/src/main/java/org/apache/druid/frame/read/FrameReader.java index f39687dbee22..1a497aeed4fa 100644 --- a/processing/src/main/java/org/apache/druid/frame/read/FrameReader.java +++ b/processing/src/main/java/org/apache/druid/frame/read/FrameReader.java @@ -110,7 +110,14 @@ public static FrameReader create(final RowSignature signature) fieldReaders.add(FieldReaders.create(signature.getColumnName(columnNumber), columnType)); - if (columnType.getType() == ValueType.ARRAY && columnType.getType() != ValueType.STRING) { + // TODO(laksh): comment + if (columnType.getType() == ValueType.ARRAY + && Preconditions.checkNotNull( + columnType.getElementType(), + "Element type for array column [%s]", + signature.getColumnName(columnNumber) + ).getType() != ValueType.STRING + ) { if (!unsupportedColumnAndType.isPresent()) { unsupportedColumnAndType = Optional.of(Pair.of(signature.getColumnName(columnNumber), columnType)); }