Ray's Knowledge Base
Unlock

duql plugin functions: the View passes a PluginCatalog to compile_program, and scalar calls lower to hidden columns

DecisionVerified 30 Sep 2026Holds project: dftracer-utils
Decision. The context, the choice, why, and the options that were turned down.

Context#

duql queries must call plugin ops. The duql library cannot link the dataframe op registry, because dataframe links duql.

Decision#

  • compile_program takes a PluginCatalog (name to COLUMN, TABLE, OTHER or NONE, plus namespaces) that the View builds from the op registry.
  • A scalar plugin call lowers to a hidden column: PipelinePlugin stages run before the derive and select, the derive is lowered entry by entry, then a drop removes the hidden columns. It runs per batch through dftu_dataframe_column_op, with the result type taken from a zero-row probe.
  • call runs a FRAME op through frame_op and ends the pipeline.
  • Plugin calls inside let and sub-queries are refused.

Why#

The catalog crosses the library boundary without a link dependency. Refusing plugin calls in let and sub-queries avoids adding a deterministic flag to the ABI.

Rejected options#

A -undefined dynamic_lookup link flag to reach the registry. Adding a deterministic flag to the ABI so that sub-queries could allow plugin calls.

Also found by searching

  • duql calling a plugin op inside let or a sub-query -> refused: plugin calls not allowed here
  • how can duql call plugin functions when the duql library cannot link the dataframe op registry?
  • how are plugin scalar calls compiled in duql, and what is PluginCatalog in compile_program?
  • plugin function in query lowered to hidden column, -undefined dynamic_lookup rejected, frame_op call
  • how do plugin functions get called from duql queries, why can't duql link the dataframe op registry?
  • scalar plugin call in duql lowers to hidden column, what does compile_program PluginCatalog do
  • design of calling plugin ops from duql, COLUMN TABLE OTHER NONE namespaces
  • dataframe links duql so circular dependency for plugin function registry