Class Rows


  • public final class Rows
    extends Object
    • Method Detail

      • 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 <T extends NumberNumber objectToNumber​(String name,
                                                               Object inputValue,
                                                               boolean throwParseExceptions)
        Convert an object to a number. If NullHandling.replaceWithDefault() is true, this method will never return null. If false, it will return NullHandling.defaultLongValue() instead of null.
        Parameters:
        name - field name of the object being converted (may be used for exception messages)
        inputValue - the actual object being converted
        throwParseExceptions - whether this method should throw a ParseException or use a default/null value when {@param inputValue} is not numeric
        Returns:
        a Number; will not necessarily be the same type as {@param zeroClass}
        Throws:
        ParseException - if the input cannot be converted to a number and throwParseExceptions is true