Skip to content

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

Closed
gatorsmile wants to merge 2 commits into
apache:masterfrom
gatorsmile:createOrReplaceGlobalTempView
Closed

[SPARK-19236][SQL][FOLLOW-UP] Added createOrReplaceGlobalTempView method#18147
gatorsmile wants to merge 2 commits into
apache:masterfrom
gatorsmile:createOrReplaceGlobalTempView

Conversation

@gatorsmile

@gatorsmilegatorsmile commented May 30, 2017

Copy link
Copy Markdown
Member

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

@gatorsmilegatorsmile changed the title [SPARK-19236][CORE] Added createOrReplaceGlobalTempView method[SPARK-19236][SQL][FOLLOW-UP] Added createOrReplaceGlobalTempView methodMay 30, 2017
Comment threadpython/pyspark/sql/dataframe.py Outdated
>>> df.createOrReplaceGlobalTempView("people")
>>> df2 = df.filter(df.age > 3)
>>> df2.createOrReplaceGlobalTempView("people")
>>> df3 = spark.sql("select * from people")

@dongjoon-hyundongjoon-hyunMay 30, 2017

Copy link
Copy Markdown
Member

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
Copy Markdown

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
Copy Markdown
MemberAuthor

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
Copy Markdown

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
Copy Markdown
MemberAuthor

cc @cloud-fan@ueshin

"""
self._jdf.createGlobalTempView(name)

@since(2.2)

Copy link
Copy Markdown
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
Copy Markdown
MemberAuthor

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
Copy Markdown
Member

LGTM except for @cloud-fan's comment.

@cloud-fan

Copy link
Copy Markdown
Contributor

thanks, merging to master!

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 freeto 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

@gatorsmile@SparkQA@ueshin@cloud-fan@dongjoon-hyun