richardstartin commented on a change in pull request #7920:
URL: https://github.com/apache/pinot/pull/7920#discussion_r772841788



##########
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:
       I didn't add string because the optimisation isn't relevant because of 
the way the data's laid out. I can add it with a default implementation if you 
think that's cleaner.




-- 
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]

Reply via email to