-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
[Feature][UDF][WASM] support wasm udf #24504
Conversation
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.
clang-tidy made some suggestions
run buildall |
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.
clang-tidy made some suggestions
There were too many comments to post at once. Showing the first 25 out of 37. Check the log or trigger a new build to see more.
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.
clang-tidy made some suggestions
805d34a
to
34dfaf3
Compare
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.
clang-tidy made some suggestions
There were too many comments to post at once. Showing the first 25 out of 35. Check the log or trigger a new build to see more.
|
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.
clang-tidy made some suggestions
run buildall |
21c82e5
to
6896d89
Compare
run buildall |
347f632
to
61daae1
Compare
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.
clang-tidy made some suggestions
run buildall |
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.
clang-tidy made some suggestions
fe/fe-core/src/main/java/org/apache/doris/analysis/CreateFunctionStmt.java
Show resolved
Hide resolved
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.
clang-tidy made some suggestions
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.
clang-tidy made some suggestions
be/src/util/wasm_manager.h
Outdated
class WasmFunctionManager { | ||
private: | ||
// wasmtime | ||
wasmtime::Engine* engine; |
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.
why not use std::unique_ptr
?
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.
done
try (Store<Void> store = Store.withoutData()) { | ||
try (Engine engine = store.engine(); | ||
Module module = Module.fromFile(engine, url.getFile())) { | ||
return; |
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.
could get the function name, input and return params from module?
Then compare it with the create statement to see if it is consistent
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.
I tried it before, but wasmtime-java jar doesn't support this method. I asked the wasmtime-java author this question, but there has been no reply so far.
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.
ok
run buildall |
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.
clang-tidy made some suggestions
bool WasmFunctionManager::DeleteFunction(std::string functionName) { | ||
auto funcBody = funcs.find(functionName); | ||
if (funcBody == funcs.end()) { | ||
return false; |
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.
warning: redundant boolean literal in conditional return statement [readability-simplify-boolean-expr]
be/src/util/wasm_manager.cpp:80:
- if (funcBody == funcs.end()) {
- return false;
- }
- funcs.erase(functionName);
- return true;
+ return !funcBody == funcs.end();
return Status::OK(); | ||
} | ||
|
||
Status FunctionWasm::execute(FunctionContext* context, Block& block, const ColumnNumbers& arguments, |
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.
warning: function 'execute' exceeds recommended size/complexity thresholds [readability-function-size]
Status FunctionWasm::execute(FunctionContext* context, Block& block, const ColumnNumbers& arguments,
^
Additional context
be/src/vec/functions/function_wasm.cpp:69: 116 lines including whitespace and comments (threshold 80)
Status FunctionWasm::execute(FunctionContext* context, Block& block, const ColumnNumbers& arguments,
^
be/src/vec/functions/function_wasm.h
Outdated
Status execute(FunctionContext* context, Block& block, const ColumnNumbers& arguments, | ||
size_t result, size_t input_rows_count, bool dry_run = false) override; | ||
|
||
bool is_deterministic() const override { return false; } |
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.
warning: method 'is_deterministic' can be made static [readability-convert-member-functions-to-static]
bool is_deterministic() const override { return false; } | |
static bool is_deterministic() override { return false; } |
be/src/vec/functions/function_wasm.h
Outdated
|
||
bool is_deterministic() const override { return false; } | ||
|
||
bool is_deterministic_in_scope_of_query() const override { return false; } |
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.
warning: method 'is_deterministic_in_scope_of_query' can be made static [readability-convert-member-functions-to-static]
bool is_deterministic_in_scope_of_query() const override { return false; } | |
static bool is_deterministic_in_scope_of_query() override { return false; } |
run buildall |
run buildall |
reopen |
run buildall |
run buildall |
1 similar comment
run buildall |
run buildall |
Move to #30789 to view WASM PR |
Proposed changes
Issue Number: close #20267
Support wasm udf via wasmtime library.
Further comments
If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...