Enum Class GranularityType

java.lang.Object
java.lang.Enum<GranularityType>
org.apache.druid.java.util.common.granularity.GranularityType
All Implemented Interfaces:
Serializable, Comparable<GranularityType>, Constable

public enum GranularityType extends Enum<GranularityType>
Only to create a mapping of the granularity and all the supported file patterns namely: default, lowerDefault and hive. NOTE: When a new granularity type is added to following type, DO remember document it here: docs/querying/granularities.md#simple-granularities
  • Enum Constant Details

  • Method Details

    • values

      public static GranularityType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static GranularityType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getDefaultGranularity

      public Granularity getDefaultGranularity()
    • getDateTime

      public org.joda.time.DateTime getDateTime(Integer[] vals)
    • isStandard

      public static boolean isStandard(Granularity granularity)
      For a select subset of granularites, users can specify them directly as string. These are "predefined granularities" or "standard" granularities. For all others, the users will have to use "Duration" or "Period" type granularities
    • fromPeriod

      public static GranularityType fromPeriod(org.joda.time.Period period)
      Note: This is only an estimate based on the values in period. This will not work for complicated periods that represent say 1 year 1 day
    • getHiveFormat

      public String getHiveFormat()
    • getLowerDefaultFormat

      public String getLowerDefaultFormat()
    • getDefaultFormat

      public String getDefaultFormat()