public class TimestampUtils extends Object
Modifier and Type | Field and Description |
---|---|
static BigDecimal |
BILLION_BIG_DECIMAL |
Constructor and Description |
---|
TimestampUtils() |
Modifier and Type | Method and Description |
---|---|
static Timestamp |
decimalToTimestamp(HiveDecimal dec)
Take a HiveDecimal and return the timestamp representation where the fraction part is the
nanoseconds and integer part is the number of seconds.
|
static Timestamp |
decimalToTimestamp(HiveDecimalV1 dec) |
static Timestamp |
decimalToTimestamp(HiveDecimalWritable decWritable,
HiveDecimalWritable scratchDecWritable1,
HiveDecimalWritable scratchDecWritable2)
Take a HiveDecimalWritable and return the timestamp representation where the fraction part
is the nanoseconds and integer part is the number of seconds.
|
static Timestamp |
doubleToTimestamp(double f) |
static double |
getDouble(Timestamp ts)
Convert the timestamp to a double measured in seconds.
|
static long |
millisToSeconds(long millis)
Rounds the number of milliseconds relative to the epoch down to the nearest whole number of
seconds.
|
public static final BigDecimal BILLION_BIG_DECIMAL
public static double getDouble(Timestamp ts)
public static Timestamp doubleToTimestamp(double f)
public static Timestamp decimalToTimestamp(HiveDecimal dec)
dec
- public static Timestamp decimalToTimestamp(HiveDecimalWritable decWritable, HiveDecimalWritable scratchDecWritable1, HiveDecimalWritable scratchDecWritable2)
decWritable
- scratchDecWritable1
- scratchDecWritable2
- public static Timestamp decimalToTimestamp(HiveDecimalV1 dec)
public static long millisToSeconds(long millis)
Copyright © 2021 The Apache Software Foundation. All rights reserved.