Skip to content
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

[SPARK-19236][SQL][FOLLOW-UP] Added createOrReplaceGlobalTempView method #18147

Closed

Conversation

gatorsmile
Copy link
Member

@gatorsmile gatorsmile commented May 30, 2017

What changes were proposed in this pull request?

This PR does the following tasks:

  • Added @ since
  • Added the Python API
  • Added test cases

How was this patch tested?

Added test cases to both Scala and Python

@gatorsmile gatorsmile changed the title [SPARK-19236][CORE] Added createOrReplaceGlobalTempView method [SPARK-19236][SQL][FOLLOW-UP] Added createOrReplaceGlobalTempView method May 30, 2017
>>> df.createOrReplaceGlobalTempView("people")
>>> df2 = df.filter(df.age > 3)
>>> df2.createOrReplaceGlobalTempView("people")
>>> df3 = spark.sql("select * from people")
Copy link
Member

@dongjoon-hyun dongjoon-hyun May 30, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

df3 = spark.sql("select * from global_temp.people")?

@SparkQA
Copy link

SparkQA commented May 30, 2017

Test build #77552 has finished for PR 18147 at commit e266bee.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

// We can also use Catalog API to drop global temp view
spark.catalog.dropGlobalTempView("src2")
intercept[NoSuchTableException](spark.table(s"$globalTempDB.src2"))
// We can also use Dataset API to replace global temp view
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code added are line 38 and line 73-78

@SparkQA
Copy link

SparkQA commented May 31, 2017

Test build #77563 has finished for PR 18147 at commit 9191609.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@gatorsmile
Copy link
Member Author

cc @cloud-fan @ueshin

@@ -191,6 +191,23 @@ def createGlobalTempView(self, name):
"""
self._jdf.createGlobalTempView(name)

@since(2.2)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we didn't merge the original PR to 2.2 right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the backport PR #18167

@ueshin
Copy link
Member

ueshin commented May 31, 2017

LGTM except for @cloud-fan's comment.

@cloud-fan
Copy link
Contributor

thanks, merging to master!

@asfgit asfgit closed this in de934e6 May 31, 2017
asfgit pushed a commit that referenced this pull request Jun 2, 2017
…method

### What changes were proposed in this pull request?

This PR is to backport two PRs for adding the `createOrReplaceGlobalTempView` method
#18147
#16598

---
Added the createOrReplaceGlobalTempView method for dataset API

### How was this patch tested?
N/A

Author: Xiao Li <gatorsmile@gmail.com>

Closes #18167 from gatorsmile/Backport18147.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants