Class TimestampWrapper
- java.lang.Object
-
- net.snowflake.ingest.streaming.internal.TimestampWrapper
-
public class TimestampWrapper extends Object
This class represents the outcome of timestamp parsing and validation. It contains methods needed to serialize timestamps into Parquet.
-
-
Constructor Summary
Constructors Constructor Description TimestampWrapper(OffsetDateTime offsetDateTime, int scale)Create a new instance fromOffsetDateTimeand its scale.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetEpochSecond()Get epoch in secondsintgetFraction()Get fractional part of a secondintgetTimeZoneIndex()Get timezone index, 1440 means UTC.intgetTimezoneOffsetSeconds()Get timezone offset in secondsBigIntegertoBinary(boolean includeTimezone)Convert the timestamp to a binary representation.
-
-
-
Constructor Detail
-
TimestampWrapper
public TimestampWrapper(OffsetDateTime offsetDateTime, int scale)
Create a new instance fromOffsetDateTimeand its scale.
-
-
Method Detail
-
toBinary
public BigInteger toBinary(boolean includeTimezone)
Convert the timestamp to a binary representation. Needs to be aligned withSFTimestamp.toBinary(int, boolean).
-
getEpochSecond
public long getEpochSecond()
Get epoch in seconds
-
getFraction
public int getFraction()
Get fractional part of a second
-
getTimezoneOffsetSeconds
public int getTimezoneOffsetSeconds()
Get timezone offset in seconds
-
getTimeZoneIndex
public int getTimeZoneIndex()
Get timezone index, 1440 means UTC. Calculation needs to be aligned withSFTimestamp.toBinary(int, boolean)
-
-