Jackie-Jiang commented on a change in pull request #7920:
URL: https://github.com/apache/pinot/pull/7920#discussion_r773412644
##########
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:
Yes, that is what I meant. Add `STRING` as the default implementation so
that the default implementation supports all data types. In the override method
we can check `isFixedWidth()` so that `STRING` can fall back to the default
implementation
--
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]