Package net.snowflake.client.jdbc
Enum SnowflakeType
- java.lang.Object
-
- java.lang.Enum<SnowflakeType>
-
- net.snowflake.client.jdbc.SnowflakeType
-
- All Implemented Interfaces:
Serializable,Comparable<SnowflakeType>
public enum SnowflakeType extends Enum<SnowflakeType>
Type converters
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSnowflakeType.JavaDataTypestatic classSnowflakeType.JavaSQLType
-
Field Summary
Fields Modifier and Type Field Description static StringBINARY_CLASS_NAMEstatic StringDATE_OR_TIME_FORMAT_PATTERNstatic StringTIME_FORMAT_PATTERNstatic StringTIMESTAMP_FORMAT_PATTERNstatic StringTIMESTAMP_FORMAT_TZ_PATTERN
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static intconvertStringToType(String typeName)Converts text of data type (returned from SQL query) into Types type, represented by an intstatic StringescapeForCSV(String value)static SnowflakeTypefromString(String name)static SnowflakeType.JavaDataTypegetJavaType(SnowflakeType type)Deprecated.static SnowflakeType.JavaDataTypegetJavaType(SnowflakeType type, boolean isStructuredType)static booleanisJavaTypeSigned(int type)static StringjavaTypeToClassName(int type)static SnowflakeTypejavaTypeToSFType(int javaType, SFBaseSession session)static StringlexicalValue(Object o, DateFormat dateFormat, DateFormat timeFormat, DateFormat timestampFormat, DateFormat timestampTzFormat)Returns a lexical value of an object that is suitable for Snowflake import serializationstatic SnowflakeTypevalueOf(String name)Returns the enum constant of this type with the specified name.static SnowflakeType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
ANY
public static final SnowflakeType ANY
-
ARRAY
public static final SnowflakeType ARRAY
-
BINARY
public static final SnowflakeType BINARY
-
BOOLEAN
public static final SnowflakeType BOOLEAN
-
CHAR
public static final SnowflakeType CHAR
-
DATE
public static final SnowflakeType DATE
-
FIXED
public static final SnowflakeType FIXED
-
INTEGER
public static final SnowflakeType INTEGER
-
OBJECT
public static final SnowflakeType OBJECT
-
MAP
public static final SnowflakeType MAP
-
REAL
public static final SnowflakeType REAL
-
TEXT
public static final SnowflakeType TEXT
-
TIME
public static final SnowflakeType TIME
-
TIMESTAMP
public static final SnowflakeType TIMESTAMP
-
TIMESTAMP_LTZ
public static final SnowflakeType TIMESTAMP_LTZ
-
TIMESTAMP_NTZ
public static final SnowflakeType TIMESTAMP_NTZ
-
TIMESTAMP_TZ
public static final SnowflakeType TIMESTAMP_TZ
-
VARIANT
public static final SnowflakeType VARIANT
-
GEOGRAPHY
public static final SnowflakeType GEOGRAPHY
-
GEOMETRY
public static final SnowflakeType GEOMETRY
-
VECTOR
public static final SnowflakeType VECTOR
-
-
Field Detail
-
DATE_OR_TIME_FORMAT_PATTERN
public static final String DATE_OR_TIME_FORMAT_PATTERN
- See Also:
- Constant Field Values
-
TIMESTAMP_FORMAT_PATTERN
public static final String TIMESTAMP_FORMAT_PATTERN
- See Also:
- Constant Field Values
-
TIMESTAMP_FORMAT_TZ_PATTERN
public static final String TIMESTAMP_FORMAT_TZ_PATTERN
- See Also:
- Constant Field Values
-
TIME_FORMAT_PATTERN
public static final String TIME_FORMAT_PATTERN
- See Also:
- Constant Field Values
-
BINARY_CLASS_NAME
public static final String BINARY_CLASS_NAME
-
-
Method Detail
-
values
public static SnowflakeType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (SnowflakeType c : SnowflakeType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static SnowflakeType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
fromString
public static SnowflakeType fromString(String name)
-
getJavaType
@Deprecated public static SnowflakeType.JavaDataType getJavaType(SnowflakeType type)
Deprecated.
-
getJavaType
@SnowflakeJdbcInternalApi public static SnowflakeType.JavaDataType getJavaType(SnowflakeType type, boolean isStructuredType)
-
convertStringToType
public static int convertStringToType(String typeName)
Converts text of data type (returned from SQL query) into Types type, represented by an int- Parameters:
typeName- type name- Returns:
- int representation of type
-
lexicalValue
public static String lexicalValue(Object o, DateFormat dateFormat, DateFormat timeFormat, DateFormat timestampFormat, DateFormat timestampTzFormat)
Returns a lexical value of an object that is suitable for Snowflake import serialization- Parameters:
o- Java object representing value in Snowflake.dateFormat- java.sql.Date or java.sqlTime formattimeFormat- java.sql.Time formattimestampFormat- first part of java.sql.Timestamp formattimestampTzFormat- last part of java.sql.Timestamp format- Returns:
- String representation of it that can be used for creating a load file
-
javaTypeToSFType
public static SnowflakeType javaTypeToSFType(int javaType, SFBaseSession session) throws SnowflakeSQLException
- Throws:
SnowflakeSQLException
-
javaTypeToClassName
public static String javaTypeToClassName(int type) throws SQLException
- Throws:
SQLException
-
isJavaTypeSigned
public static boolean isJavaTypeSigned(int type)
-
-