Skip to content

Commit

Permalink
Make UDFs public when added to schema provider
Browse files Browse the repository at this point in the history
Restore the previous logic of modifying the UDF syntax tree at the time
we add it to the schema provider. Also use the schema provider in the
check udf flow.
  • Loading branch information
jbeisen committed Nov 14, 2023
1 parent a64a894 commit cc35c80
Show file tree
Hide file tree
Showing 9 changed files with 239 additions and 271 deletions.
83 changes: 42 additions & 41 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion arroyo-console/src/udf_state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export const getLocalUdfsContextValue = () => {
`/*\n` +
`[dependencies]\n\n` +
`*/\n\n` +
`pub fn ${functionName}(x: i64) -> i64 {\n` +
`fn ${functionName}(x: i64) -> i64 {\n` +
' // Write your function here\n' +
' // Tip: rename the function to something descriptive\n\n' +
'}';
Expand Down
5 changes: 2 additions & 3 deletions arroyo-controller/src/compiler.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::cargo_toml;
use crate::states::fatal;
use crate::{cargo_toml, parse_dependencies};
use anyhow::{anyhow, Result};
use arroyo_datastream::{parse_type, Operator, Program, WasmBehavior};
use arroyo_rpc::grpc::compiler_grpc_client::CompilerGrpcClient;
Expand Down Expand Up @@ -145,11 +145,10 @@ impl ProgramCompiler {
.udfs
.iter()
.map(|udf| {
let dependencies = parse_dependencies(&udf.definition)?;
Ok(UdfCrate {
name: udf.name.to_string(),
definition: udf.definition.to_string(),
cargo_toml: cargo_toml(&udf.name, &dependencies),
cargo_toml: cargo_toml(&udf.name, &udf.dependencies),
})
})
.collect()
Expand Down
Loading

0 comments on commit cc35c80

Please sign in to comment.