Package dev.frostlake.types
Class VectorType
java.lang.Object
dev.frostlake.types.DataType
dev.frostlake.types.VectorType
- All Implemented Interfaces:
Serializable
Snowflake's
VECTOR(element_type, dimension) type; values are VectorValue.
The ELEMENT TYPE and the DIMENSION are both part of the type's identity, and Snowflake checks
them at COMPILE time: live-verified,
VECTOR_COSINE_SIMILARITY([1,2]::VECTOR(FLOAT,2), [1,2,3]::VECTOR(FLOAT,3)) fails
"Invalid argument types for function 'VECTOR_COSINE_SIMILARITY': (VECTOR(FLOAT, 2),
VECTOR(FLOAT, 3))", as does mixing VECTOR(FLOAT,3) with VECTOR(INT,3). That is why
getName() renders the full parameterization — the error quotes it verbatim — and why
equals(java.lang.Object) compares both parameters.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanformatValue(Object value) getCommonType(DataType other) intgetName()VECTOR(FLOAT, 3)— the exact spelling Snowflake uses in argument-type errors.intgetSize()inthashCode()booleanisCompatible(DataType other) parseValue(String value) Methods inherited from class dev.frostlake.types.DataType
getCategory, toString
-
Constructor Details
-
VectorType
-
-
Method Details
-
getElementType
-
getDimension
public int getDimension() -
getName
VECTOR(FLOAT, 3)— the exact spelling Snowflake uses in argument-type errors. -
parseValue
- Specified by:
parseValuein classDataType
-
formatValue
- Specified by:
formatValuein classDataType
-
isCompatible
- Specified by:
isCompatiblein classDataType
-
getCommonType
- Specified by:
getCommonTypein classDataType
-
getSize
public int getSize() -
equals
-
hashCode
public int hashCode()
-