[GitHub] spark pull request #15649: [SPARK-18121][SQL] Unable to query global temp vi...

2016-10-27 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/spark/pull/15649


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #15649: [SPARK-18121][SQL] Unable to query global temp vi...

2016-10-27 Thread skambha
Github user skambha commented on a diff in the pull request:

https://github.com/apache/spark/pull/15649#discussion_r85377599
  
--- Diff: 
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala 
---
@@ -65,6 +65,20 @@ class SQLQuerySuite extends QueryTest with SQLTestUtils 
with TestHiveSingleton {
   import hiveContext._
   import spark.implicits._
 
+  test("query global temp view") {
+val df = Seq(1).toDF("i1")
+df.createGlobalTempView("tbl1")
+checkAnswer(spark.sql("select * from global_temp.tbl1"), Row(1))
--- End diff --

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. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #15649: [SPARK-18121][SQL] Unable to query global temp vi...

2016-10-26 Thread skambha
GitHub user skambha opened a pull request:

https://github.com/apache/spark/pull/15649

[SPARK-18121][SQL] Unable to query global temp views when hive support 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)

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/skambha/spark lookuprelationChanges

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/spark/pull/15649.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #15649


commit 95312dd16c0d5b70996fcdc3a49bcdab29fd99d2
Author: Sunitha Kambhampati 
Date:   2016-10-26T20:11:56Z

Add check for global temp tables in HiveSessionCatalog lookupRelation




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org