Copilot commented on code in PR #16306:
URL: https://github.com/apache/pinot/pull/16306#discussion_r2209430570


##########
pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/custom/JsonPathTest.java:
##########
@@ -212,7 +212,7 @@ public void testComplexQueries(boolean 
useMultiStageQueryEngine)
       Assert.assertEquals(k4.get("k4-k1"), "value-k4-k1-" + i);
       Assert.assertEquals(k4.get("k4-k2"), "value-k4-k2-" + i);
       Assert.assertEquals(k4.get("k4-k3"), "value-k4-k3-" + i);
-      Assert.assertEquals(Double.parseDouble(k4.get("met").toString()), 
(double) i);
+      Assert.assertEquals(Double.parseDouble(k4.get("met").toString()), i);

Review Comment:
   [nitpick] This change removes an unnecessary cast to double since 
assertEquals can handle the comparison between double and int directly, but the 
original cast was explicit about the expected type. Consider keeping the 
explicit cast for clarity of intent.
   ```suggestion
         Assert.assertEquals(Integer.parseInt(k4.get("met").toString()), i);
   ```



##########
pinot-core/src/main/java/org/apache/pinot/core/operator/transform/function/JsonExtractKeyTransformFunction.java:
##########
@@ -90,8 +132,27 @@ public String[][] transformToStringValuesMV(ValueBlock 
valueBlock) {
     initStringValuesMV(length);
     String[] jsonStrings = 
_jsonFieldTransformFunction.transformToStringValuesSV(valueBlock);
     for (int i = 0; i < length; i++) {
-      List<String> values = 
JSON_PARSER_CONTEXT.parse(jsonStrings[i]).read(_jsonPath);
-      _stringValuesMV[i] = values.toArray(new String[0]);
+      // Call the appropriate JsonFunctions method based on available 
parameters
+      List values;

Review Comment:
   The variable 'values' should be declared with a generic type 'List<String>' 
instead of raw type 'List' to improve type safety and avoid potential 
ClassCastException.
   ```suggestion
         List<String> values;
   ```



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