Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add udf compat ci #17184

Merged
merged 1 commit into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}
$$;
Loading