问答交流

【代码报错】Invalid Input Error: Attempting to execute an unsuccessful or closed pending query result

由bqvbhs0v创建,最终由small_q 被浏览 11 用户

DOUBLE[]和DOUBLE[ANY]是不同类型吗?


执行如下sql报错:

%%sql
select array_cosine_similarity(cast([1.0, 2.0, 3.0] as double[]), cast([1.0, 2.0, 3.0] as double[]))

\

评论
  • 把数量带上。
  • import dai
  • dai.query("select array_cosine_similarity(cast([1.0, 2.0, 3.0] as double[3]), cast([1.0, 2.0, 3.0] as double[3]))").df()
  • 也可以简洁点:
  • %%sql
  • select array_cosine_similarity([1.0, 2.0, 3.0]::double[3], [1.0, 2.0, 3.0]::double[3])
{link}