kz930 opened a new pull request, #8766:
URL: https://github.com/apache/texera/pull/8766

   ### What changes were proposed in this PR?
   
   A port that finishes with no rows used to reach a Python table operator as a 
table with no columns, because the column names were read off the tuples. Any 
operator naming one of its columns then raised `KeyError`: Sort, the 
visualization operators, and any user-written `UDFTableOperator`. The operator 
now gets the port's declared columns with no rows under them.
   
   `Operator` gains an `input_schemas` mapping, keyed by port index. 
`DataProcessor` writes the finishing port's schema into it just before calling 
`on_finish`, reading it from the input manager's own port. 
`TableOperator.on_finish` uses it only when the port carried no tuples. 
`Table.empty_of` builds that frame through Arrow, so each column carries the 
dtype it would have had with rows in it.
   
   ### Any related issues, documentation, discussions?
   
   Closes #8735, which settled on this design (option 3). The same change was 
first proposed in #8488.
   
   ### How was this PR tested?
   
   Two new cases:
   - `test_on_finish_with_no_rows_keeps_the_declared_columns` in 
`TestTableOperator` finishes a port with an INTEGER and a STRING column and no 
rows. It asserts that both columns arrive and that the integer one is `int32`.
   - `test_second_input_port_with_no_rows_finishes_as_itself` in `TestMainLoop` 
checks the same through the main loop for a second input port.
   
   Both fail when the operator is handed the old columnless table. The rest of 
`amber/src/test/python` passes. The only failures are the tests under 
`core/storage/iceberg`, which need a running Postgres and Iceberg REST catalog.
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Claude Opus 5.5)
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to