Skip to content

Conversation

@gatorsmile
Copy link
Member

@gatorsmile gatorsmile commented May 28, 2016

What changes were proposed in this pull request?

This PR is to use the latest SparkSession to replace the existing SQLContext in MLlib. SQLContext is removed from MLlib.

Also fix a test case issue in BroadcastJoinSuite.

BTW, SQLContext is not being used in the MLlib test suites.

How was this patch tested?

Existing test cases.

gatorsmile and others added 30 commits November 13, 2015 14:50
@SparkQA
Copy link

SparkQA commented May 29, 2016

Test build #59578 has finished for PR 13380 at commit 5bdc447.

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

@rxin
Copy link
Contributor

rxin commented May 31, 2016

cc @jkbradley / @mengxr are we ok with changing the API?

@Since("1.6.0")
def context(sqlContext: SQLContext): this.type = {
optionSQLContext = Option(sqlContext)
def context(sparkSession: SparkSession): this.type = {
Copy link
Member

Choose a reason for hiding this comment

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

I'd prefer to maintain compatibility. Can you create a new method which accepts a SparkSession?

Copy link
Member Author

@gatorsmile gatorsmile Jun 2, 2016

Choose a reason for hiding this comment

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

I see. Let me fix it now. Thanks!

Copy link
Contributor

Choose a reason for hiding this comment

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

Shall we deprecate these existing methods? Perhaps we can call the new method session (for example)?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks! @MLnick A good point!

@rxin @jkbradley What is your opinion? Should we rename it?

@jkbradley
Copy link
Member

Those are the only items I'd modify. Basically, I like switching to SparkSession but also maintaining compatibility for public APIs. Changing the private APIs is fine.

*/
@transient
private[sql] val sqlContext: SQLContext = new SQLContext(this)
private[spark] val sqlContext: SQLContext = new SQLContext(this)
Copy link
Member Author

Choose a reason for hiding this comment

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

@SparkQA
Copy link

SparkQA commented Jun 2, 2016

Test build #59800 has finished for PR 13380 at commit 7dcaaa4.

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

@gatorsmile
Copy link
Member Author

retest this please

@SparkQA
Copy link

SparkQA commented Jun 14, 2016

Test build #60468 has finished for PR 13380 at commit 7dcaaa4.

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

@MLnick
Copy link
Contributor

MLnick commented Jun 14, 2016

FWIW, I think since SQLContext is deprecated, we should deprecate the context methods in ReadWrite, and create new methods called session (or withSession?) for clarity (since context is ok but doesn't really fit). But no big deal either way, we could deprecate in 2.1 instead.

cc @jkbradley @rxin @yanboliang

@jkbradley
Copy link
Member

+1 for deprecating context() now and calling the new method session()

Sorry for the slow response!

@jkbradley
Copy link
Member

this looks good to me other than deprecating context() and calling the new method session()

@gatorsmile
Copy link
Member Author

@jkbradley Let me change it now. Thanks!

@SparkQA
Copy link

SparkQA commented Jun 17, 2016

Test build #60720 has finished for PR 13380 at commit 42a1ed9.

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

@SparkQA
Copy link

SparkQA commented Jun 17, 2016

Test build #60721 has finished for PR 13380 at commit 0f316f9.

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

// override for Java compatibility
override def session(sparkSession: SparkSession): this.type = super.session(sparkSession)

// override for Java compatibility
Copy link
Member

Choose a reason for hiding this comment

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

Just realized: Can you please change this to call super.session(sqlContext.sparkSession) to avoid a deprecation warning? Same for the other call to context() below.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, will do it. Thanks!

@jkbradley
Copy link
Member

Other than that, this looks ready to me.

@jkbradley
Copy link
Member

LGTM pending tests!

@SparkQA
Copy link

SparkQA commented Jun 22, 2016

Test build #60994 has finished for PR 13380 at commit 65534a0.

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

@jkbradley
Copy link
Member

Merging with master, branch-2.0
Thanks!

asfgit pushed a commit that referenced this pull request Jun 22, 2016
#### What changes were proposed in this pull request?
This PR is to use the latest `SparkSession` to replace the existing `SQLContext` in `MLlib`. `SQLContext` is removed from `MLlib`.

Also fix a test case issue in `BroadcastJoinSuite`.

BTW, `SQLContext` is not being used in the `MLlib` test suites.
#### How was this patch tested?
Existing test cases.

Author: gatorsmile <[email protected]>
Author: xiaoli <[email protected]>
Author: Xiao Li <[email protected]>

Closes #13380 from gatorsmile/sqlContextML.

(cherry picked from commit 0e3ce75)
Signed-off-by: Joseph K. Bradley <[email protected]>
@asfgit asfgit closed this in 0e3ce75 Jun 22, 2016
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.

7 participants