I want to write a Snowflake scripting block where I embed some text, then do some cosine similarity search. Ideally I would like to be able to assign the embedded text to a variable so I can re-use in in multiple places.
The problem is no matter how I try to assign it, I get the error:
SQL compilation error: Unsupported datatype 'VECTOR(FLOAT, 768)'.
If I simply run this statement outside of a scripting block, it works just fine.
select SNOWFLAKE.CORTEX.EMBED_TEXT_768('snowflake-arctic-embed-m-v1.5', 'hello world')
But if I try any of the variations below within a scripting block, I get that error.
begin
-- None of these work.
let e vector(float, 768):= SNOWFLAKE.CORTEX.EMBED_TEXT_768('snowflake-arctic-embed-m-v1.5', 'hello world');
-- let e := SNOWFLAKE.CORTEX.EMBED_TEXT_768('snowflake-arctic-embed-m-v1.5', 'hello world');
-- let e := (SELECT SNOWFLAKE.CORTEX.EMBED_TEXT_768('snowflake-arctic-embed-m-v1.5', 'hello world'));
-- ...
return TRUE;
end;
Can anyone help me understand why I am getting this error and if there is a way to assign a vector embedding to a variable within a scripting block in Snowflake?
Limitations
The VECTOR data type isn’t supported for use with the following Snowflake features:
- Snowflake Scripting
- ...