Skip to content

Commit

Permalink
move udf crate to expr folder
Browse files Browse the repository at this point in the history
Signed-off-by: Runji Wang <[email protected]>
  • Loading branch information
wangrunji0408 committed Dec 11, 2023
1 parent 40f5d95 commit a6e981a
Show file tree
Hide file tree
Showing 18 changed files with 7 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ members = [
"src/expr/core",
"src/expr/impl",
"src/expr/macro",
"src/expr/udf",
"src/frontend",
"src/frontend/planner_test",
"src/java_binding",
Expand Down Expand Up @@ -48,7 +49,6 @@ members = [
"src/tests/simulation",
"src/tests/sqlsmith",
"src/tests/state_cleaning_test",
"src/udf",
"src/utils/local_stats_alloc",
"src/utils/pgwire",
"src/utils/runtime",
Expand Down Expand Up @@ -170,7 +170,7 @@ risingwave_sqlsmith = { path = "./src/tests/sqlsmith" }
risingwave_storage = { path = "./src/storage" }
risingwave_stream = { path = "./src/stream" }
risingwave_test_runner = { path = "./src/test_runner" }
risingwave_udf = { path = "./src/udf" }
risingwave_udf = { path = "./src/expr/udf" }
risingwave_variables = { path = "./src/utils/variables" }
risingwave_java_binding = { path = "./src/java_binding" }
risingwave_jni_core = { path = "src/jni_core" }
Expand Down
2 changes: 1 addition & 1 deletion ci/scripts/run-unit-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set -euo pipefail
REPO_ROOT=${PWD}

echo "+++ Run python UDF SDK unit tests"
cd ${REPO_ROOT}/src/udf/python
cd ${REPO_ROOT}/src/expr/udf/python
python3 -m pytest
cd ${REPO_ROOT}

Expand Down
2 changes: 1 addition & 1 deletion e2e_test/udf/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from typing import Iterator, List, Optional, Tuple, Any
from decimal import Decimal

sys.path.append("src/udf/python") # noqa
sys.path.append("src/expr/udf/python") # noqa

from risingwave.udf import udf, udtf, UdfServer

Expand Down
8 changes: 3 additions & 5 deletions integration_tests/feature-store/server/udf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,20 @@
from typing import Iterator, List, Optional, Tuple, Any
from decimal import Decimal

sys.path.append("src/udf/python") # noqa
sys.path.append("src/expr/udf/python") # noqa

from risingwave.udf import udf, UdfServer



@udf(input_types=["INT", "VARCHAR"], result_type="INT")
def udf_sum(x: int, y: str) -> int:
if y=='mfa+':
if y == "mfa+":
return x
else:
return -x



if __name__ == "__main__":
server = UdfServer(location="0.0.0.0:8815")
server.add_function(udf_sum)
server.serve()
server.serve()
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit a6e981a

Please sign in to comment.