Jackie-Jiang commented on a change in pull request #6728:
URL: https://github.com/apache/incubator-pinot/pull/6728#discussion_r605137900



##########
File path: 
pinot-core/src/main/java/org/apache/pinot/core/query/selection/SelectionOperatorUtils.java
##########
@@ -490,82 +491,13 @@ public static ResultTable 
renderResultTableWithoutOrdering(List<Object[]> rows,
     return columnToIndexMap;
   }
 
-  /**
-   * Converts a value into the given data type. (Broker side)
-   * <p>Actual value type can be different with data type passed in, but they 
must be type compatible.
-   */
-  public static Serializable convertValueToType(Object value, 
DataSchema.ColumnDataType dataType) {
-    switch (dataType) {
-      // Single-value column
-      case INT:
-        return ((Number) value).intValue();
-      case LONG:
-        return ((Number) value).longValue();
-      case FLOAT:
-        return ((Number) value).floatValue();
-      case DOUBLE:
-        return ((Number) value).doubleValue();
-      // NOTE: Return hex-encoded String for BYTES columns for 
backward-compatibility
-      // TODO: Revisit to see whether we should return byte[] instead
-      case BYTES:
-        return ((ByteArray) value).toHexString();
-
-      // Multi-value column
-      case LONG_ARRAY:
-        // LONG_ARRAY type covers INT_ARRAY and LONG_ARRAY
-        if (value instanceof int[]) {
-          int[] ints = (int[]) value;
-          int length = ints.length;
-          long[] longs = new long[length];
-          for (int i = 0; i < length; i++) {
-            longs[i] = ints[i];
-          }
-          return longs;
-        } else {
-          return (long[]) value;
-        }
-      case DOUBLE_ARRAY:
-        // DOUBLE_ARRAY type covers INT_ARRAY, LONG_ARRAY, FLOAT_ARRAY and 
DOUBLE_ARRAY
-        if (value instanceof int[]) {
-          int[] ints = (int[]) value;
-          int length = ints.length;
-          double[] doubles = new double[length];
-          for (int i = 0; i < length; i++) {
-            doubles[i] = ints[i];
-          }
-          return doubles;
-        } else if (value instanceof long[]) {
-          long[] longs = (long[]) value;
-          int length = longs.length;
-          double[] doubles = new double[length];
-          for (int i = 0; i < length; i++) {
-            doubles[i] = longs[i];
-          }
-          return doubles;
-        } else if (value instanceof float[]) {
-          float[] floats = (float[]) value;
-          int length = floats.length;
-          double[] doubles = new double[length];
-          for (int i = 0; i < length; i++) {
-            doubles[i] = floats[i];
-          }
-          return doubles;
-        } else {
-          return (double[]) value;
-        }
-
-      default:
-        // For STRING, INT_ARRAY, FLOAT_ARRAY and STRING_ARRAY, no need to 
format
-        return (Serializable) value;
-    }
-  }
-
   /**
    * Formats a value into a {@code String} (single-value column) or {@code 
String[]} (multi-value column) based on the
    * data type. (Broker side)
    * <p>Actual value type can be different with data type passed in, but they 
must be type compatible.
    */
-  public static Serializable getFormattedValue(Object value, 
DataSchema.ColumnDataType dataType) {
+  @Deprecated
+  public static Serializable getFormattedValue(Object value, ColumnDataType 
dataType) {

Review comment:
       Yes. Will add some comments




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

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