-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-18121][SQL] Unable to query global temp views when hive support is enabled #15649
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
|
ok to test |
|
@cloud-fan Could you take a look at this? The code changes look good to me. Thanks! |
|
LGTM |
| test("query global temp view") { | ||
| val df = Seq(1).toDF("i1") | ||
| df.createGlobalTempView("tbl1") | ||
| checkAnswer(spark.sql("select * from global_temp.tbl1"), Row(1)) |
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.
instead of hardcode global_temp here, we should read the conf: spark.sharedState.globalTempViewManager.database
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 @cloud-fan. I have changed the test to get the global_temp db from the conf. spark.conf.get("spark.sql.globalTempDatabase”)
It looks like there are two ways to get it:
- One is using the conf
- Accessing the spark.sharedState.globalTempViewManager.database
In the test, I am now getting it from the conf. Please see if this is ok. Thanks.
|
ok to test |
|
LGTM |
|
Test build #67621 has finished for PR 15649 at commit
|
|
retest this please |
|
Test build #67627 has finished for PR 15649 at commit
|
|
Test build #67657 has finished for PR 15649 at commit
|
|
thanks, merging to master! |
|
Thanks @cloud-fan, @gatorsmile, @viirya |
…t is enabled ## What changes were proposed in this pull request? Issue: Querying on a global temp view throws Table or view not found exception. Fix: Update the lookupRelation in HiveSessionCatalog to check for global temp views similar to the SessionCatalog.lookupRelation. Before fix: Querying on a global temp view ( for. e.g.: select * from global_temp.v1) throws Table or view not found exception After fix: Query succeeds and returns the right result. ## How was this patch tested? - Two unit tests are added to check for global temp view for the code path when hive support is enabled. - Regression unit tests were run successfully. ( build/sbt -Phive hive/test, build/sbt sql/test, build/sbt catalyst/test) Author: Sunitha Kambhampati <[email protected]> Closes apache#15649 from skambha/lookuprelationChanges.
…t is enabled ## What changes were proposed in this pull request? Issue: Querying on a global temp view throws Table or view not found exception. Fix: Update the lookupRelation in HiveSessionCatalog to check for global temp views similar to the SessionCatalog.lookupRelation. Before fix: Querying on a global temp view ( for. e.g.: select * from global_temp.v1) throws Table or view not found exception After fix: Query succeeds and returns the right result. ## How was this patch tested? - Two unit tests are added to check for global temp view for the code path when hive support is enabled. - Regression unit tests were run successfully. ( build/sbt -Phive hive/test, build/sbt sql/test, build/sbt catalyst/test) Author: Sunitha Kambhampati <[email protected]> Closes apache#15649 from skambha/lookuprelationChanges.
What changes were proposed in this pull request?
Issue:
Querying on a global temp view throws Table or view not found exception.
Fix:
Update the lookupRelation in HiveSessionCatalog to check for global temp views similar to the SessionCatalog.lookupRelation.
Before fix:
Querying on a global temp view ( for. e.g.: select * from global_temp.v1) throws Table or view not found exception
After fix:
Query succeeds and returns the right result.
How was this patch tested?