abhishekrb19 commented on code in PR #16529:
URL: https://github.com/apache/druid/pull/16529#discussion_r1635582046
##########
processing/src/main/java/org/apache/druid/segment/FloatDimensionIndexer.java:
##########
@@ -52,6 +52,16 @@ public EncodedKeyComponent<Float>
processRowValsToUnsortedEncodedKeyComponent(@N
return new EncodedKeyComponent<>(f, Float.BYTES);
}
+ @Override
+ public EncodedKeyComponent<Float>
processRowValsToUnsortedEncodedKeyComponent(@Nullable Object dimValues, boolean
reportParseExceptions, @Nullable String dimension)
+ {
+ Float l = DimensionHandlerUtils.convertObjectToFloat(dimValues,
reportParseExceptions, dimension);
Review Comment:
super nit: variable rename for float: `Float l` -> `Float f`
##########
extensions-core/kafka-indexing-service/src/test/java/org/apache/druid/indexing/kafka/KafkaIndexTaskTest.java:
##########
@@ -1634,8 +1634,8 @@ public void testMultipleParseExceptionsSuccess() throws
Exception
List<String> expectedMessages = Arrays.asList(
"Unable to parse value[notanumber] for field[met1]",
- "could not convert value [notanumber] to float",
- "could not convert value [notanumber] to long",
+ "could not convert value [notanumber] to float for dimension
[dimFloat]",
Review Comment:
I think CI is failing because these test expectations need to be updated?
##########
processing/src/main/java/org/apache/druid/segment/FloatDimensionIndexer.java:
##########
@@ -52,6 +52,16 @@ public EncodedKeyComponent<Float>
processRowValsToUnsortedEncodedKeyComponent(@N
return new EncodedKeyComponent<>(f, Float.BYTES);
Review Comment:
For this method override, just return
`processRowValsToUnsortedEncodedKeyComponent(dimValues, reportParseExceptions,
null)` to avoid duplication of code
##########
processing/src/main/java/org/apache/druid/segment/DimensionIndexer.java:
##########
@@ -137,6 +137,15 @@ EncodedKeyComponent<EncodedKeyComponentType>
processRowValsToUnsortedEncodedKeyC
boolean reportParseExceptions
);
+ default EncodedKeyComponent<EncodedKeyComponentType>
processRowValsToUnsortedEncodedKeyComponent(
Review Comment:
Since this is an interface method, it could use a brief javadoc:
```suggestion
/**
* Similar to {@link #processRowValsToUnsortedEncodedKeyComponent}, but
with an optional
* dimension parameter to provide more context for error handling where
applicable.
*/
default EncodedKeyComponent<EncodedKeyComponentType>
processRowValsToUnsortedEncodedKeyComponent(
```
--
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]