You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2021/12/21 01:35:24 UTC

[GitHub] [pinot] Jackie-Jiang commented on a change in pull request #7920: faster metric scans

Jackie-Jiang commented on a change in pull request #7920:
URL: https://github.com/apache/pinot/pull/7920#discussion_r772769448



##########
File path: pinot-core/src/main/java/org/apache/pinot/core/common/DataFetcher.java
##########
@@ -425,34 +426,14 @@ void readIntValues(int[] docIds, int length, int[] valueBuffer) {
         _reader.readDictIds(docIds, length, dictIdBuffer, readerContext);
         _dictionary.readIntValues(dictIdBuffer, length, valueBuffer);
       } else {
-        switch (_reader.getValueType()) {
-          case INT:
-            for (int i = 0; i < length; i++) {
-              valueBuffer[i] = _reader.getInt(docIds[i], readerContext);
-            }
-            break;
-          case LONG:
-            for (int i = 0; i < length; i++) {
-              valueBuffer[i] = (int) _reader.getLong(docIds[i], readerContext);
-            }
-            break;
-          case FLOAT:
-            for (int i = 0; i < length; i++) {
-              valueBuffer[i] = (int) _reader.getFloat(docIds[i], readerContext);
-            }
-            break;
-          case DOUBLE:
-            for (int i = 0; i < length; i++) {
-              valueBuffer[i] = (int) _reader.getDouble(docIds[i], readerContext);
-            }
-            break;
-          case STRING:
-            for (int i = 0; i < length; i++) {
-              valueBuffer[i] = Integer.parseInt(_reader.getString(docIds[i], readerContext));
-            }
-            break;
-          default:
-            throw new IllegalStateException();
+        if (_reader.getValueType().isFixedWidth()) {

Review comment:
       (Optional) Suggest including `STRING` in the reader interface for completeness. Check `isFixedWidth()` in the `FixedByteChunkSVForwardIndexReader` override method.




-- 
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: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org