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. It is a prototype for discussion, so there is no PR.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 sends{i, file}into File Scan's port. File Scan binds$file, opens that file, and its rows flow on to Loop End.Design
Prototype
PortIdentity(-1). The compiler adds it only when a link targets it.init()can readD.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. Loop End receives1through6. It passes locally.Limits
$filethere is no file yet.All reactions