You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Kent Yao (Jira)" <ji...@apache.org> on 2019/11/05 10:00:00 UTC

[jira] [Created] (SPARK-29757) Move calendar interval constants together

Kent Yao created SPARK-29757:
--------------------------------

             Summary: Move calendar interval constants together
                 Key: SPARK-29757
                 URL: https://issues.apache.org/jira/browse/SPARK-29757
             Project: Spark
          Issue Type: Bug
          Components: SQL
    Affects Versions: 3.0.0
            Reporter: Kent Yao



{code:java}
public static final Byte DAYS_PER_MONTH = 30;
  public static final Byte MONTHS_PER_QUARTER = 3;

  public static final int MONTHS_PER_YEAR = 12;
  public static final int YEARS_PER_MILLENNIUM = 1000;
  public static final int YEARS_PER_CENTURY = 100;
  public static final int YEARS_PER_DECADE = 10;

  public static final long NANOS_PER_MICRO = 1000L;
  public static final long MILLIS_PER_SECOND = 1000L;
  public static final long MICROS_PER_MILLI = 1000L;
  public static final long SECONDS_PER_DAY = 24L * 60 * 60;

  public static final long MILLIS_PER_MINUTE = 60 * MILLIS_PER_SECOND;
  public static final long MILLIS_PER_HOUR = 60 * MILLIS_PER_MINUTE;
  public static final long MILLIS_PER_DAY = SECONDS_PER_DAY * MILLIS_PER_SECOND;

  public static final long MICROS_PER_SECOND = MILLIS_PER_SECOND * MICROS_PER_MILLI;
  public static final long MICROS_PER_MINUTE = MILLIS_PER_MINUTE * MICROS_PER_MILLI;
  public static final long MICROS_PER_HOUR = MILLIS_PER_HOUR * MICROS_PER_MILLI;
  public static final long MICROS_PER_DAY = SECONDS_PER_DAY * MICROS_PER_SECOND;
  public static final long MICROS_PER_WEEK = MICROS_PER_DAY * 7;
  public static final long MICROS_PER_MONTH = DAYS_PER_MONTH * MICROS_PER_DAY;
  /* 365.25 days per year assumes leap year every four years */
  public static final long MICROS_PER_YEAR = (36525L * MICROS_PER_DAY) / 100;

  public static final long NANOS_PER_SECOND = NANOS_PER_MICRO * MICROS_PER_SECOND;
  public static final long NANOS_PER_MILLIS = NANOS_PER_MICRO * MICROS_PER_MILLI;
{code}


The above parameters are defined in IntervalUtils, DateTimeUtils, and CalendarInterval, some of them are redundant, some of them are cross-referenced. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org