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

feat: add external c++ udf #1509

Merged
merged 46 commits into from
Apr 13, 2022
Merged

feat: add external c++ udf #1509

merged 46 commits into from
Apr 13, 2022

Conversation

dl239
Copy link
Collaborator

@dl239 dl239 commented Mar 25, 2022

create function statement as below:

CREATE FUNCTION cut2(x STRING) RETURNS STRING OPTIONS (FILE='libtest_udf.so');

drop function statement:

DROP FUNCTION cut2;

execute udf function

SELECT cut2(c1) FROM t1;

TODO:

  • register function in spark
  • udaf register

Problems:

  • run deployment failed if relevant function has been dropped

@github-actions
Copy link
Contributor

github-actions bot commented Mar 25, 2022

Linux Test Report

       56 files       183 suites   44m 26s ⏱️
  8 210 tests   8 210 ✔️ 0 💤 0
12 126 runs  12 126 ✔️ 0 💤 0

Results for commit 162d4f1.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 25, 2022

SDK Test Report

  72 files    72 suites   7m 25s ⏱️
172 tests 169 ✔️ 3 💤 0
212 runs  209 ✔️ 3 💤 0

Results for commit 162d4f1.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 25, 2022

HybridSE Linux Test Report

       65 files       232 suites   5m 57s ⏱️
18 882 tests 18 882 ✔️ 0 💤 0

Results for commit 162d4f1.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 25, 2022

HybridSE Mac Test Report

       65 files       232 suites   6m 28s ⏱️
18 882 tests 18 882 ✔️ 0 💤 0

Results for commit 162d4f1.

♻️ This comment has been updated with latest results.

@codecov
Copy link

codecov bot commented Mar 25, 2022

Codecov Report

Merging #1509 (dc75e40) into main (fad76a8) will decrease coverage by 0.35%.
The diff coverage is 47.86%.

❗ Current head dc75e40 differs from pull request most recent head 162d4f1. Consider uploading reports for the commit 162d4f1 to get more accurate results

@@             Coverage Diff              @@
##               main    #1509      +/-   ##
============================================
- Coverage     67.47%   67.11%   -0.36%     
  Complexity      323      323              
============================================
  Files           600      600              
  Lines        114806   114632     -174     
  Branches        999      998       -1     
============================================
- Hits          77462    76939     -523     
- Misses        37137    37486     +349     
  Partials        207      207              
Impacted Files Coverage Δ
hybridse/include/node/node_manager.h 100.00% <ø> (ø)
hybridse/include/vm/engine.h 96.05% <ø> (ø)
hybridse/src/codegen/udf_ir_builder.h 100.00% <ø> (ø)
hybridse/src/node/expr_node.cc 80.75% <0.00%> (-1.42%) ⬇️
hybridse/src/plan/planner.h 100.00% <ø> (ø)
hybridse/src/udf/udf.cc 84.26% <0.00%> (-0.48%) ⬇️
hybridse/src/udf/udf.h 100.00% <ø> (ø)
hybridse/src/udf/udf_library.h 100.00% <ø> (ø)
hybridse/src/vm/jit_runtime.h 33.33% <0.00%> (-66.67%) ⬇️
hybridse/src/vm/jit_wrapper_test.cc 95.34% <0.00%> (ø)
... and 87 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fad76a8...162d4f1. Read the comment docs.

@dl239
Copy link
Collaborator Author

dl239 commented Mar 28, 2022

C UDF support

@dl239 dl239 linked an issue Apr 11, 2022 that may be closed by this pull request
Copy link
Collaborator

@tobegit3hub tobegit3hub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dl239 dl239 changed the title feat: add external c udf feat: add external c++ udf Apr 13, 2022
src/cmd/sql_cmd_test.cc Outdated Show resolved Hide resolved
sr->ExecuteSQL(create_sql, &status);
ASSERT_TRUE(status.IsOK()) << status.msg;
HandleSQL("insert into t1 values ('aab', 11, 1.2);");
std::string so_path = openmldb::test::GetParentDir(openmldb::test::GetExeDir()) + "/libtest_udf.so";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should ensure libtest_udf.so was built before sql_cmd_test

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

libtest_udf.so has been built before sql_cmd_test run.

Copy link
Collaborator

@zhanghaohit zhanghaohit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dl239 dl239 merged commit 2db9c24 into 4paradigm:main Apr 13, 2022
@dl239 dl239 deleted the feat/external_c_udf branch April 15, 2022 06:13
@lumianph lumianph mentioned this pull request May 13, 2022
39 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support c UDF
4 participants