Skip to content

Conversation

comphead
Copy link
Contributor

…262)"

This reverts commit f2baf95.

The function map_sort doesn't exist for Spark, array_sort does but not map_sort. This might be useful in the future but currently it would be more difficult to maintain the code which is not in use.

Which issue does this PR close?

Closes #.

Rationale for this change

What changes are included in this PR?

How are these changes tested?

@codecov-commenter
Copy link

codecov-commenter commented Sep 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 57.66%. Comparing base (f09f8af) to head (98605f1).
⚠️ Report is 491 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2381      +/-   ##
============================================
+ Coverage     56.12%   57.66%   +1.54%     
- Complexity      976     1297     +321     
============================================
  Files           119      147      +28     
  Lines         11743    13512    +1769     
  Branches       2251     2390     +139     
============================================
+ Hits           6591     7792    +1201     
- Misses         4012     4451     +439     
- Partials       1140     1269     +129     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@mbutrovich mbutrovich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @comphead. Something to keep in our back pocket if Spark adds it.

@mbutrovich mbutrovich merged commit 3b29cb9 into apache:main Sep 11, 2025
96 checks passed
@rishvin
Copy link
Contributor

rishvin commented Sep 11, 2025

Hi @comphead / @mbutrovich : Spark does have MapSort internal expression. This piece was required to support grouping on map type. Spark applies it internally. Context here: #1941 (comment)

@comphead
Copy link
Contributor Author

Hi @comphead / @mbutrovich : Spark does have MapSort internal expression. This piece was required to support grouping on map type. Spark applies it internally. Context here: #1941 (comment)

Thanks @rishvin the PR was saying scalar map_sort scalar function but this is MapSort operator to transform DataFrame . I think it would be nice to provide a test case where Spark falls back on MapSort so we can start from there?

@rishvin
Copy link
Contributor

rishvin commented Sep 11, 2025

Hi @comphead / @mbutrovich : Spark does have MapSort internal expression. This piece was required to support grouping on map type. Spark applies it internally. Context here: #1941 (comment)

Thanks @rishvin the PR was saying scalar map_sort scalar function but this is MapSort operator to transform DataFrame . I think it would be nice to provide a test case where Spark falls back on MapSort so we can start from there?

Hi @comphead : This PR was split from my first PR: #2221.
The mentioned PR includes integration tests in the file CometAggregationSuite.scala. Without the required changes, tests will fail. Those tests cases verify the physical plan along with results and without required changes they will have spark's HashAggregate instead of CometHashAggregate. We fallback when we see grouping on map type here -

withInfo(op, "Grouping on map types is not supported")
.

@comphead
Copy link
Contributor Author

comphead commented Sep 11, 2025

. We fallback when we see grouping on map type here -

withInfo(op, "Grouping on map types is not supported")

Alright, now that makes a lot of sense. I'm creating an epic to address HashAggregate issues

where mapSort operator will be one of the tasks.

Feel free to include all the context including the test which you already provided in #1941 (comment)

We need to work a little bit how to decompose the mapSort story into manageable isolated PRs, where the end goal is finite, like test failed -> test passed. How does this sound?

#2382

@rishvin
Copy link
Contributor

rishvin commented Sep 11, 2025

. We fallback when we see grouping on map type here -

withInfo(op, "Grouping on map types is not supported")

Alright, now that makes a lot of sense. I'm creating an epic to address HashAggregate issues

where mapSort operator will be one of the tasks.

Feel free to include all the context including the test which you already provided in #1941 (comment)

We need to work a little bit how to decompose the mapSort story into manageable isolated PRs, where the end goal is finite, like test failed -> test passed. How does this sound?

#2382

Thanks @comphead , SG!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants