Skip to content

Commit

Permalink
chore: add udf compat ci (#17184)
Browse files Browse the repository at this point in the history
chore: add udf script compat
  • Loading branch information
TCeason authored Jan 8, 2025
1 parent a2b69dd commit 64885e2
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/actions/test_compat_fuse/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ runs:
bash ./tests/compat_fuse/test_compat_fuse.sh 1.2.318 1.2.527 rbac
bash ./tests/compat_fuse/test_compat_fuse_forward.sh 1.2.307 1.2.527 rbac
bash ./tests/compat_fuse/test_compat_fuse_forward.sh 1.2.318 1.2.527 rbac
bash ./tests/compat_fuse/test_compat_fuse.sh 1.2.680 1.2.680 udf
bash ./tests/compat_fuse/test_compat_fuse_forward.sh 1.2.680 1.2.680 udf
- name: Upload failure
if: failure()
uses: ./.github/actions/artifact_failure
Expand Down
13 changes: 13 additions & 0 deletions tests/compat_fuse/compat-logictest/udf/fuse_compat_read
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
query F
select number, gcd_js(number * 3, number * 6) from numbers(5) where number > 0 order by 1
----
1 3
2 6
3 9
4 12


query T
SELECT name FROM SYSTEM.USER_FUNCTIONS where name = 'gcd_js' ORDER BY name;
----
gcd_js
17 changes: 17 additions & 0 deletions tests/compat_fuse/compat-logictest/udf/fuse_compat_write
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
statement ok
DROP FUNCTION IF EXISTS add_signed;

statement ok
DROP FUNCTION IF EXISTS gcd_js;

statement ok
CREATE OR REPLACE FUNCTION gcd_js (INT, INT) RETURNS BIGINT LANGUAGE javascript HANDLER = 'gcd_js' AS $$
export function gcd_js(a, b) {
while (b != 0) {
let t = b;
b = a % b;
a = t;
}
return a;
}
$$;

0 comments on commit 64885e2

Please sign in to comment.