Package net.snowflake.client.core.arrow
Class IntToScaledFixedConverter
- java.lang.Object
-
- net.snowflake.client.core.arrow.IntToFixedConverter
-
- net.snowflake.client.core.arrow.IntToScaledFixedConverter
-
- All Implemented Interfaces:
ArrowVectorConverter
public class IntToScaledFixedConverter extends IntToFixedConverter
Data vector whose snowflake logical type is fixed while represented as a int value vector with scale
-
-
Field Summary
Fields Modifier and Type Field Description protected int
columnIndex
protected DataConversionContext
context
static String
FIELD_NAME_EPOCH
Field names of the struct vectors used by timestampstatic String
FIELD_NAME_FRACTION
Fraction in nanosecondsstatic String
FIELD_NAME_TIME_ZONE_INDEX
Timezone indexprotected String
logicalTypeStr
snowflake logical type of the target arrow vectorprotected TimeZone
sessionTimeZone
protected boolean
treatNTZasUTC
protected boolean
useSessionTimezone
-
Fields inherited from class net.snowflake.client.core.arrow.IntToFixedConverter
byteBuf, intVector, sfScale
-
-
Constructor Summary
Constructors Constructor Description IntToScaledFixedConverter(org.apache.arrow.vector.ValueVector fieldVector, int columnIndex, DataConversionContext context, int sfScale)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isNull(int index)
Determine whether source value in arrow vector is null value or notvoid
setSessionTimeZone(TimeZone tz)
void
setTreatNTZAsUTC(boolean isUTC)
Set to true if NTZ timestamp should be set to UTCvoid
setUseSessionTimezone(boolean useSessionTimezone)
Set to true when time value should be displayed in wallclock time (no timezone offset)boolean
toBoolean(int index)
Convert value in arrow vector to boolean dataDate
toDate(int index, TimeZone jvmTz, boolean useDateFormat)
Convert value in arrow vector to Datedouble
toDouble(int index)
Convert value in arrow vector to double datafloat
toFloat(int index)
Convert value in arrow vector to float dataint
toInt(int index)
Convert value in arrow vector to int datalong
toLong(int index)
Convert value in arrow vector to long dataObject
toObject(int index)
Convert value in arrow vector to Objectshort
toShort(int index)
Convert value in arrow vector to short dataString
toString(int index)
Convert value in arrow vector to stringTime
toTime(int index)
Convert value in arrow vector to TimeTimestamp
toTimestamp(int index, TimeZone tz)
Convert value in arrow vector to Timestamp-
Methods inherited from class net.snowflake.client.core.arrow.IntToFixedConverter
getInt, toBigDecimal, toByte, toBytes
-
-
-
-
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
-
IntToScaledFixedConverter
public IntToScaledFixedConverter(org.apache.arrow.vector.ValueVector fieldVector, int columnIndex, DataConversionContext context, int sfScale)
-
-
Method Detail
-
toFloat
public float toFloat(int index) throws SFException
Description copied from interface:ArrowVectorConverter
Convert value in arrow vector to float data- Specified by:
toFloat
in interfaceArrowVectorConverter
- Overrides:
toFloat
in classIntToFixedConverter
- 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 SFException
Description copied from interface:ArrowVectorConverter
Convert value in arrow vector to double data- Specified by:
toDouble
in interfaceArrowVectorConverter
- Overrides:
toDouble
in classIntToFixedConverter
- Parameters:
index
- index of the value to be converted in the vector- Returns:
- double data converted from arrow vector
- Throws:
SFException
- invalid data conversion
-
toShort
public short toShort(int index) throws SFException
Description copied from interface:ArrowVectorConverter
Convert value in arrow vector to short data- Specified by:
toShort
in interfaceArrowVectorConverter
- Overrides:
toShort
in classIntToFixedConverter
- 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 SFException
Description copied from interface:ArrowVectorConverter
Convert value in arrow vector to int data- Specified by:
toInt
in interfaceArrowVectorConverter
- Overrides:
toInt
in classIntToFixedConverter
- 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 SFException
Description copied from interface:ArrowVectorConverter
Convert value in arrow vector to long data- Specified by:
toLong
in interfaceArrowVectorConverter
- Overrides:
toLong
in classIntToFixedConverter
- Parameters:
index
- index of the value to be converted in the vector- Returns:
- long data 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 interfaceArrowVectorConverter
- Overrides:
toObject
in classIntToFixedConverter
- 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:ArrowVectorConverter
Convert value in arrow vector to string- Specified by:
toString
in interfaceArrowVectorConverter
- Overrides:
toString
in classIntToFixedConverter
- 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 SFException
Description copied from interface:ArrowVectorConverter
Convert value in arrow vector to boolean data- Specified by:
toBoolean
in interfaceArrowVectorConverter
- Overrides:
toBoolean
in classIntToFixedConverter
- 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:ArrowVectorConverter
Convert value in arrow vector to Date- Specified by:
toDate
in 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:ArrowVectorConverter
Convert value in arrow vector to Time- Specified by:
toTime
in 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:ArrowVectorConverter
Convert value in arrow vector to Timestamp- Specified by:
toTimestamp
in 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)
Description copied from interface:ArrowVectorConverter
Set to true if NTZ timestamp should be set to UTC- Specified by:
setTreatNTZAsUTC
in 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:ArrowVectorConverter
Set to true when time value should be displayed in wallclock time (no timezone offset)- Specified by:
setUseSessionTimezone
in interfaceArrowVectorConverter
- Parameters:
useSessionTimezone
- boolean value indicating if there is a timezone offset.
-
setSessionTimeZone
public void setSessionTimeZone(TimeZone tz)
- Specified by:
setSessionTimeZone
in interfaceArrowVectorConverter
-
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 interfaceArrowVectorConverter
- Parameters:
index
- index of value to be checked- Returns:
- true if null value otherwise false
-
-