Jackie-Jiang commented on code in PR #17239:
URL: https://github.com/apache/pinot/pull/17239#discussion_r2558064567


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/recordtransformer/ComplexTypeTransformer.java:
##########
@@ -233,7 +237,8 @@ public List<GenericRow> transform(List<GenericRow> records) 
{
         if (!_continueOnError) {
           throw new RuntimeException("Caught exception while transforming 
complex types", e);
         }
-        LOGGER.debug("Caught exception while transforming complex types for 
record: {}", record.toString(), e);
+        _throttledLogger.warn(
+            String.format("Caught exception while transforming complex types 
for record: %s", record.toString()), e);

Review Comment:
   Avoid using `String.format` as it is quite expensive. Concatanation should 
be cheaper.
   
   Given `LOGGER.debug()` doesn't do anything when debug level log is not 
enabled, and we are already paying overhead of constructing the string, we 
should consider either:
   - Expose `acquire()` from `_throttledLogger`
   - Pass arguments the same way as what `LOGGER` expects
   
   Not introduced in this PR, but we shouldn't call `record.toString()`. 
Instead, we should directly pass `record`



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