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

fix(udf): upgrade arrow-udf to 0.5 which fixes rust udf compilation #18862

Merged
merged 3 commits into from
Oct 11, 2024
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: 1 addition & 1 deletion ci/scripts/build-other.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ source ci/scripts/common.sh
echo "--- Build Rust UDF"
cd e2e_test/udf/wasm
rustup target add wasm32-wasi
cargo build --release
cargo build --release --target wasm32-wasi
cd ../../..

echo "--- Build Java packages"
Expand Down
17 changes: 17 additions & 0 deletions e2e_test/udf/rust_udf.slt
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,23 @@ select series(3);
statement ok
drop function series;


statement ok
create function sum_array(integer[]) returns integer language rust as $$
fn sum_array(xs: &[i32]) -> i32 {
xs.iter().sum()
}
$$;

query I
select sum_array(array[1, 2, 3]);
----
6

statement ok
drop function sum_array;


# XXX: this test is disabled in CI because it prints "panicked at" which makes the test fail
# statement ok
# create function panic() returns int language rust as $$
Expand Down
2 changes: 1 addition & 1 deletion e2e_test/udf/wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ edition = "2021"
crate-type = ["cdylib"]

[dependencies]
arrow-udf = "0.4"
arrow-udf = "0.5"
genawaiter = "0.99"
rust_decimal = "1"
serde_json = "1"
2 changes: 1 addition & 1 deletion src/expr/impl/src/udf/wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ fn create_rust(opts: CreateFunctionOptions<'_>) -> Result<CreateFunctionOutput>

let wasm_binary = std::thread::spawn(move || {
let mut opts = arrow_udf_wasm::build::BuildOpts::default();
opts.arrow_udf_version = Some("0.3".to_string());
opts.arrow_udf_version = Some("0.5".to_string());
opts.script = script;
// use a fixed tempdir to reuse the build cache
opts.tempdir = Some(std::env::temp_dir().join("risingwave-rust-udf"));
Expand Down
Loading