public class SmallIntToFixedConverter extends Object
Modifier and Type | Class and Description |
---|---|
static class |
AbstractArrowVectorConverter.TimestampOperationNotAvailableException
Thrown when a Snowflake timestamp cannot be manipulated in Java due to size limitations.
|
Modifier and Type | Field and Description |
---|---|
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
|
protected TimeZone |
sessionTimeZone |
protected int |
sfScale |
protected org.apache.arrow.vector.SmallIntVector |
smallIntVector |
protected boolean |
treatNTZasUTC |
protected boolean |
useSessionTimezone |
Constructor and Description |
---|
SmallIntToFixedConverter(org.apache.arrow.vector.ValueVector fieldVector,
int columnIndex,
DataConversionContext context) |
Modifier and Type | Method and Description |
---|---|
protected short |
getShort(int index) |
boolean |
isNull(int index)
Determine whether source value in arrow vector is null value or not
|
void |
setSessionTimeZone(TimeZone tz) |
void |
setTreatNTZAsUTC(boolean isUTC) |
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 index)
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 index)
Convert value in arrow vector to double data
|
float |
toFloat(int index)
Convert value in arrow vector to float data
|
int |
toInt(int index)
Convert value in arrow vector to int data
|
long |
toLong(int index)
Convert value in arrow vector to long data
|
Object |
toObject(int index)
Convert value in arrow vector to Object
|
short |
toShort(int index)
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
|
protected int sfScale
protected org.apache.arrow.vector.SmallIntVector smallIntVector
protected String logicalTypeStr
protected DataConversionContext context
protected int columnIndex
protected boolean treatNTZasUTC
protected boolean useSessionTimezone
protected TimeZone sessionTimeZone
public static final String FIELD_NAME_EPOCH
public static final String FIELD_NAME_TIME_ZONE_INDEX
public static final String FIELD_NAME_FRACTION
public SmallIntToFixedConverter(org.apache.arrow.vector.ValueVector fieldVector, int columnIndex, DataConversionContext context)
protected short getShort(int index) throws SFException
SFException
public byte[] toBytes(int index) throws SFException
ArrowVectorConverter
toBytes
in interface ArrowVectorConverter
index
- index of the value to be converted in the vectorSFException
- invalid data conversionpublic byte toByte(int index) throws SFException
ArrowVectorConverter
toByte
in interface ArrowVectorConverter
index
- index of the value to be converted in the vectorSFException
- invalid data conversionpublic short toShort(int index) throws SFException
ArrowVectorConverter
toShort
in interface ArrowVectorConverter
index
- index of the value to be converted in the vectorSFException
- invalid data conversionpublic int toInt(int index) throws SFException
ArrowVectorConverter
toInt
in interface ArrowVectorConverter
index
- index of the value to be converted in the vectorSFException
- invalid data conversionpublic long toLong(int index) throws SFException
ArrowVectorConverter
toLong
in interface ArrowVectorConverter
index
- index of the value to be converted in the vectorSFException
- invalid data conversionpublic BigDecimal toBigDecimal(int index) throws SFException
ArrowVectorConverter
toBigDecimal
in interface ArrowVectorConverter
index
- index of the value to be converted in the vectorSFException
- invalid data conversionpublic float toFloat(int index) throws SFException
ArrowVectorConverter
toFloat
in interface ArrowVectorConverter
index
- index of the value to be converted in the vectorSFException
- invalid data conversionpublic double toDouble(int index) throws SFException
ArrowVectorConverter
toDouble
in interface ArrowVectorConverter
index
- index of the value to be converted in the vectorSFException
- invalid data conversionpublic Object toObject(int index) throws SFException
ArrowVectorConverter
toObject
in interface ArrowVectorConverter
index
- index of the value to be converted in the vectorSFException
- invalid data conversionpublic String toString(int index) throws SFException
ArrowVectorConverter
toString
in interface ArrowVectorConverter
index
- index of the value to be converted in the vectorSFException
- invalid data conversionpublic boolean toBoolean(int index) throws SFException
ArrowVectorConverter
toBoolean
in interface ArrowVectorConverter
index
- index of the value to be converted in the vectorSFException
- invalid data conversionpublic Date toDate(int index, TimeZone jvmTz, boolean useDateFormat) throws SFException
ArrowVectorConverter
toDate
in interface ArrowVectorConverter
index
- index of the value to be converted in the vectorjvmTz
- JVM timezoneuseDateFormat
- boolean value to check whether to change timezone or notSFException
- invalid data conversionpublic Time toTime(int index) throws SFException
ArrowVectorConverter
toTime
in interface ArrowVectorConverter
index
- index of the value to be converted in the vectorSFException
- invalid data conversionpublic Timestamp toTimestamp(int index, TimeZone tz) throws SFException
ArrowVectorConverter
toTimestamp
in interface ArrowVectorConverter
index
- index of the value to be converted in the vectortz
- time zoneSFException
- invalid data conversionpublic void setTreatNTZAsUTC(boolean isUTC)
setTreatNTZAsUTC
in interface ArrowVectorConverter
isUTC
- true or false value of whether NTZ timestamp should be set to UTCpublic void setUseSessionTimezone(boolean useSessionTimezone)
ArrowVectorConverter
setUseSessionTimezone
in interface ArrowVectorConverter
public void setSessionTimeZone(TimeZone tz)
setSessionTimeZone
in interface ArrowVectorConverter
public boolean isNull(int index)
ArrowVectorConverter
isNull
in interface ArrowVectorConverter
index
- index of value to be checkedCopyright © 2021. All rights reserved.