Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Obtain SQLConf from sparksession
  • Loading branch information
DonnyZone committed Aug 17, 2017
commit a264e3aa166d2e83832a82489669893f41ff9749
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ import org.apache.spark.sql.SparkSession
import org.apache.spark.sql.catalyst.InternalRow
import org.apache.spark.sql.catalyst.expressions._
import org.apache.spark.sql.catalyst.util.DateTimeUtils
import org.apache.spark.sql.internal.SQLConf
import org.apache.spark.unsafe.types.UTF8String
import org.apache.spark.util.{SerializableConfiguration, Utils}

Expand Down Expand Up @@ -229,7 +228,7 @@ class HadoopTableReader(
partitionKeyAttrs.foreach { case (attr, ordinal) =>
val partOrdinal = partitionKeys.indexOf(attr)
row(ordinal) = Cast(Literal(rawPartValues(partOrdinal)), attr.dataType,
Option(SQLConf.get.sessionLocalTimeZone)).eval(null)
Option(sparkSession.sessionState.conf.sessionLocalTimeZone)).eval(null)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import org.apache.spark.sql.execution._
import org.apache.spark.sql.execution.metric.SQLMetrics
import org.apache.spark.sql.hive._
import org.apache.spark.sql.hive.client.HiveClientImpl
import org.apache.spark.sql.internal.SQLConf
import org.apache.spark.sql.types.{BooleanType, DataType}
import org.apache.spark.util.Utils

Expand Down Expand Up @@ -105,7 +104,8 @@ case class HiveTableScanExec(
hadoopConf)

private def castFromString(value: String, dataType: DataType) = {
Cast(Literal(value), dataType, Option(SQLConf.get.sessionLocalTimeZone)).eval(null)
Cast(Literal(value), dataType,
Option(sparkSession.sessionState.conf.sessionLocalTimeZone)).eval(null)
}

private def addColumnMetadataToConf(hiveConf: Configuration): Unit = {
Expand Down