-
Notifications
You must be signed in to change notification settings - Fork 914
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
[KYUUBI #6577] Add spark sql engine plugin module and define a sql stringify plugin #6578
base: master
Are you sure you want to change the base?
Conversation
…an only mode of spark engine using SPI
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6578 +/- ##
=======================================
Coverage 0.00% 0.00%
=======================================
Files 677 684 +7
Lines 41806 42222 +416
Branches 5711 5758 +47
=======================================
- Misses 41806 42222 +416 ☔ View full report in Codecov by Sentry. |
import org.apache.spark.sql.SparkSession; | ||
import org.apache.spark.sql.catalyst.plans.logical.LogicalPlan; | ||
|
||
public interface PlanOnlyExecutor { |
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.
Just a curious question, what functions can be used to extend this SPI?
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 hope to only expand the functionality of explaining the execution plan.
|
||
String mode(); | ||
|
||
default String execute(SparkPlans plans) { |
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.
where is this called?
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.
in PlanOnlyStatement
LogicalPlan optimizedPlan(); | ||
SparkPlan sparkPlan(); | ||
SparkPlan executedPlan(); | ||
String mode(); |
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.
can we move the mode to execute?
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.
We will use SPI to load plugins, so we need to define a qualified name for the plugin to distinguish them.
|
||
public interface SparkPlans { | ||
public interface PlanOnlyExecutor { |
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.
How about SQLStringifyPlugin? Since output does not have to be a plan
|
||
public interface SparkPlans { | ||
public interface PlanOnlyExecutor { |
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.
Can we add a developer guide?
|
||
String execute(SparkSession spark, String statement); |
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.
maybe toString
@@ -28,6 +28,7 @@ import org.apache.spark.sql.types.StructType | |||
import org.apache.kyuubi.KyuubiSQLException | |||
import org.apache.kyuubi.config.KyuubiConf.{LINEAGE_PARSER_PLUGIN_PROVIDER, OPERATION_PLAN_ONLY_EXCLUDES, OPERATION_PLAN_ONLY_OUT_STYLE} | |||
import org.apache.kyuubi.engine.spark.KyuubiSparkUtil.getSessionConf | |||
import org.apache.kyuubi.engine.spark.operation.planonly.SQLStringifyPlugins |
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.
So the plugin is actually a must for spark sql engine? why do we need to separate it from the engine module?
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.
So the plugin is actually a must for spark sql engine? why do we need to separate it from the engine module?
Because I don't want to introduce kyuubi engine dependency in kyuubi spark extensions
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.
we have to bundle this when packaging
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.
Yes, the kyuubi server plugin also works this way
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.
This plugin will be lightweight enough to only retain some interface definitions
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.
make sense
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.
LGTM, except for #6578 (comment)
@yaooqinn Thanks for your review, I will add developer guide later. |
🔍 Description
Issue References 🔗
This pull request fixes #6577
Describe Your Solution 🔧
Define a PlanOnlyExecutor interface to extend plan only mode of spark engine using SPI
Types of changes 🔖
Test Plan 🧪
Behavior Without This Pull Request ⚰️
Behavior With This Pull Request 🎉
Related Unit Tests
Checklist 📝
Be nice. Be informative.