Skip to content

Commit 5fafa65

Browse files
committed
fix test
1 parent 43b5234 commit 5fafa65

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

paimon-spark/paimon-spark-4.0/src/test/scala/org/apache/paimon/spark/sql/VectorSearchPushDownTest.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class VectorSearchPushDownTest extends BaseVectorSearchPushDownTest {
5858
.sql("""
5959
|SELECT id
6060
|FROM T
61-
|ORDER BY sys.cosine_similarity(v, array(50.0, 51.0, 52.0)) DESC
61+
|ORDER BY sys.cosine_similarity(v, array(50.0f, 51.0f, 52.0f)) DESC
6262
|LIMIT 5
6363
|""".stripMargin)
6464
.collect()
@@ -96,7 +96,7 @@ class VectorSearchPushDownTest extends BaseVectorSearchPushDownTest {
9696
val df = spark.sql("""
9797
|SELECT id
9898
|FROM T
99-
|ORDER BY sys.cosine_similarity(v, array(50.0, 51.0, 52.0)) DESC
99+
|ORDER BY sys.cosine_similarity(v, array(50.0f, 51.0f, 52.0f)) DESC
100100
|LIMIT 5
101101
|""".stripMargin)
102102

@@ -145,9 +145,9 @@ class VectorSearchPushDownTest extends BaseVectorSearchPushDownTest {
145145
// Since all vectors point in the same direction (1,1,1), they should all have similarity ~1.0
146146
val result = spark
147147
.sql("""
148-
|SELECT id, sys.cosine_similarity(v, array(0.577, 0.577, 0.577)) as sim
148+
|SELECT id, sys.cosine_similarity(v, array(0.577f, 0.577f, 0.577f)) as sim
149149
|FROM T
150-
|ORDER BY sys.cosine_similarity(v, array(0.577, 0.577, 0.577)) DESC
150+
|ORDER BY sys.cosine_similarity(v, array(0.577f, 0.577f, 0.577f)) DESC
151151
|LIMIT 10
152152
|""".stripMargin)
153153
.collect()

paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/catalyst/optimizer/PushDownVectorSearch.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,3 +272,4 @@ object PushDownVectorSearch extends Rule[LogicalPlan] {
272272
}
273273
}
274274
}
275+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
public class PaimonLambdaFunctionfunction_test { public static java.lang.Long apply(Integer length, Integer width){ return (long) length * width; } }

0 commit comments

Comments
 (0)