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 fromOffsetDateTime
and its scale.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getEpoch()
Get epoch in secondsint
getFraction()
Get fractional part of a secondint
getTimeZoneIndex()
Get timezone index, 1440 means UTC.int
getTimezoneOffsetSeconds()
Get timezone offset in secondsBigInteger
toBinary(boolean includeTimezone)
Convert the timestamp to a binary representation.
-
-
-
Constructor Detail
-
TimestampWrapper
public TimestampWrapper(OffsetDateTime offsetDateTime, int scale)
Create a new instance fromOffsetDateTime
and 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)
.
-
getEpoch
public long getEpoch()
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)
-
-