Skip to content

Commit 6a622b0

Browse files
committed
[SPARK-6628][SQL][Branch-2.1] Fix ClassCastException when executing sql statement 'insert into' on hbase table
1 parent 6e6adcc commit 6a622b0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

sql/hive/src/main/scala/org/apache/spark/sql/hive/hiveWriterContainers.scala

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,11 @@ private[hive] class SparkHiveWriterContainer(
7878
@transient protected lazy val committer = conf.value.getOutputCommitter
7979
@transient protected lazy val jobContext = new JobContextImpl(conf.value, jID.value)
8080
@transient private lazy val taskContext = new TaskAttemptContextImpl(conf.value, taID.value)
81-
@transient private lazy val outputFormat =
82-
conf.value.getOutputFormat.asInstanceOf[HiveOutputFormat[AnyRef, Writable]]
81+
@transient private lazy val outputFormat = conf.value.getOutputFormat match {
82+
case format: HiveOutputFormat[AnyRef, Writable]
83+
=> format.asInstanceOf[HiveOutputFormat[AnyRef, Writable]]
84+
case _ => null
85+
}
8386

8487
def driverSideSetup() {
8588
setIDs(0, 0, 0)

0 commit comments

Comments
 (0)