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


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/loader/defaultcolumn/BaseDefaultColumnHandler.java:
##########
@@ -812,6 +775,274 @@ private void createDerivedColumnV1Indices(String column, 
FunctionEvaluator funct
     }
   }
 
+  /**
+   * Helper method to convert the output of a transform function to the 
appropriate type for an SV or MV
+   * {@link FieldSpec.DataType#INT} field
+   *
+   * @param outputValue the output of the transform function
+   * @param isSingleValue true if the field (column) is single-valued
+   * @param outputValueType the output value type for the transform function; 
can be null (in which case,
+   *                        the {@code outputValue} should be the field's 
default null value)
+   * @param defaultNullValue the default null value for the field
+   * @param dictionary true if the column has a dictionary. For an MV field, 
this results in a primitive array being
+   *                   returned rather than an array of the primitive wrapper 
class
+   * @return the converted output value (either an Integer, an Integer[] or an 
int[])
+   */
+  private Object getIntOutputValue(Object outputValue, boolean isSingleValue, 
PinotDataType outputValueType,
+      Integer defaultNullValue, boolean dictionary) {

Review Comment:
   Good point. Only one code path is using the primitive type, so I guess we 
can keep the boxed value. In the future we may consider changing the object 
array to primitive array to save memory, but that is out of the scope of this PR



-- 
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: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to