Skip to content

Add a Sort operator using Scala #3763

Closed

Description

@chenlica

The current Sort operator (core/workflow-operator/src/main/scala/edu/uci/ics/amber/operator/sort/SortOpDesc.scala) was implemented in Python. We want to replace it with a native Scala implementation.

Activity

  1. Yicong-Huang commented on Sep 24, 2025

    @Yicong-Huang
    Contributor

    Instead of replacing it, can we add a new one? Again for the same logical operator we may be able to choose different physical operators. I see python's sort can be useful down the road. If we add one more Scala implementation of Sort, that'd be great.

  2. chenlica commented on Sep 24, 2025

    @chenlica
    ContributorAuthor

    Meng, Carlos, and I had a discussion. We understand the reason of separating a logical operator from a physical operator. For this particular Sort operator, is there any benefit of keeping the Python implementation compared to the new Scala implementation? If not, maybe we can do the replacement? We can keep this separation for other operators in the future.

  3. Yicong-Huang commented on Sep 24, 2025

    @Yicong-Huang
    Contributor

    Down the road we could fuse UDFs together to reduce data transfer, especially under the use case of sort + visualization (python, plotly). For short term It can be useful for testing purposes such as benchmark for papers. And it looks good to have more operators in general.

    I see no big harm from keeping it? it is functional, after all.

    As for performance, Python sorting is generally slower than Scala sorting, but it’s unclear how much of the slowdown comes from cross-language data transfer versus the sorting itself. From Meng’s earlier inspection, it seems the sorting itself is not particularly slow.

    All in all, I vote for adding a new implementation of Scala sort and let users choose, instead of replacing the existing Python sort.

  4. chenlica commented on Sep 24, 2025

    @chenlica
    ContributorAuthor

    Carlos, @mengw15 , and I had another discussion and agreed with @Yicong-Huang . We will revise this issue and raise a PR to add a new Sort operator in Scala. We may raise another issue to modify the compiler to use the new Scala Sort operator.

  5. changed the title [-]Reimplementing the Python-based Sort operator using Scala[/-] [+]Add a Sort operator using Scala[/+] on Sep 24, 2025
  6. chenlica commented on Sep 24, 2025

    @chenlica
    ContributorAuthor

    Revised description: we want to introduce a new Sort operator using Scala.

  7. added a commit that references this issue on Oct 17, 2025
    2780caa
  8. added a commit that references this issue on May 20, 2026
    f9456f9
  9. added a commit that references this issue on Jun 22, 2026
    4733391
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions