Package net.snowflake.client.core.arrow
Class ArrowResultUtil
- java.lang.Object
-
- net.snowflake.client.core.arrow.ArrowResultUtil
-
public class ArrowResultUtil extends Object
Result utility methods specifically for Arrow format
-
-
Field Summary
Fields Modifier and Type Field Description static int
MAX_SCALE_POWERS_OF_10
-
Constructor Summary
Constructors Constructor Description ArrowResultUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Timestamp
createTimestamp(long seconds, int fraction, TimeZone timezone, boolean useSessionTz)
create Java timestamp using seconds since epoch and fraction in nanoseconds For example, 1232.234 represents as epoch = 1232 and fraction = 234,000,000 For example, -1232.234 represents as epoch = -1233 and fraction = 766,000,000 For example, -0.13 represents as epoch = -1 and fraction = 870,000,000static Date
getDate(int day)
new method to get Date from integerstatic Date
getDate(int day, TimeZone oldTz, TimeZone newTz)
Method to get Date from integer using timezone offsetsstatic String
getStringFormat(int scale)
static boolean
isTimestampOverflow(long seconds)
check whether the input seconds out of the scope of Java timestampstatic Timestamp
moveToTimeZone(Timestamp ts, TimeZone oldTZ, TimeZone newTZ)
move the input timestamp form oldTZ to newTZstatic long
powerOfTen(int pow)
static Timestamp
toJavaTimestamp(long epoch, int scale)
generate Java Timestamp object
-
-
-
Field Detail
-
MAX_SCALE_POWERS_OF_10
public static final int MAX_SCALE_POWERS_OF_10
- See Also:
- Constant Field Values
-
-
Method Detail
-
powerOfTen
public static long powerOfTen(int pow)
-
getStringFormat
public static String getStringFormat(int scale)
-
getDate
public static Date getDate(int day)
new method to get Date from integer- Parameters:
day
-- Returns:
- Date
-
getDate
public static Date getDate(int day, TimeZone oldTz, TimeZone newTz) throws SFException
Method to get Date from integer using timezone offsets- Parameters:
day
-oldTz
-newTz
-- Returns:
- Throws:
SFException
-
moveToTimeZone
public static Timestamp moveToTimeZone(Timestamp ts, TimeZone oldTZ, TimeZone newTZ)
move the input timestamp form oldTZ to newTZ- Parameters:
ts
-oldTZ
-newTZ
-- Returns:
- timestamp in newTZ
-
toJavaTimestamp
public static Timestamp toJavaTimestamp(long epoch, int scale)
generate Java Timestamp object- Parameters:
epoch
- the value since epoch timescale
- the scale of the value- Returns:
-
isTimestampOverflow
public static boolean isTimestampOverflow(long seconds)
check whether the input seconds out of the scope of Java timestamp- Parameters:
seconds
-- Returns:
-
createTimestamp
public static Timestamp createTimestamp(long seconds, int fraction, TimeZone timezone, boolean useSessionTz)
create Java timestamp using seconds since epoch and fraction in nanoseconds For example, 1232.234 represents as epoch = 1232 and fraction = 234,000,000 For example, -1232.234 represents as epoch = -1233 and fraction = 766,000,000 For example, -0.13 represents as epoch = -1 and fraction = 870,000,000- Parameters:
seconds
-fraction
-timezone
- - The timezone being used for the toString() formattingtimezone
- -- Returns:
- java timestamp object
-
-