You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
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.
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.
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.
Activity
Yicong-Huang commentedon Sep 24, 2025
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.
chenlica commentedon Sep 24, 2025
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.
Yicong-Huang commentedon Sep 24, 2025
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.
chenlica commentedon Sep 24, 2025
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.
[-]Reimplementing the Python-based Sort operator using Scala[/-][+]Add a Sort operator using Scala[/+]chenlica commentedon Sep 24, 2025
Revised description: we want to introduce a new Sort operator using Scala.
feat(operator): add Stable Incremental Merge Sort (Scala) (apache#3774)
feat(operator): add Stable Incremental Merge Sort (Scala) (apache#3774)
feat(operator): add Stable Incremental Merge Sort (Scala) (apache#3774)