You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm testing the Vector Similarity function using this statement but getting the corresponding error: For VECTOR_SIMILARITY predicate, the second operand must be a float array literal
select ProductId, UserId, l2_distance(ARRAY[0.1,0.1,0.3,0.4],ARRAY[0.1,0.1,0.3,0.4]) as l2_dist, n_tokens, combined
from fineFoodReviews
where VECTOR_SIMILARITY(ARRAY[0.1,0.1,0.3,0.4],ARRAY[0.1,0.1,0.3,0.4], 5)
-- order by l2_dist ASClimit5
ProcessingException(errorCode:150, message:SQLParsingError:
org.apache.pinot.sql.parsers.SqlCompilationException: For VECTOR_SIMILARITY predicate, the second operand must be a float array literal, got: Expression(type:FUNCTION, functionCall:Function(operator:VECTOR_SIMILARITY, operands:[Expression(type:LITERAL, literal:<Literal doubleArrayValue:[0.1, 0.1, 0.3, 0.4]>), Expression(type:LITERAL, literal:<Literal doubleArrayValue:[0.1, 0.1, 0.3, 0.4]>), Expression(type:LITERAL, literal:<Literal longValue:5>)]))
at org.apache.pinot.sql.parsers.rewriter.PredicateComparisonRewriter.updateFunctionExpression(PredicateComparisonRewriter.java:139)
at org.apache.pinot.sql.parsers.rewriter.PredicateComparisonRewriter.updatePredicate(PredicateComparisonRewriter.java:65)
at org.apache.pinot.sql.parsers.rewriter.PredicateComparisonRewriter.rewrite(PredicateComparisonRewriter.java:40)
at org.apache.pinot.sql.parsers.CalciteSqlParser.queryRewrite(CalciteSqlParser.java:569))
Workaround is to use CTE & multistage = true
with DIST as (
SELECT
ProductId,
Summary,
Score,
l2_distance(ARRAY[0.1,0.1,0.3,0.4],ARRAY[0.1,0.1,0.3,0.4]) AS l2_dist
from fineFoodReviews
)
select*from DIST
where l2_dist < .6order by l2_dist asc
The text was updated successfully, but these errors were encountered:
Here is the SQL executed in python that encountered this error.
SELECT
ProductId,
Summary,
Score,
l2_distance(embedding, ARRAY{search_embedding}) AS l2_dist
from fineFoodReviews
where VECTOR_SIMILARITY(embedding, ARRAY{search_embedding}, 5)
order by l2_dist asc
I'm testing the Vector Similarity function using this statement but getting the corresponding error:
For VECTOR_SIMILARITY predicate, the second operand must be a float array literal
Workaround is to use CTE & multistage = true
The text was updated successfully, but these errors were encountered: