Class TimeGranularitySpec

  • All Implemented Interfaces:
    Serializable

    public class TimeGranularitySpec
    extends Object
    implements Serializable
    Deprecated.
    Use DateTimeFieldSpec instead. The TimeGranularitySpec class contains all specs related to time field.

    - DataType: data type of the time column (e.g. INT, LONG).

    - TimeType: time unit of the time column (e.g. MINUTES, HOURS).

    - TimeUnitSize: size of the time buckets (e.g. 10 MINUTES, 2 HOURS). By default this is set to 1.

    - TimeFormat: Can be either EPOCH (default) or SIMPLE_DATE_FORMAT:pattern e.g SIMPLE_DATE_FORMAT:yyyyMMdd

    - Name: name of the time column.

    E.g.

    If the time column is in millisecondsSinceEpoch, constructor can be invoked as:

    TimeGranularitySpec(LONG, MILLISECONDS, timeColumnName)

    If the time column is in tenMinutesSinceEpoch, constructor can be invoked as:

    TimeGranularitySpec(LONG, 10, MINUTES, timeColumnName)

    If the time column is in Simple Date Format:

    new TimeGranularitySpec(DataType.STRING, 1, TimeUnit.HOURS, TimeFormat.SIMPLE_DATE_FORMAT.toString() +":yyyyMMdd", "hour");

    See Also:
    Serialized Form
    • Method Detail

      • getName

        public String getName()
        Deprecated.
      • setName

        public void setName​(String name)
        Deprecated.
      • getTimeType

        public TimeUnit getTimeType()
        Deprecated.
      • setTimeType

        public void setTimeType​(TimeUnit timeType)
        Deprecated.
      • getTimeUnitSize

        public int getTimeUnitSize()
        Deprecated.
      • setTimeUnitSize

        public void setTimeUnitSize​(int timeUnitSize)
        Deprecated.
      • setTimeunitSize

        public void setTimeunitSize​(int timeUnitSize)
        Deprecated.
      • getTimeFormat

        public String getTimeFormat()
        Deprecated.
      • setTimeFormat

        public void setTimeFormat​(String timeFormat)
        Deprecated.
      • toJsonObject

        public com.fasterxml.jackson.databind.node.ObjectNode toJsonObject()
        Deprecated.
        Returns the ObjectNode representing the time granularity spec.

        Only contains fields with non-default value.

        NOTE: here we use ObjectNode to preserve the insertion order.

      • equals

        public boolean equals​(Object o)
        Deprecated.
        Overrides:
        equals in class Object
      • hashCode

        public int hashCode()
        Deprecated.
        Overrides:
        hashCode in class Object