Repository navigation
A control-variable port on every operator: design and prototype #8915
aglinxinyuan
started this conversation in
Ideas
Replies: 1 comment 1 reply
|
How do you decide which operator properties can resolve at runtime, especially when properties like CSV file paths affect compile time schema inference? And how are the bound values checked against the property’s expected type? |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Summary
Every operator gets one more input port, the control-variable port, drawn in purple. Whatever arrives on it becomes the operator's control variables, and a property that holds
$nametakes the value of the variablename. An existing operator can then run once per loop iteration on a value computed upstream. Today File Scan needs a second "from input" operator for this.A prototype that runs end to end is on
aglinxinyuan/texera:control-variable-port, with draft PR #8917.Example: read every file of a folder
File Scan is a source. Its only change is that it resolves the file name at run time, once
$fileis bound. In each iteration, Loop Start's Output setsfileto that iteration's path and Loop Start sends{i, file}into File Scan's port. File Scan binds$file, opens that file, and its rows flow on to Loop End.Design
table.iloc[[i]]works as before.Prototype
PortIdentity(-1). The compiler adds it only when a link targets it.D. Output runs once per iteration, before Loop Start sends its variables, so the body and the port see what it assigns.PASTA's search needs no change. The prototype adds the port link to
getBlockingAndDependeeLinks, so the sender's region runs before the receiver's. The receiver's own data edge can still be pipelined.End-to-end test.
ControlVariablePortIntegrationSpecruns the example over three files that hold the numbers 1 to 2, 3 to 5 and 6, one per line: once withfileset in Output as above, and once with it set in Initialization and Update. Loop End receives1through6both times, in CI on Linux and macOS. The workflow also runs in a local deployment.Limits
$filethere is no file yet.All reactions