Skip to content

chore(spark): remove unneccessary ‘compat’ functions#816

Merged
bestbeforetoday merged 1 commit intosubstrait-io:mainfrom
andrew-coleman:compat
Apr 15, 2026
Merged

chore(spark): remove unneccessary ‘compat’ functions#816
bestbeforetoday merged 1 commit intosubstrait-io:mainfrom
andrew-coleman:compat

Conversation

@andrew-coleman
Copy link
Copy Markdown
Member

When the Spark converter code was refactored to support all of spark v3.0, v3.5 and v4.0, a number of functions with incompatible APIs were abstracted into the ‘SparkCompat’ trait. In the event, ScalarSubquery and Aggregate didn’t need this treatment, so this commit restores the original (simpler) code.

When the Spark converter code was refactored to support
all of spark v3.0, v3.5 and v4.0, a number of functions with
incompatible APIs were abstracted into the ‘SparkCompat’ trait.
In the event, `ScalarSubquery` and `Aggregate` didn’t need
this treatment, so this commit restores the original (simpler) code.

Signed-off-by: Andrew Coleman <andrew_coleman@uk.ibm.com>

override def createScalarSubquery(plan: LogicalPlan): ScalarSubquery = {
// Spark 4.0 simplified constructor - no exprId needed
ScalarSubquery(plan)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Note for others: I was confused that this single argument ScalarSubquery construction for Spark 4.0 is replaced by ScalarSubquery(plan, exprId = NamedExpression.newExprId). Checking deeper, NamedExpression.newExprId is the default for the exprId parameter if none is supplied so the two are functionally equivalent.

@bestbeforetoday bestbeforetoday merged commit 0cb0a1f into substrait-io:main Apr 15, 2026
11 checks passed
@andrew-coleman andrew-coleman deleted the compat branch April 15, 2026 10:38
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.

2 participants