-
Notifications
You must be signed in to change notification settings - Fork 244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor SparkStrategy to fix Spark-4.0 build #12198
Conversation
This reverts commit c35cac8. Signed-off-by: Niranjan Artal <[email protected]>
Signed-off-by: Niranjan Artal <[email protected]>
build |
Signed-off-by: Niranjan Artal <[email protected]>
build |
Signed-off-by: Niranjan Artal <[email protected]>
build |
Signed-off-by: Niranjan Artal <[email protected]>
build |
import org.apache.spark.sql.catalyst.rules.Rule | ||
import org.apache.spark.sql.execution.{ColumnarRule, SparkPlan} | ||
|
||
/** | ||
* Extension point to enable GPU SQL processing. | ||
*/ | ||
class SQLExecPlugin extends (SparkSessionExtensions => Unit) { | ||
class SQLExecPlugin extends (SparkSessionExtensions => Unit) with ConnectShims { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is fine either way, but I think the files will be changed to a smaller extent and more uniformly if we pulled in the type alias via an import
import com.nvidia.spark.rapids.ConnectShims._
instead of requiring with/extends updates
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Gera! I will update it. I was wondering if you had any preference for object
vs trait
? For SparkSession I am planning to create it as an object
in the next PR. It needs to be shimmed and not in common code:
import org.apache.spark.sql.classic.SparkSession
object TrampolineConnectShims {
type SparkSession = org.apache.spark.sql.classic.SparkSession
def cleanupAnyExistingSession(): Unit = SparkSession.cleanupAnyExistingSession()
}
So for SparkStrategy, is keeping it as trait
okay ? (the reason I was thinking of keeping it as object
is we just declare type in the trait and actually don't override any functions).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My preference is to import the type alias via an object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I have updated the PR to import the type alias using an object.
build |
build |
@@ -0,0 +1,21 @@ | |||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this class be shimmed and have two versions, one for Spark 4.0.0 and the other for the rest of the shims?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since I added this in sql-plugin-api, I just kept it in one file as we should not be shimming anything in sql-plugin-api.
For the SparkSession build fix PR-#12227 I did add shims for Spark-4.0 and rest of them. Please let me know if that's okay.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the confusion is that Strategy was just an alias to SparkStrategy and upgrade to Spark 4 only affects the alias. So let us try to simply use SparkStrategy directly.
Signed-off-by: Niranjan Artal <[email protected]>
build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
This contributes to #12062.
This fixes the spark-plugin-api module and also fixes some of the build failures in spark-plugin module which had reference to SparkStrategy. We import from SparkStrategy directly instead of an alias
Strategy
.These failures are fixed now: