Package net.snowflake.client.core.arrow

## Class IntToTimeConverter

- java.lang.Object
- - net.snowflake.client.core.arrow.IntToTimeConverter

All Implemented Interfaces:
  `ArrowVectorConverter`

    public class IntToTimeConverter
    extends Object

Convert from Arrow IntVector to Time.

### Field Summary

Fields
`protected int` `columnIndex`
`protected DataConversionContext` `context`
`static String` `FIELD_NAME_EPOCH` Field names of the struct vectors used by timestamp
`static String` `FIELD_NAME_FRACTION` Fraction in nanoseconds
`static String` `FIELD_NAME_TIME_ZONE_INDEX` Timezone index
`protected String` `logicalTypeStr` snowflake logical type of the target arrow vector
`protected TimeZone` `sessionTimeZone`
`protected boolean` `treatNTZasUTC`
`protected boolean` `useSessionTimezone`

### Constructor Summary

Constructors
`IntToTimeConverter​(org.apache.arrow.vector.ValueVector fieldVector, int columnIndex, DataConversionContext context)`

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `isNull​(int index)` Determine whether source value in arrow vector is null value or not
`void` `setSessionTimeZone​(TimeZone tz)`
`void` `setTreatNTZAsUTC​(boolean isUTC)` Set to true if NTZ timestamp should be set to UTC
`void` `setUseSessionTimezone​(boolean useSessionTimezone)` Set to true when time value should be displayed in wallclock time (no timezone offset)
`BigDecimal` `toBigDecimal​(int index)` Convert value in arrow vector to BigDecimal
`boolean` `toBoolean​(int index)` Convert value in arrow vector to boolean data
`byte` `toByte​(int rowIndex)` Convert value in arrow vector to byte data
`byte[]` `toBytes​(int index)` Convert value in arrow vector to byte array
`Date` `toDate​(int index, TimeZone jvmTz, boolean useDateFormat)` Convert value in arrow vector to Date
`double` `toDouble​(int rowIndex)` Convert value in arrow vector to double data
`float` `toFloat​(int rowIndex)` Convert value in arrow vector to float data
`int` `toInt​(int rowIndex)` Convert value in arrow vector to int data
`long` `toLong​(int rowIndex)` Convert value in arrow vector to long data
`Object` `toObject​(int index)` Convert value in arrow vector to Object
`short` `toShort​(int rowIndex)` Convert value in arrow vector to short data
`String` `toString​(int index)` Convert value in arrow vector to string
`Time` `toTime​(int index)` Convert value in arrow vector to Time
`Timestamp` `toTimestamp​(int index, TimeZone tz)` Convert value in arrow vector to Timestamp

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

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

### Field Detail

#### logicalTypeStr

    protected String logicalTypeStr

snowflake logical type of the target arrow vector

#### context

    protected DataConversionContext context

#### columnIndex

    protected int columnIndex

#### treatNTZasUTC

    protected boolean treatNTZasUTC

#### useSessionTimezone

    protected boolean useSessionTimezone

#### sessionTimeZone

    protected TimeZone sessionTimeZone

#### FIELD_NAME_EPOCH

    public static final String FIELD_NAME_EPOCH

Field names of the struct vectors used by timestamp

See Also:
  Constant Field Values

#### FIELD_NAME_TIME_ZONE_INDEX

    public static final String FIELD_NAME_TIME_ZONE_INDEX

Timezone index

See Also:
  Constant Field Values

#### FIELD_NAME_FRACTION

    public static final String FIELD_NAME_FRACTION

Fraction in nanoseconds

See Also:
  Constant Field Values

### Constructor Detail

#### IntToTimeConverter

    public IntToTimeConverter​(org.apache.arrow.vector.ValueVector fieldVector,
                              int columnIndex,
                              DataConversionContext context)

Parameters:
  `fieldVector` - ValueVector
  `columnIndex` - column index
  `context` - DataConversionContext

### Method Detail

#### toBytes

    public byte[] toBytes​(int index)
                   throws SFException

Description copied from interface: `ArrowVectorConverter`
Convert value in arrow vector to byte array

Specified by:
  `toBytes` in interface `ArrowVectorConverter`
Parameters:
  `index` - index of the value to be converted in the vector
Returns:
  byte array converted from arrow vector
Throws:
  `SFException` - invalid data conversion

#### toTime

    public Time toTime​(int index)
                throws SFException

Description copied from interface: `ArrowVectorConverter`
Convert value in arrow vector to Time

Specified by:
  `toTime` in interface `ArrowVectorConverter`
Parameters:
  `index` - index of the value to be converted in the vector
Returns:
  Time converted from arrow vector
Throws:
  `SFException` - invalid data conversion

#### toString

    public String toString​(int index)
                    throws SFException

Description copied from interface: `ArrowVectorConverter`
Convert value in arrow vector to string

Specified by:
  `toString` in interface `ArrowVectorConverter`
Parameters:
  `index` - index of the value to be converted in the vector
Returns:
  string converted from arrow vector
Throws:
  `SFException` - invalid data conversion

#### toObject

    public Object toObject​(int index)
                    throws SFException

Description copied from interface: `ArrowVectorConverter`
Convert value in arrow vector to Object

Specified by:
  `toObject` in interface `ArrowVectorConverter`
Parameters:
  `index` - index of the value to be converted in the vector
Returns:
  Object converted from arrow vector
Throws:
  `SFException` - invalid data conversion

#### toTimestamp

    public Timestamp toTimestamp​(int index,
                                 TimeZone tz)
                          throws SFException

Description copied from interface: `ArrowVectorConverter`
Convert value in arrow vector to Timestamp

Specified by:
  `toTimestamp` in interface `ArrowVectorConverter`
Parameters:
  `index` - index of the value to be converted in the vector
  `tz` - time zone
Returns:
  Timestamp converted from arrow vector
Throws:
  `SFException` - invalid data conversion

#### toBoolean

    public boolean toBoolean​(int index)
                      throws SFException

Description copied from interface: `ArrowVectorConverter`
Convert value in arrow vector to boolean data

Specified by:
  `toBoolean` in interface `ArrowVectorConverter`
Parameters:
  `index` - index of the value to be converted in the vector
Returns:
  boolean data converted from arrow vector
Throws:
  `SFException` - invalid data conversion

#### toByte

    public byte toByte​(int rowIndex)
                throws SFException

Description copied from interface: `ArrowVectorConverter`
Convert value in arrow vector to byte data

Specified by:
  `toByte` in interface `ArrowVectorConverter`
Parameters:
  `rowIndex` - index of the value to be converted in the vector
Returns:
  byte data converted from arrow vector
Throws:
  `SFException` - invalid data conversion

#### toShort

    public short toShort​(int rowIndex)
                  throws SFException

Description copied from interface: `ArrowVectorConverter`
Convert value in arrow vector to short data

Specified by:
  `toShort` in interface `ArrowVectorConverter`
Parameters:
  `rowIndex` - index of the value to be converted in the vector
Returns:
  short data converted from arrow vector
Throws:
  `SFException` - invalid data conversion

#### toInt

    public int toInt​(int rowIndex)
              throws SFException

Description copied from interface: `ArrowVectorConverter`
Convert value in arrow vector to int data

Specified by:
  `toInt` in interface `ArrowVectorConverter`
Parameters:
  `rowIndex` - index of the value to be converted in the vector
Returns:
  int data converted from arrow vector
Throws:
  `SFException` - invalid data conversion

#### toLong

    public long toLong​(int rowIndex)
                throws SFException

Description copied from interface: `ArrowVectorConverter`
Convert value in arrow vector to long data

Specified by:
  `toLong` in interface `ArrowVectorConverter`
Parameters:
  `rowIndex` - index of the value to be converted in the vector
Returns:
  long data converted from arrow vector
Throws:
  `SFException` - invalid data conversion

#### toDouble

    public double toDouble​(int rowIndex)
                    throws SFException

Description copied from interface: `ArrowVectorConverter`
Convert value in arrow vector to double data

Specified by:
  `toDouble` in interface `ArrowVectorConverter`
Parameters:
  `rowIndex` - index of the value to be converted in the vector
Returns:
  double data converted from arrow vector
Throws:
  `SFException` - invalid data conversion

#### toFloat

    public float toFloat​(int rowIndex)
                  throws SFException

Description copied from interface: `ArrowVectorConverter`
Convert value in arrow vector to float data

Specified by:
  `toFloat` in interface `ArrowVectorConverter`
Parameters:
  `rowIndex` - index of the value to be converted in the vector
Returns:
  float data converted from arrow vector
Throws:
  `SFException` - invalid data conversion

#### toDate

    public Date toDate​(int index,
                       TimeZone jvmTz,
                       boolean useDateFormat)
                throws SFException

Description copied from interface: `ArrowVectorConverter`
Convert value in arrow vector to Date

Specified by:
  `toDate` in interface `ArrowVectorConverter`
Parameters:
  `index` - index of the value to be converted in the vector
  `jvmTz` - JVM timezone
  `useDateFormat` - boolean value to check whether to change timezone or not
Returns:
  Date converted from arrow vector
Throws:
  `SFException` - invalid data conversion

#### toBigDecimal

    public BigDecimal toBigDecimal​(int index)
                            throws SFException

Description copied from interface: `ArrowVectorConverter`
Convert value in arrow vector to BigDecimal

Specified by:
  `toBigDecimal` in interface `ArrowVectorConverter`
Parameters:
  `index` - index of the value to be converted in the vector
Returns:
  BigDecimal converted from arrow vector
Throws:
  `SFException` - invalid data conversion

#### setTreatNTZAsUTC

    public void setTreatNTZAsUTC​(boolean isUTC)

Description copied from interface: `ArrowVectorConverter`
Set to true if NTZ timestamp should be set to UTC

Specified by:
  `setTreatNTZAsUTC` in interface `ArrowVectorConverter`
Parameters:
  `isUTC` - true or false value of whether NTZ timestamp should be set to UTC

#### setUseSessionTimezone

    public void setUseSessionTimezone​(boolean useSessionTimezone)

Description copied from interface: `ArrowVectorConverter`
Set to true when time value should be displayed in wallclock time (no timezone offset)

Specified by:
  `setUseSessionTimezone` in interface `ArrowVectorConverter`
Parameters:
  `useSessionTimezone` - boolean value indicating if there is a timezone offset.

#### setSessionTimeZone

    public void setSessionTimeZone​(TimeZone tz)

Specified by:
  `setSessionTimeZone` in interface `ArrowVectorConverter`

#### isNull

    public boolean isNull​(int index)

Description copied from interface: `ArrowVectorConverter`
Determine whether source value in arrow vector is null value or not

Specified by:
  `isNull` in interface `ArrowVectorConverter`
Parameters:
  `index` - index of value to be checked
Returns:
  true if null value otherwise false