You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(table-in-out): blended ("UNNEST-style") RowTransformFunction core (Phase B)
A blended table-in-out function's positional args ARE its per-row input columns
(real typed args, no synthetic TABLE placeholder), so ONE registration serves
every call shape:
geo_encode(52.0, 13.0) -- literal -> one input row
FROM t, geo_encode(t.x, t.y) -- columns -> streaming input
LATERAL geo_encode(t.x, t.y)
The signal is worker-advertised input_from_args (VgiFunctionInfo), parsed off the
catalog function info. Registration enters the in_out_function branch on it even
without a TABLE arg (positional_types are real value types). Bind builds the
worker input schema from the DECLARED positional arg names (the worker reads
columns by name) + the input-provided types, ignoring input_table_names (empty in
the literal shape), and sets single_row_scan for the childless call.
Critical fix — the literal shape is driven by PhysicalTableScan, which acts as a
SOURCE: it re-invokes the callback with the SAME cardinality-1 input chunk and
decides flow SOLELY on chunk.size() (discarding our returned OperatorResultType).
The new single_row_scan branch in VgiTableInOutFunction writes the one synthesized
input row once, CloseInputWriter()s so the worker reaches EOS, then drains to EOS
inside the call (skipping empty-but-not-EOS batches), returning a 0-row chunk ONLY
at true EOS — otherwise the query infinite-loops. Cancel-not-pool the scan-mode
worker on EOS.
Validated end to end: literal / column / LATERAL / projection / int->DOUBLE cast /
1->0 filter all work. No finalize (map-shaped; the worker side rejects a finalize
override on a blended fn). Inline named args (f(x,y, opt:=v)) are NOT yet supported
(a follow-up binder patch). Worker-side RowTransformFunction + fixture land in
vgi-python.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments