Skip to content

Commit

Permalink
[SPARK-29486][SQL][FOLLOWUP] Document the reason to add days field
Browse files Browse the repository at this point in the history
### What changes were proposed in this pull request?
Follow up of #26134 to document the reason to add days filed and explain how do we use it

### Why are the changes needed?
only comment

### Does this PR introduce any user-facing change?
no

### How was this patch tested?
no need test

Closes #26701 from LinhongLiu/spark-29486-followup.

Authored-by: Liu,Linhong <liulinhong@baidu.com>
Signed-off-by: Sean Owen <sean.owen@databricks.com>
  • Loading branch information
LinhongLiu authored and srowen committed Nov 30, 2019
1 parent 91b83de commit f22177c
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ public final class CalendarInterval implements Serializable, Comparable<Calendar
public final int days;
public final long microseconds;

// CalendarInterval is represented by months, days and microseconds. Months and days are not
// units of time with a constant length (unlike hours, seconds), so they are two separated fields
// from microseconds. One month may be equal to 29, 30 or 31 days and one day may be equal to
// 23, 24 or 25 hours (daylight saving)
public CalendarInterval(int months, int days, long microseconds) {
this.months = months;
this.days = days;
Expand Down

0 comments on commit f22177c

Please sign in to comment.