Github user liancheng commented on a diff in the pull request:
https://github.com/apache/spark/pull/6318#discussion_r31124708
--- Diff:
sql/hive/src/main/scala/org/apache/spark/sql/hive/hiveWriterContainers.scala ---
@@ -195,11 +197,21 @@ private[spark] class
SparkHiveDynamicPartitionWriterContainer(
jobConf.setBoolean(SUCCESSFUL_JOB_OUTPUT_DIR_MARKER, oldMarker)
}
- override def getLocalFileWriter(row: Row): FileSinkOperator.RecordWriter
= {
+ override def getLocalFileWriter(row: Row, schema: StructType):
FileSinkOperator.RecordWriter = {
+ def convertToHiveRawString(col: String, value: Any): String = {
+ val raw = String.valueOf(value)
+ schema(col).dataType match {
+ case DateType => DateUtils.toString(raw.toInt)
+ case DecimalType.Unlimited => BigDecimal(raw).toString()
+ case DecimalType.Fixed(_, _) => BigDecimal(raw).toString()
--- End diff --
Seems that these two branches can be merged into this:
```scala
case _: DecimalType => BigDecimal(raw).toString()
```
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]