Skip to content
Next Next commit
Enable Java 8 time API in thrift server
  • Loading branch information
MaxGekk committed Jun 4, 2020
commit 19c6a51a7e54a18325c76d661dc581565eed9441
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import org.apache.spark.{SparkConf, SparkContext}
import org.apache.spark.internal.Logging
import org.apache.spark.sql.{SparkSession, SQLContext}
import org.apache.spark.sql.hive.{HiveExternalCatalog, HiveUtils}
import org.apache.spark.sql.internal.SQLConf
import org.apache.spark.util.Utils

/** A singleton object for the master program. The slaves should not access this. */
Expand All @@ -45,6 +46,8 @@ private[hive] object SparkSQLEnv extends Logging {

sparkConf
.setAppName(maybeAppName.getOrElse(s"SparkSQL::${Utils.localHostName()}"))
.set(SQLConf.DATETIME_JAVA8API_ENABLED, true)


val sparkSession = SparkSession.builder.config(sparkConf).enableHiveSupport().getOrCreate()
sparkContext = sparkSession.sparkContext
Expand Down