SnowPro Specialty: Gen AI free question 3 / 10 · Domain 2: Snowflake Gen AI Functions
A table has a VECTOR(FLOAT, 1024) column. Pre-computed embeddings arrive as JSON arrays of floats, some from an older model with 768 values. What does the documentation say about casting them into the column?
- Arrays of 768 values are padded with zeros to 1,024 by the cast.
- Arrays of any length are accepted; the dimension is only a hint.
- Arrays of 768 values are cut to the first 768 of the 1,024 slots.
- An array casts only when it has 1,024 elements of the right type.
Show the answer and explanation
Answer: D
Why this is correct
VECTOR values can be explicitly cast from an ARRAY, a structured ARRAY, or a VARIANT containing an ARRAY. The page says that when converting between VECTOR and ARRAY types, the number of elements in the array must match the dimension of the vector, and the data type of the array elements must match the data type of the vector. The 768-value embeddings need their own column or re-embedding with the 1,024-dimension model.
Why the other options are wrong
"Arrays of 768 values are padded with zeros to 1,024 by the cast." … The page describes no padding. The number of elements must match the dimension, so a 768-value array does not convert to a 1,024-dimension vector.
"Arrays of any length are accepted; the dimension is only a hint." … The dimension is part of the type definition, not a hint. Conversion checks it against the array length.
"Arrays of 768 values are cut to the first 768 of the 1,024 slots." … There are no partial slots in a VECTOR value. The array and the vector must have the same number of elements.
Mixing models
Vectors from different models are not comparable even when their lengths match. Keep one embedding model per column and record which model produced it.
Go to the SnowPro Specialty: Gen AI practice app (10 free questions; purchase unlocks all questions)