Jackie-Jiang commented on a change in pull request #5625:
URL: https://github.com/apache/incubator-pinot/pull/5625#discussion_r448021351
##########
File path:
pinot-core/src/main/java/org/apache/pinot/core/io/readerwriter/impl/FixedByteMVForwardIndexReaderWriter.java
##########
@@ -221,102 +222,63 @@ private int updateHeader(int row, int numValues) {
}
@Override
- public void setCharArray(int row, char[] charArray) {
- int newStartIndex = updateHeader(row, charArray.length);
- for (int i = 0; i < charArray.length; i++) {
- _currentDataWriter.setChar(newStartIndex + i, 0, charArray[i]);
- }
+ public DataType getValueType() {
+ // NOTE: Dictionary id is handled as INT type.
+ // TODO: Currently we only support dictionary-encoded forward index on
multi-value columns.
+ return DataType.INT;
}
@Override
- public void setShortArray(int row, short[] shortsArray) {
+ public boolean isSingleValue() {
+ return false;
+ }
- int newStartIndex = updateHeader(row, shortsArray.length);
- for (int i = 0; i < shortsArray.length; i++) {
- _currentDataWriter.setShort(newStartIndex + i, 0, shortsArray[i]);
- }
+ @Override
+ public int getLengthOfShortestElement() {
+ return _columnSizeInBytes;
+ }
+
+ @Override
+ public int getLengthOfLongestElement() {
+ return _columnSizeInBytes;
}
@Override
- public void setIntArray(int row, int[] intArray) {
- int newStartIndex = updateHeader(row, intArray.length);
+ public void setIntArray(int docId, int[] intArray) {
Review comment:
For ReaderWriter (CONSUMING segment), we still need the DocId because of
the aggregate metrics where values are updated in-place.
For Writer, we have the assumption that the value has to be indexed one by
one.
Updated the PR to have separate APIs for ReaderWriter and Writer, and also
added a TODO to merge ForwardIndexWriter into ForwardIndexCreator.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]