Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

package org.apache.spark.unsafe.types;

import org.apache.spark.annotation.Unstable;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.Duration;
Expand All @@ -27,8 +29,21 @@
import static org.apache.spark.sql.catalyst.util.DateTimeConstants.*;

/**
* The internal representation of interval type.
* The class representing calendar intervals. The calendar interval is stored internally in
* three components:
* <ul>
* <li>an integer value representing the number of `months` in this interval,</li>
* <li>an integer value representing the number of `days` in this interval,</li>
* <li>a long value representing the number of `microseconds` in this interval.</li>
* </ul>
*
* The `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 28, 29, 30 or 31 days
* and one day may be equal to 23, 24 or 25 hours (daylight saving).
*
* @since 1.5.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a question: @cloud-fan .
Although this is technically correct, if this is going to public in 3.00, @since 3.0.0 is better?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is 1.5.0, people will get confused and may try to use it 2.4.x.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @gatorsmile , too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a good point. Do we have a clear rule about how to decide the since version. To me 3.0 is better here, as we've changed this class a lot in 3.0.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

checked the java doc about since https://www.oracle.com/technetwork/java/javase/documentation/index-137868.html#@since

When a class (or interface) is introduced, specify one since tag in its class description and no since tags in the members. Add a since tag only to members added in a later version than the class. ...

If a member changes from protected to public in a later release, the since tag would not change, even though it is now usable by any caller, not just subclassers.

1.5.0 should be fine I guess

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... the since tag would not change ...

This is different from what we are facing here. We are adding a since tag. not changing an existing one.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

raise a followup to fix this #27299, thanks @dongjoon-hyun @cloud-fan

*/
@Unstable
public final class CalendarInterval implements Serializable {
public final int months;
public final int days;
Expand Down