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
`static int` `MAX_SCALE_POWERS_OF_10`

### Constructor Summary

Constructors
`ArrowResultUtil()`

### Method Summary

All Methods Static Methods Concrete Methods

`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

`static Date` `getDate​(int day)` new method to get Date from integer
`static Date` `getDate​(int day, TimeZone oldTz, TimeZone newTz)` Method to get Date from integer using timezone offsets
`static String` `getStringFormat​(int scale)`
`static boolean` `isTimestampOverflow​(long seconds)` check whether the input seconds out of the scope of Java timestamp
`static Timestamp` `moveToTimeZone​(Timestamp ts, TimeZone oldTZ, TimeZone newTZ)` move the input timestamp form oldTZ to newTZ
`static long` `powerOfTen​(int pow)`
`static Timestamp` `toJavaTimestamp​(long epoch, int scale)` generate Java Timestamp object
`static Timestamp` `toJavaTimestamp​(long epoch, int scale, TimeZone sessionTimezone, boolean useSessionTimezone)` generate Java Timestamp object

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### MAX_SCALE_POWERS_OF_10

    public static final int MAX_SCALE_POWERS_OF_10

See Also:
  Constant Field Values

### Constructor Detail

#### ArrowResultUtil

    public ArrowResultUtil()

### 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 time
  `scale` - the scale of the value
Returns:

#### toJavaTimestamp

    public static Timestamp toJavaTimestamp​(long epoch,
                                            int scale,
                                            TimeZone sessionTimezone,
                                            boolean useSessionTimezone)

generate Java Timestamp object

Parameters:
  `epoch` - the value since epoch time
  `scale` - 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() formatting
  `timezone` - -
Returns:
  java timestamp object