carloea2 opened a new pull request, #3774:
URL: https://github.com/apache/texera/pull/3774
**feat(operator): add Stable Merge Sort (Scala) with multi-key ordering,
nulls handling, and offset/limit (Closes #3763)**
---
## Summary
Adds a new **Stable Merge Sort** operator in Scala. Performs stable
per-partition sort with multiple keys and post-sort offset/limit.
**Closes #3763.**
### Highlights
* New files:
* `StableMergeSortOpDesc.scala` – logical desc + JSON schema.
* `StableMergeSortOpExec.scala` – stable merge sort on buffered tuples.
* `StableMergeSortOpExecSpec.scala` – tests.
* Features:
* Per-key options: `order: asc|desc`, `nulls: first|last`,
`caseInsensitive` (STRING only).
* Supported types: STRING, INTEGER, LONG, DOUBLE, BOOLEAN, TIMESTAMP.
* Stable ordering preserved for equal keys.
* Offset/limit applied **after** sorting.
### Tests
* Asc/desc integers (stability).
* Case-sensitive vs case-insensitive strings.
* Nulls first/last.
* Multi-key across mixed types.
* Offset + limit.
* Missing attribute / unsupported type errors.
* Large input sanity.
* Buffers until `onFinish`.
### Example config
```json
{
"keys": [
{ "attribute": "dept", "order": "asc", "nulls": "last" },
{ "attribute": "score", "order": "desc", "nulls": "last" },
{ "attribute": "name", "order": "asc", "nulls": "last",
"caseInsensitive": true }
],
"offset": 0,
"limit": null
}
```
---
@mengw15
--
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]