yaooqinn commented on a change in pull request #26399: [SPARK-29757][SQL] Move
calendar interval constants together
URL: https://github.com/apache/spark/pull/26399#discussion_r343197306
##########
File path:
common/unsafe/src/main/java/org/apache/spark/unsafe/types/CalendarInterval.java
##########
@@ -24,23 +24,18 @@
import java.time.temporal.ChronoUnit;
import java.util.Objects;
+import static org.apache.spark.sql.catalyst.util.DateTimeConstants.*;
+
/**
* The internal representation of interval type.
*/
public final class CalendarInterval implements Serializable {
- public static final long MICROS_PER_MILLI = 1000L;
- public static final long MICROS_PER_SECOND = MICROS_PER_MILLI * 1000;
- public static final long MICROS_PER_MINUTE = MICROS_PER_SECOND * 60;
- public static final long MICROS_PER_HOUR = MICROS_PER_MINUTE * 60;
- public static final long MICROS_PER_DAY = MICROS_PER_HOUR * 24;
- public static final long MICROS_PER_WEEK = MICROS_PER_DAY * 7;
-
public final int months;
public final int days;
public final long microseconds;
public long milliseconds() {
Review comment:
I just pushed a commit to mv `CalendarInterval`'s toString method to
`IntervalUtils` then we may able to mv `DateTimeConstants` to catalyst module.
I will do this tomorrow if you approved this, otherwise revert the change.
Besides, with this change, it may be convenient for us to impement
different interval output style like Postgres does
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]