Skip to content
Snippets Groups Projects
Commit 4db63fd2 authored by Dongjoon Hyun's avatar Dongjoon Hyun Committed by Reynold Xin
Browse files

[SPARK-16383][SQL] Remove `SessionState.executeSql`

## What changes were proposed in this pull request?

This PR removes `SessionState.executeSql` in favor of `SparkSession.sql`. We can remove this safely since the visibility `SessionState` is `private[sql]` and `executeSql` is only used in one **ignored** test, `test("Multiple Hive Instances")`.

## How was this patch tested?

Pass the Jenkins tests.

Author: Dongjoon Hyun <dongjoon@apache.org>

Closes #14055 from dongjoon-hyun/SPARK-16383.
parent 1f0d0213
No related branches found
No related tags found
No related merge requests found
......@@ -24,7 +24,7 @@ import org.apache.hadoop.fs.Path
import org.apache.spark.sql._
import org.apache.spark.sql.catalyst.analysis.{Analyzer, FunctionRegistry}
import org.apache.spark.sql.catalyst.catalog.{ArchiveResource, _}
import org.apache.spark.sql.catalyst.catalog._
import org.apache.spark.sql.catalyst.optimizer.Optimizer
import org.apache.spark.sql.catalyst.parser.ParserInterface
import org.apache.spark.sql.catalyst.plans.logical.LogicalPlan
......@@ -162,8 +162,6 @@ private[sql] class SessionState(sparkSession: SparkSession) {
// Helper methods, partially leftover from pre-2.0 days
// ------------------------------------------------------
def executeSql(sql: String): QueryExecution = executePlan(sqlParser.parsePlan(sql))
def executePlan(plan: LogicalPlan): QueryExecution = new QueryExecution(sparkSession, plan)
def refreshTable(tableName: String): Unit = {
......
......@@ -30,9 +30,9 @@ class ConcurrentHiveSuite extends SparkFunSuite with BeforeAndAfterAll {
conf.set("spark.ui.enabled", "false")
val ts =
new TestHiveContext(new SparkContext("local", s"TestSQLContext$i", conf))
ts.sessionState.executeSql("SHOW TABLES").toRdd.collect()
ts.sessionState.executeSql("SELECT * FROM src").toRdd.collect()
ts.sessionState.executeSql("SHOW TABLES").toRdd.collect()
ts.sparkSession.sql("SHOW TABLES").collect()
ts.sparkSession.sql("SELECT * FROM src").collect()
ts.sparkSession.sql("SHOW TABLES").collect()
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment