You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "austin362667 (via GitHub)" <gi...@apache.org> on 2024/08/28 17:35:18 UTC
Re: [PR] Add `array_distance` function [datafusion]
austin362667 commented on code in PR #12211:
URL: https://github.com/apache/datafusion/pull/12211#discussion_r1735047031
##########
datafusion/sqllogictest/test_files/aggregate.slt:
##########
@@ -416,6 +416,50 @@ from data
----
1
+# csv_query_distance
+query R
+SELECT distance(c2, c12) FROM aggregate_test_100
+----
+27.565541154252
+
+# single_row_query_distance
+query R
+select distance(sq.column1, sq.column2) from (values (1.1, 2.2)) as sq
+----
+1.1
+
+# all_nulls_query_distance
+query R
+with data as (
+ select null::int as f, null::int as b
+ union all
+ select null::int as f, null::int as b
+)
+select distance(f, b)
+from data
+----
+0
+
+# distance_query_with_nulls
+query R
+with data as (
+ select 1 as f, 4 as b
+ union all
+ select null as f, 99 as b
+ union all
+ select 2 as f, 5 as b
+ union all
+ select 98 as f, null as b
+ union all
+ select 3 as f, 6 as b
+ union all
+ select null as f, null as b
+)
+select distance(f, b)
+from data
+----
+5.196152422707
+
Review Comment:
Sure let's do it this way~
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org