sreemanamala commented on code in PR #16885:
URL: https://github.com/apache/druid/pull/16885#discussion_r1719720459
##########
processing/src/main/java/org/apache/druid/frame/read/columnar/StringFrameColumnReader.java:
##########
@@ -709,3 +694,87 @@ public void close()
}
}
}
+
+/**
+ * Reader for {@link ColumnType#STRING_ARRAY}.
+ */
+class StringArrayFrameColumnReader extends StringFrameColumnReader
+{
+ StringArrayFrameColumnReader(int columnNumber)
+ {
+ super(columnNumber);
+ }
+
+ @Override
+ public Column readRACColumn(Frame frame)
+ {
+ final Memory memory = frame.region(columnNumber);
+ validate(memory);
+
+ // we expect the memory to be stored as if there are multi values
+ assert isMultiValue(memory);
+ final long positionOfLengths =
getStartOfStringLengthSection(frame.numRows(), true);
+ final long positionOfPayloads = getStartOfStringDataSection(memory,
frame.numRows(), true);
+
+ StringFrameColumn frameCol = new StringFrameColumn(
+ frame,
+ true,
+ memory,
+ positionOfLengths,
+ positionOfPayloads,
+ true
+ );
+
+ return new ColumnAccessorBasedColumn(frameCol);
+ }
+
+ @Override
+ public ColumnPlus readColumn(final Frame frame)
+ {
+ final Memory memory = frame.region(columnNumber);
+ validate(memory);
+
+ // we expect the memory to be stored as if there are multi values
+ assert isMultiValue(memory);
+ final long startOfStringLengthSection =
getStartOfStringLengthSection(frame.numRows(), true);
+ final long startOfStringDataSection = getStartOfStringDataSection(memory,
frame.numRows(), true);
+
+ final BaseColumn baseColumn = new StringArrayFrameColumn(
+ frame,
+ true,
+ memory,
+ startOfStringLengthSection,
+ startOfStringDataSection
+ );
+
+ return new ColumnPlus(
+ baseColumn,
+ new ColumnCapabilitiesImpl().setType(ColumnType.STRING_ARRAY)
+ .setHasMultipleValues(false)
+ .setDictionaryEncoded(false)
+ .setHasBitmapIndexes(false)
+ .setHasSpatialIndexes(false)
+
.setHasNulls(ColumnCapabilities.Capable.UNKNOWN),
Review Comment:
removed the ones which are same as default values
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]