Skip to content

refactor(common): modularize Js UDF handling with plan an exec phases#1900

Draft
LNSD wants to merge 2 commits intomainfrom
lnsd/refactor-common-attach-js-udfs
Draft

refactor(common): modularize Js UDF handling with plan an exec phases#1900
LNSD wants to merge 2 commits intomainfrom
lnsd/refactor-common-attach-js-udfs

Conversation

@LNSD
Copy link
Contributor

@LNSD LNSD commented Mar 3, 2026

Separate UDF lifecycle into plan-time placeholders and exec-time bindings so the
V8 isolate pool is only needed at execution, not during schema resolution.

  • Add udfs::plan::PlanJsUdf and udfs::exec::ExecJsUdf to split planning from execution
  • Introduce ExecContext::attach() to rewrite plan UDFs into executable ones in a single traversal
  • Move IsolatePool from AmpCatalogProvider into ExecContext
  • Restructure datasets-derived functions into functions.rs with builder pattern
  • Remove js-runtime dependency from admin-api and datasets-derived

@LNSD LNSD self-assigned this Mar 3, 2026
@LNSD LNSD marked this pull request as draft March 3, 2026 23:31
@LNSD LNSD changed the title refactor(common): modularize JavaScript UDF handling with planning an exec phases refactor(common): modularize JavaScript UDF handling with pan an exec phases Mar 3, 2026
@LNSD LNSD changed the title refactor(common): modularize JavaScript UDF handling with pan an exec phases refactor(common): modularize Js UDF handling with plan an exec phases Mar 3, 2026
@LNSD LNSD force-pushed the lnsd/refactor-common-attach-js-udfs branch from 60a7b4b to 5325a07 Compare March 3, 2026 23:32
LNSD added 2 commits March 4, 2026 00:48
…ExecContext

Centralise table-source attachment in ExecContext so the traversal lives next to the catalog and snapshot state it depends on.

- Remove inline `transform_with_subqueries` from `DetachedLogicalPlan::attach_to`; delegate to `ctx.attach()`
- Add `ExecContext::attach()` driving the plan traversal via `attach_table_node`
- Extract `attach_table_node` as a standalone free function replacing `PlanTable` sources with `QueryableSnapshot` providers
- Remove unused imports from `detached_logical_plan.rs`

Signed-off-by: Lorenzo Delgado <lorenzo@edgeandnode.com>
…d execution phases

Separate UDF lifecycle into plan-time placeholders and exec-time bindings so the
V8 isolate pool is only needed at execution, not during schema resolution.

- Add `udfs::plan::PlanJsUdf` and `udfs::exec::ExecJsUdf` to split planning from execution
- Introduce `ExecContext::attach()` to rewrite plan UDFs into executable ones in a single traversal
- Move `IsolatePool` from `AmpCatalogProvider` into `ExecContext`
- Restructure `datasets-derived` functions into `functions.rs` with builder pattern
- Remove `js-runtime` dependency from `admin-api` and `datasets-derived`

Signed-off-by: Lorenzo Delgado <lorenzo@edgeandnode.com>
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.

1 participant