Class Rows

java.lang.Object
org.apache.druid.data.input.Rows

public final class Rows extends Object
  • Method Details

    • toGroupKey

      public static List<Object> toGroupKey(long timeStamp, InputRow inputRow)
      Parameters:
      timeStamp - rollup up timestamp to be used to create group key
      inputRow - input row
      Returns:
      groupKey for the given input row
    • objectToStrings

      public static List<String> objectToStrings(Object inputValue)
      Convert an object to a list of strings. This function translates single value nulls into an empty list, and any nulls inside of a list or array into the string "null". Do not use this method if you don't want this behavior, but note that many implementations of Row.getDimension(String) do use this method, so it is recommended to use Row.getRaw(String) if you want the actual value without this coercion. For legacy reasons, some stuff counts on this incorrect behavior, (such as toGroupKey(long, InputRow)).
    • objectToNumber

      @Nullable public static Number objectToNumber(String name, Object inputValue, @Nullable ValueType outputType, boolean throwParseExceptions)
      Convert an object to a number.
      Parameters:
      name - field name of the object being converted (may be used for exception messages)
      inputValue - the actual object being converted
      outputType - expected return type, or null if it should be automatically detected
      throwParseExceptions - whether this method should throw a ParseException or use a default/null value when is not numeric
      Returns:
      a Number; will not necessarily be the same type as
      Throws:
      ParseException - if the input cannot be converted to a number and throwParseExceptions is true
    • objectToNumber

      public static Number objectToNumber(String name, Object inputValue, boolean throwParseExceptions)
      Shorthand for objectToNumber(String, Object, ValueType, boolean) with null expectedType.