Skip to content

Commit

Permalink
Fix scala style
Browse files Browse the repository at this point in the history
  • Loading branch information
evacchi committed Jul 21, 2015
1 parent b01244b commit 253c15e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
9 changes: 6 additions & 3 deletions sql/core/src/main/scala/org/apache/spark/sql/SQLContext.scala
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,11 @@ class SQLContext(@transient val sparkContext: SparkContext)

protected[sql] def parseSql(sql: String): LogicalPlan = ddlParser.parse(sql, false)

protected[sql] def executeSql(sql: String): sparkexecution.QueryExecution = executePlan(parseSql(sql))
protected[sql] def executeSql(sql: String): sparkexecution.QueryExecution =
executePlan(parseSql(sql))

protected[sql] def executePlan(plan: LogicalPlan) = new sparkexecution.QueryExecution(this, plan)
protected[sql] def executePlan(plan: LogicalPlan) =
new sparkexecution.QueryExecution(this, plan)

@transient
protected[sql] val tlSession = new ThreadLocal[SQLSession]() {
Expand Down Expand Up @@ -900,7 +902,8 @@ class SQLContext(@transient val sparkContext: SparkContext)
}

@deprecated("use org.apache.spark.sql.QueryExecution")
protected[sql] class QueryExecution(logical: LogicalPlan) extends sparkexecution.QueryExecution(this, logical)
protected[sql] class QueryExecution(logical: LogicalPlan)
extends sparkexecution.QueryExecution(this, logical)

/**
* Parses the data type in our internal string representation. The data type string should
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ import org.apache.spark.sql.catalyst.plans.logical.LogicalPlan
*/
@Experimental
class QueryExecution(val sqlContext: SQLContext, val logical: LogicalPlan) {
val analyzer = sqlContext.analyzer
val analyzer = sqlContext.analyzer
val optimizer = sqlContext.optimizer
val planner = sqlContext.planner
val planner = sqlContext.planner
val cacheManager = sqlContext.cacheManager
val prepareForExecution = sqlContext.prepareForExecution

Expand Down Expand Up @@ -85,4 +85,4 @@ class QueryExecution(val sqlContext: SQLContext, val logical: LogicalPlan) {
|== RDD ==
""".stripMargin.trim
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@ import org.apache.spark.SparkContext
import org.apache.spark.annotation.Experimental
import org.apache.spark.sql._
import org.apache.spark.sql.catalyst.expressions._
import org.apache.spark.sql.execution.TakeOrderedAndProject
import org.apache.spark.sql.sources.DataSourceStrategy

@Experimental
class SparkPlanner(val sqlContext: SQLContext) extends org.apache.spark.sql.execution.SparkStrategies {
class SparkPlanner(val sqlContext: SQLContext) extends SparkStrategies {
val sparkContext: SparkContext = sqlContext.sparkContext

def codegenEnabled: Boolean = sqlContext.conf.codegenEnabled
Expand Down Expand Up @@ -90,4 +89,4 @@ class SparkPlanner(val sqlContext: SQLContext) extends org.apache.spark.sql.exec
Project(projectList, filterCondition.map(Filter(_, scan)).getOrElse(scan))
}
}
}
}

0 comments on commit 253c15e

Please sign in to comment.