net.snowflake.client.core.arrow

## Class VarCharToTextConverter

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

All Implemented Interfaces:
  ArrowVectorConverter

    public class VarCharToTextConverter
    extends Object

### 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`
`static String` `FIELD_NAME_TIME_ZONE_INDEX`
`protected String` `logicalTypeStr` snowflake logical type of the target arrow vector

### Constructor Summary

Constructors
Constructor and Description
`VarCharToTextConverter(org.apache.arrow.vector.ValueVector valueVector, 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
`BigDecimal` `toBigDecimal(int index)` Convert value in arrow vector to BigDecimal
`boolean` `toBoolean(int rowIndex)` 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)` 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

#### 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

See Also:
  Constant Field Values

#### FIELD_NAME_FRACTION

    public static final String FIELD_NAME_FRACTION

See Also:
  Constant Field Values

### Constructor Detail

#### VarCharToTextConverter

    public VarCharToTextConverter(org.apache.arrow.vector.ValueVector valueVector,
                                  int columnIndex,
                                  DataConversionContext context)

### Method Detail

#### toString

    public String toString(int index)

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

#### toBytes

    public byte[] toBytes(int index)

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

#### toObject

    public Object toObject(int index)

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

#### toBoolean

    public boolean toBoolean(int rowIndex)
                      throws SFException

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

Specified by:
  `toBoolean` in interface `ArrowVectorConverter`
Parameters:
  `rowIndex` - 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)
                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
Returns:
  Date 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

#### 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

#### 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

#### 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