The GitHub Actions job "Required Checks" on 
texera.git/gh-readonly-queue/main/pr-8709-2c743c00d71d0e3c4e992ad32e772f071addb358
 has succeeded.
Run started by GitHub user aglinxinyuan (triggered by aglinxinyuan).

Head commit for run:
917af5806745358e7a23ef05521ea2e65d776246 / Kary Zheng 
<[email protected]>
feat(workflow-operator): export Aggregate and the sort operators as Python 
(#8709)

### What changes were proposed in this PR?

Aggregate and the sort family (Sort, Stable Merge Sort and Sort
Partitions) implement `StandaloneCodeGenerator`. The sort family's row
order is its contract, so `LogicalOp` gains `orderSensitive`, which
those three override. Anything comparing two runs of an operator reads
it to decide whether the rows have to arrive in the same order or only
be the same rows.

Review then found five places where the block answered a question the
engine answers differently. Aggregate summed an INTEGER column without
the wrap Java ints have, refused a TIMESTAMP column outright, answered a
timestamp average with a timestamp where AVERAGE is declared DOUBLE, and
spelled a boolean in Python's capitals rather than Java's lower case.
The sort put a NaN last on the way down, where the engine puts it first.

The edge values the shared table now carries found one more. Aggregate's
concatenation wrote a double past 1e7 or under 1e-3, and a timestamp, as
Python prints them, where the engine writes what Java's toString gives.
It now writes every value, the lower-case boolean the review asked for
included, through the helper #8597 adds for casting to text.

One change reaches code the engine runs. `getPhysicalPlan` swapped
Aggregate's aggregations for their global-stage form and left them on
the operator. The export compiles a plan and then translates the same
operators, so the script grouped on the result column names and failed.
The operator now keeps what the user set. The desc the global stage
receives is unchanged.

### Any related issues, documentation, discussions?

Part of #8325, step 11b; that issue lists the set in order. Aggregate's
concatenation calls a helper #8597 adds.

Sorting a NaN apart from a null, and grouping on one, need the nullable
dtypes #8704 reads an Arrow file into. Without it a null and a NaN share
a slot and both behave as they did before, so this PR is no worse on its
own and only complete alongside that one.

Closes #8707, the task this change is the whole of.

### How was this PR tested?

Each operator asserts the block it emits in its own spec. The Aggregate
cases the review named run in the verify tables of #8363, which put the
same input through the engine and through the script and compare the
two. What those tables cannot reach stays here as executed tests: a
timestamp at two resolutions and in a zone other than UTC, and a null
kept apart from a NaN in the sort and the group key.

`AggregateOpDescSpec` builds the physical plan and then checks that the
operator still holds the user's aggregations and that its generated code
still reads the input column.

### Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Claude Opus 5)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>

Report URL: https://github.com/apache/texera/actions/runs/41969958885

With regards,
GitHub Actions via GitBox

Reply via email to