Skip to content
Snippets Groups Projects
Commit 698a7eab authored by Alex Liu's avatar Alex Liu Committed by Michael Armbrust
Browse files

[SPARK-3816][SQL] Add table properties from storage handler to output jobConf

...ob conf in SparkHadoopWriter class

Author: Alex Liu <alex_liu68@yahoo.com>

Closes #2677 from alexliu68/SPARK-SQL-3816 and squashes the following commits:

79c269b [Alex Liu] [SPARK-3816][SQL] Add table properties from storage handler to job conf
parent 418ad83f
No related branches found
No related tags found
No related merge requests found
......@@ -27,6 +27,7 @@ import org.apache.hadoop.fs.Path
import org.apache.hadoop.hive.conf.HiveConf.ConfVars
import org.apache.hadoop.hive.ql.exec.{FileSinkOperator, Utilities}
import org.apache.hadoop.hive.ql.io.{HiveFileFormatUtils, HiveOutputFormat}
import org.apache.hadoop.hive.ql.plan.{PlanUtils, TableDesc}
import org.apache.hadoop.io.Writable
import org.apache.hadoop.mapred._
......@@ -47,6 +48,13 @@ private[hive] class SparkHiveWriterContainer(
with Serializable {
private val now = new Date()
private val tableDesc: TableDesc = fileSinkConf.getTableInfo
// Add table properties from storage handler to jobConf, so any custom storage
// handler settings can be set to jobConf
if (tableDesc != null) {
PlanUtils.configureOutputJobPropertiesForStorageHandler(tableDesc)
Utilities.copyTableJobPropertiesToConf(tableDesc, jobConf)
}
protected val conf = new SerializableWritable(jobConf)
private var jobID = 0
......
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