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-13890][SQL] Remove some internal classes' dependency on SQLContext #11712

Closed
wants to merge 2 commits into from

Conversation

rxin
Copy link
Contributor

@rxin rxin commented Mar 15, 2016

What changes were proposed in this pull request?

In general it is better for internal classes to not depend on the external class (in this case SQLContext) to reduce coupling between user-facing APIs and the internal implementations. This patch removes SQLContext dependency from some internal classes such as SparkPlanner, SparkOptimizer.

As part of this patch, I also removed the following internal methods from SQLContext:

protected[sql] def functionRegistry: FunctionRegistry
protected[sql] def optimizer: Optimizer
protected[sql] def sqlParser: ParserInterface
protected[sql] def planner: SparkPlanner
protected[sql] def continuousQueryManager
protected[sql] def prepareForExecution: RuleExecutor[SparkPlan]

How was this patch tested?

Existing unit/integration tests.

@rxin
Copy link
Contributor Author

rxin commented Mar 15, 2016

This is based on #11710

For the actual diff, just look at the last commit.

@rxin
Copy link
Contributor Author

rxin commented Mar 15, 2016

cc @cloud-fan

@cloud-fan
Copy link
Contributor

LGTM

@SparkQA
Copy link

SparkQA commented Mar 15, 2016

Test build #53161 has finished for PR 11712 at commit 31fc6cd.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • class SparkOptimizer(experimentalMethods: ExperimentalMethods) extends Optimizer
    • class SparkPlanner(
    • case class CollapseCodegenStages(conf: SQLConf) extends Rule[SparkPlan]
    • case class EnsureRequirements(conf: SQLConf) extends Rule[SparkPlan]
    • case class ReuseExchange(conf: SQLConf) extends Rule[SparkPlan]
    • case class PlanSubqueries(sessionState: SessionState) extends Rule[SparkPlan]

@rxin
Copy link
Contributor Author

rxin commented Mar 15, 2016

Thanks - going to merge this.

@asfgit asfgit closed this in 276c2d5 Mar 15, 2016
roygao94 pushed a commit to roygao94/spark that referenced this pull request Mar 22, 2016
…text

## What changes were proposed in this pull request?
In general it is better for internal classes to not depend on the external class (in this case SQLContext) to reduce coupling between user-facing APIs and the internal implementations. This patch removes SQLContext dependency from some internal classes such as SparkPlanner, SparkOptimizer.

As part of this patch, I also removed the following internal methods from SQLContext:
```
protected[sql] def functionRegistry: FunctionRegistry
protected[sql] def optimizer: Optimizer
protected[sql] def sqlParser: ParserInterface
protected[sql] def planner: SparkPlanner
protected[sql] def continuousQueryManager
protected[sql] def prepareForExecution: RuleExecutor[SparkPlan]
```

## How was this patch tested?
Existing unit/integration tests.

Author: Reynold Xin <rxin@databricks.com>

Closes apache#11712 from rxin/sqlContext-planner.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants