Enum SnowflakeType
- java.lang.Object
-
- java.lang.Enum<SnowflakeType>
-
- net.snowflake.client.api.resultset.SnowflakeType
-
- All Implemented Interfaces:
Serializable,Comparable<SnowflakeType>
public enum SnowflakeType extends Enum<SnowflakeType>
Enumeration of Snowflake data types.This enum represents the various data types supported by Snowflake. These type values are used in metadata operations such as
FieldMetadata.getBase()to describe the underlying type of a field in structured types (OBJECT, ARRAY, MAP).Usage Example
Additionally, this enum includes JDBC type code extensions for Snowflake-specific data types not covered byimport net.snowflake.client.api.resultset.FieldMetadata; import net.snowflake.client.api.resultset.SnowflakeType; // Get field metadata from a structured type column FieldMetadata field = resultSetMetaData.getColumnFields(1).get(0); SnowflakeType baseType = field.getBase(); if (baseType == SnowflakeType.TEXT) { System.out.println("Field is a text type"); } else if (baseType == SnowflakeType.INTEGER) { System.out.println("Field is an integer type"); }Types.These constants can be used with
PreparedStatement.setObject(int, Object, int)to specify the target SQL type when binding parameters to Snowflake-specific types. *Example usage:
PreparedStatement pstmt = connection.prepareStatement("INSERT INTO t VALUES (?)"); pstmt.setObject(1, myTimestamp, SnowflakeType.EXTRA_TYPES_TIMESTAMP_NTZ);- Since:
- 4.0.0
- See Also:
FieldMetadata
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ANYRepresents an ANY type (unspecified/dynamic)ARRAYRepresents an ARRAY typeBINARYRepresents a BINARY typeBOOLEANRepresents a BOOLEAN typeCHARRepresents a CHAR typeDATERepresents a DATE typeDECFLOATRepresents a DECFLOAT (decimal floating-point) typeFIXEDRepresents a FIXED-point numeric type (NUMBER with scale)GEOGRAPHYRepresents a GEOGRAPHY typeGEOMETRYRepresents a GEOMETRY typeINTEGERRepresents an INTEGER typeINTERVAL_DAY_TIMERepresents an INTERVAL DAY TO TIME typeINTERVAL_YEAR_MONTHRepresents an INTERVAL YEAR TO MONTH typeMAPRepresents a MAP typeOBJECTRepresents an OBJECT type (structured)REALRepresents a REAL (floating-point) typeTEXTRepresents a TEXT/VARCHAR typeTIMERepresents a TIME typeTIMESTAMPRepresents a TIMESTAMP type (no timezone)TIMESTAMP_LTZRepresents a TIMESTAMP with local timezoneTIMESTAMP_NTZRepresents a TIMESTAMP with no timezoneTIMESTAMP_TZRepresents a TIMESTAMP with timezoneVARIANTRepresents a VARIANT (semi-structured) typeVECTORRepresents a VECTOR type
-
Field Summary
Fields Modifier and Type Field Description static intEXTRA_TYPES_DAY_TIME_INTERVALstatic intEXTRA_TYPES_DECFLOATstatic intEXTRA_TYPES_TIMESTAMP_LTZstatic intEXTRA_TYPES_TIMESTAMP_NTZstatic intEXTRA_TYPES_TIMESTAMP_TZstatic intEXTRA_TYPES_VECTORstatic intEXTRA_TYPES_YEAR_MONTH_INTERVAL
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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
Represents an ANY type (unspecified/dynamic)
-
ARRAY
public static final SnowflakeType ARRAY
Represents an ARRAY type
-
BINARY
public static final SnowflakeType BINARY
Represents a BINARY type
-
BOOLEAN
public static final SnowflakeType BOOLEAN
Represents a BOOLEAN type
-
CHAR
public static final SnowflakeType CHAR
Represents a CHAR type
-
DATE
public static final SnowflakeType DATE
Represents a DATE type
-
DECFLOAT
public static final SnowflakeType DECFLOAT
Represents a DECFLOAT (decimal floating-point) type
-
FIXED
public static final SnowflakeType FIXED
Represents a FIXED-point numeric type (NUMBER with scale)
-
INTEGER
public static final SnowflakeType INTEGER
Represents an INTEGER type
-
OBJECT
public static final SnowflakeType OBJECT
Represents an OBJECT type (structured)
-
MAP
public static final SnowflakeType MAP
Represents a MAP type
-
REAL
public static final SnowflakeType REAL
Represents a REAL (floating-point) type
-
TEXT
public static final SnowflakeType TEXT
Represents a TEXT/VARCHAR type
-
TIME
public static final SnowflakeType TIME
Represents a TIME type
-
TIMESTAMP
public static final SnowflakeType TIMESTAMP
Represents a TIMESTAMP type (no timezone)
-
TIMESTAMP_LTZ
public static final SnowflakeType TIMESTAMP_LTZ
Represents a TIMESTAMP with local timezone
-
TIMESTAMP_NTZ
public static final SnowflakeType TIMESTAMP_NTZ
Represents a TIMESTAMP with no timezone
-
TIMESTAMP_TZ
public static final SnowflakeType TIMESTAMP_TZ
Represents a TIMESTAMP with timezone
-
INTERVAL_YEAR_MONTH
public static final SnowflakeType INTERVAL_YEAR_MONTH
Represents an INTERVAL YEAR TO MONTH type
-
INTERVAL_DAY_TIME
public static final SnowflakeType INTERVAL_DAY_TIME
Represents an INTERVAL DAY TO TIME type
-
VARIANT
public static final SnowflakeType VARIANT
Represents a VARIANT (semi-structured) type
-
GEOGRAPHY
public static final SnowflakeType GEOGRAPHY
Represents a GEOGRAPHY type
-
GEOMETRY
public static final SnowflakeType GEOMETRY
Represents a GEOMETRY type
-
VECTOR
public static final SnowflakeType VECTOR
Represents a VECTOR type
-
-
Field Detail
-
EXTRA_TYPES_TIMESTAMP_LTZ
public static final int EXTRA_TYPES_TIMESTAMP_LTZ
- See Also:
- Constant Field Values
-
EXTRA_TYPES_TIMESTAMP_TZ
public static final int EXTRA_TYPES_TIMESTAMP_TZ
- See Also:
- Constant Field Values
-
EXTRA_TYPES_TIMESTAMP_NTZ
public static final int EXTRA_TYPES_TIMESTAMP_NTZ
- See Also:
- Constant Field Values
-
EXTRA_TYPES_VECTOR
public static final int EXTRA_TYPES_VECTOR
- See Also:
- Constant Field Values
-
EXTRA_TYPES_DECFLOAT
public static final int EXTRA_TYPES_DECFLOAT
- See Also:
- Constant Field Values
-
EXTRA_TYPES_YEAR_MONTH_INTERVAL
public static final int EXTRA_TYPES_YEAR_MONTH_INTERVAL
- See Also:
- Constant Field Values
-
EXTRA_TYPES_DAY_TIME_INTERVAL
public static final int EXTRA_TYPES_DAY_TIME_INTERVAL
- See Also:
- Constant Field Values
-
-
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
-
-