-
Notifications
You must be signed in to change notification settings - Fork 648
feat(udf): introduce async and batched JavaScript UDF #20403
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
Conversation
Cargo.toml
Outdated
@@ -164,7 +164,7 @@ iceberg-catalog-glue = { git = "https://github.com/risingwavelabs/iceberg-rust.g | |||
opendal = "0.49" | |||
# used only by arrow-udf-flight | |||
arrow-flight = "53" | |||
arrow-udf-js = "0.5" | |||
arrow-udf-js = { git = "https://github.com/arrow-udf/arrow-udf.git", rev = "4562678944210da2b3a094a6383f7b9ebe6cc54c" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait for the release of arrow-udf-js
before this PR merges.
let state = self.runtime.call_agg_create_state()?; | ||
Ok(AggregateState::Any(Box::new(State(state)))) | ||
// FIXME(eric): This is bad. Let's make `create_state` async later | ||
futures::executor::block_on(async { | ||
let state = self.runtime.call_agg_create_state().await?; | ||
Ok(AggregateState::Any(Box::new(State(state)))) | ||
8000 }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we don't support async function create_state
for now, what about using now_or_never
instead of block_on
here?
Signed-off-by: Richard Chien <stdrc@outlook.com>
ba07063
to
0f417d9
Compare
Signed-off-by: Richard Chien <stdrc@outlook.com>
Signed-off-by: Richard Chien <stdrc@outlook.com>
risedev --allow-private link-all-in-one-binaries | ||
risedev link-all-in-one-binaries |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is to avoid a warning complaining duplicated --allow-private
, because risedev
already mean cargo make --allow-private
if let Some(v) = self.always_retry_on_network_error { | ||
options.push(format!("always_retry_on_network_error = {}", v)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xiangjinwu This unparsing bug will finally be addressed. 😄
SqlOptionValue::Value(Value::Boolean(true)) | ||
)) | ||
} | ||
"batch" => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we name it batched
instead? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also use batch=True
in external python udf
Hi, there. 📝 Telemetry Reminder:
|
c9d97c7
to
faacf05
Compare
Signed-off-by: Richard Chien <stdrc@outlook.com> Co-authored-by: Richard Chien <stdrc@outlook.com> Co-authored-by: Noel Kwan <noelkwan1998@gmail.com>
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
This PR adds support for async and batched JavaScript UDF as well as
fetch()
API. Resolves #20391.Syntax:
Notice that UDAF is not supported in this PR. You can confirm this by checking the code of frontend
handle_create_aggregate()
doesn't support the new syntax. However, the internal implementation is mostly ready except here.Checklist
Documentation
Release note