-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-20048][SQL] Cloning SessionState does not clone query execution listeners #17379
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
Conversation
|
Test build #75002 has finished for PR 17379 at commit
|
|
retest this please |
|
Test build #75015 has finished for PR 17379 at commit
|
|
Test build #75066 has finished for PR 17379 at commit
|
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.
overall, i am confused as to why listener is not being passed as a constructor param, rather as a complicated override.
And why are docs being removed?
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.
why have you removed these?
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.
These comments are adding little or no value. We should remove or make them more detailed, which would you prefer? If the latter, what's a good doc for shared state and experimental methods?
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.
Added it back, hopefully more descriptive.
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.
why have these been removed?
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.
Each of these is identical to their SessionState counterpart and should be inherited by Scaladoc comment inheritance, do we still need them?
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.
HiveSessionState is gone, so this is not relevant anymore.
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.
Why do it this way? Why not pass it as a constructor param?
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 general rule we followed in the cloneSession PR is that vals that directly depend on SparkSession to be initialized, are to be constructor params. We leave the other vals in the body of class.
The advantage here is less duplicated code between SessionState, HiveSessionState and TestHiveSparkSession.
This is consistent with that, what would be the advantage of changing it to be a param?
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.
Builders were added in SPARK-20100. Changed initialization to use that pattern, so it is a constructor param now.
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.
Add a comment on what it creates? what the two things returned.
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.
super nit: cleaner to do
class CommandCollector extends QueryExecutionListener {
val commands = ...
...
}
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.
neat, changed.
|
Test build #75135 has finished for PR 17379 at commit
|
eb5581a to
16f5bea
Compare
|
Test build #75328 has finished for PR 17379 at commit
|
|
Test build #75331 has finished for PR 17379 at commit
|
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.
Few minor comments.
@hvanhovell should take a look too.
| val conf: SQLConf, | ||
| val experimentalMethods: ExperimentalMethods, | ||
| val functionRegistry: FunctionRegistry, | ||
| val udf: UDFRegistration, |
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.
udf -> udfRegistration
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.
changed.
| * | ||
| * Note 1: The user-defined functions must be deterministic. | ||
| * Note 2: This depends on the `functionRegistry` field. | ||
| */ |
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 file only contains effectively one builder. So it should be named after the class.
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.
changed.
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.
It also contains a mix-in WithTestConf. But renaming is fine.
| * Builder that produces a Hive aware [[SessionState]]. | ||
| */ | ||
| @Experimental | ||
| @InterfaceStability.Unstable |
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 file should not be named HiveSessionState anymore. It doesnt even have the class HiveSessionState. It does have an object HiveSession, but do we need that object any more?
@hvanhovell
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.
Renamed, removed object HiveSessionState.
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.
Yeah, lets rename the file to HiveSessionBuilder.scala
|
Test build #75337 has finished for PR 17379 at commit
|
|
Test build #75338 has finished for PR 17379 at commit
|
|
cc @hvanhovell |
| * | ||
| * Note 1: The user-defined functions must be deterministic. | ||
| * Note 2: This depends on the `functionRegistry` field. | ||
| */ |
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.
Minor: I was wondering why you moved this into the builder?
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.
It was the only thing not initialized in the builder, thought it would be more consistent to have all initialization in the builder. Is this 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.
@kunalkhamar could you rename HiveSessionState into HiveSessionStateBuilder? Other than that, LGTM.
|
@hvanhovell cool, it should be HiveSessionStateBuilder now. |
|
Merging to master. Thanks! |
What changes were proposed in this pull request?
Bugfix from SPARK-19540.
Cloning SessionState does not clone query execution listeners, so cloned session is unable to listen to events on queries.
How was this patch tested?