Enum GranularityType

  • All Implemented Interfaces:
    Serializable, Comparable<GranularityType>

    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
    • Method Detail

      • values

        public static GranularityType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (GranularityType c : GranularityType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static GranularityType valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type 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()