Package net.snowflake.client.core.arrow
Class SmallIntToFixedConverter
- java.lang.Object
-
- net.snowflake.client.core.arrow.SmallIntToFixedConverter
-
- All Implemented Interfaces:
ArrowVectorConverter
- Direct Known Subclasses:
SmallIntToScaledFixedConverter
public class SmallIntToFixedConverter extends Object
Data vector whose snowflake logical type is fixed while represented as a short value vector
-
-
Field Summary
Fields Modifier and Type Field Description protected intcolumnIndexprotected DataConversionContextcontextstatic StringFIELD_NAME_EPOCHField names of the struct vectors used by timestampstatic StringFIELD_NAME_FRACTIONstatic StringFIELD_NAME_TIME_ZONE_INDEXprotected StringlogicalTypeStrsnowflake logical type of the target arrow vectorprotected TimeZonesessionTimeZoneprotected intsfScaleprotected org.apache.arrow.vector.SmallIntVectorsmallIntVectorprotected booleantreatNTZasUTCprotected booleanuseSessionTimezone
-
Constructor Summary
Constructors Constructor Description SmallIntToFixedConverter(org.apache.arrow.vector.ValueVector fieldVector, int columnIndex, DataConversionContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected shortgetShort(int index)booleanisNull(int index)Determine whether source value in arrow vector is null value or notvoidsetSessionTimeZone(TimeZone tz)voidsetTreatNTZAsUTC(boolean isUTC)voidsetUseSessionTimezone(boolean useSessionTimezone)Set to true when time value should be displayed in wallclock time (no timezone offset)BigDecimaltoBigDecimal(int index)Convert value in arrow vector to BigDecimalbooleantoBoolean(int index)Convert value in arrow vector to boolean databytetoByte(int index)Convert value in arrow vector to byte databyte[]toBytes(int index)Convert value in arrow vector to byte arrayDatetoDate(int index, TimeZone jvmTz, boolean useDateFormat)Convert value in arrow vector to DatedoubletoDouble(int index)Convert value in arrow vector to double datafloattoFloat(int index)Convert value in arrow vector to float datainttoInt(int index)Convert value in arrow vector to int datalongtoLong(int index)Convert value in arrow vector to long dataObjecttoObject(int index)Convert value in arrow vector to ObjectshorttoShort(int index)Convert value in arrow vector to short dataStringtoString(int index)Convert value in arrow vector to stringTimetoTime(int index)Convert value in arrow vector to TimeTimestamptoTimestamp(int index, TimeZone tz)Convert value in arrow vector to Timestamp
-
-
-
Field Detail
-
sfScale
protected int sfScale
-
smallIntVector
protected org.apache.arrow.vector.SmallIntVector smallIntVector
-
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
- See Also:
- Constant Field Values
-
FIELD_NAME_FRACTION
public static final String FIELD_NAME_FRACTION
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SmallIntToFixedConverter
public SmallIntToFixedConverter(org.apache.arrow.vector.ValueVector fieldVector, int columnIndex, DataConversionContext context)
-
-
Method Detail
-
getShort
protected short getShort(int index) throws SFException- Throws:
SFException
-
toBytes
public byte[] toBytes(int index) throws SFExceptionDescription copied from interface:ArrowVectorConverterConvert value in arrow vector to byte array- Specified by:
toBytesin interfaceArrowVectorConverter- Parameters:
index- index of the value to be converted in the vector- Returns:
- byte array converted from arrow vector
- Throws:
SFException- invalid data conversion
-
toByte
public byte toByte(int index) throws SFExceptionDescription copied from interface:ArrowVectorConverterConvert value in arrow vector to byte data- Specified by:
toBytein interfaceArrowVectorConverter- Parameters:
index- 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 index) throws SFExceptionDescription copied from interface:ArrowVectorConverterConvert value in arrow vector to short data- Specified by:
toShortin interfaceArrowVectorConverter- Parameters:
index- 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 index) throws SFExceptionDescription copied from interface:ArrowVectorConverterConvert value in arrow vector to int data- Specified by:
toIntin interfaceArrowVectorConverter- Parameters:
index- 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 index) throws SFExceptionDescription copied from interface:ArrowVectorConverterConvert value in arrow vector to long data- Specified by:
toLongin interfaceArrowVectorConverter- Parameters:
index- index of the value to be converted in the vector- Returns:
- long data converted from arrow vector
- Throws:
SFException- invalid data conversion
-
toBigDecimal
public BigDecimal toBigDecimal(int index) throws SFException
Description copied from interface:ArrowVectorConverterConvert value in arrow vector to BigDecimal- Specified by:
toBigDecimalin interfaceArrowVectorConverter- Parameters:
index- index of the value to be converted in the vector- Returns:
- BigDecimal converted from arrow vector
- Throws:
SFException- invalid data conversion
-
toFloat
public float toFloat(int index) throws SFExceptionDescription copied from interface:ArrowVectorConverterConvert value in arrow vector to float data- Specified by:
toFloatin interfaceArrowVectorConverter- Parameters:
index- index of the value to be converted in the vector- Returns:
- float data converted from arrow vector
- Throws:
SFException- invalid data conversion
-
toDouble
public double toDouble(int index) throws SFExceptionDescription copied from interface:ArrowVectorConverterConvert value in arrow vector to double data- Specified by:
toDoublein interfaceArrowVectorConverter- Parameters:
index- index of the value to be converted in the vector- Returns:
- double data converted from arrow vector
- Throws:
SFException- invalid data conversion
-
toObject
public Object toObject(int index) throws SFException
Description copied from interface:ArrowVectorConverterConvert value in arrow vector to Object- Specified by:
toObjectin interfaceArrowVectorConverter- Parameters:
index- index of the value to be converted in the vector- Returns:
- Object converted from arrow vector
- Throws:
SFException- invalid data conversion
-
toString
public String toString(int index) throws SFException
Description copied from interface:ArrowVectorConverterConvert value in arrow vector to string- Specified by:
toStringin interfaceArrowVectorConverter- Parameters:
index- index of the value to be converted in the vector- Returns:
- string converted from arrow vector
- Throws:
SFException- invalid data conversion
-
toBoolean
public boolean toBoolean(int index) throws SFExceptionDescription copied from interface:ArrowVectorConverterConvert value in arrow vector to boolean data- Specified by:
toBooleanin interfaceArrowVectorConverter- Parameters:
index- index of the value to be converted in the vector- Returns:
- boolean 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:ArrowVectorConverterConvert value in arrow vector to Date- Specified by:
toDatein interfaceArrowVectorConverter- Parameters:
index- index of the value to be converted in the vectorjvmTz- JVM timezoneuseDateFormat- boolean value to check whether to change timezone or not- Returns:
- Date converted from arrow vector
- Throws:
SFException- invalid data conversion
-
toTime
public Time toTime(int index) throws SFException
Description copied from interface:ArrowVectorConverterConvert value in arrow vector to Time- Specified by:
toTimein interfaceArrowVectorConverter- 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:ArrowVectorConverterConvert value in arrow vector to Timestamp- Specified by:
toTimestampin interfaceArrowVectorConverter- Parameters:
index- index of the value to be converted in the vectortz- time zone- Returns:
- Timestamp converted from arrow vector
- Throws:
SFException- invalid data conversion
-
setTreatNTZAsUTC
public void setTreatNTZAsUTC(boolean isUTC)
- Specified by:
setTreatNTZAsUTCin interfaceArrowVectorConverter- 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:ArrowVectorConverterSet to true when time value should be displayed in wallclock time (no timezone offset)- Specified by:
setUseSessionTimezonein interfaceArrowVectorConverter
-
setSessionTimeZone
public void setSessionTimeZone(TimeZone tz)
- Specified by:
setSessionTimeZonein interfaceArrowVectorConverter
-
isNull
public boolean isNull(int index)
Description copied from interface:ArrowVectorConverterDetermine whether source value in arrow vector is null value or not- Specified by:
isNullin interfaceArrowVectorConverter- Parameters:
index- index of value to be checked- Returns:
- true if null value otherwise false
-
-