Github user zhichao-li commented on a diff in the pull request:
https://github.com/apache/spark/pull/8476#discussion_r38838257
--- Diff:
sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/ScriptTransformation.scala
---
@@ -328,23 +361,27 @@ case class HiveScriptIOSchema (
(columns, columnTypes)
}
- private def initSerDe(
+ private def createTableProperties(
serdeClassName: String,
columns: Seq[String],
columnTypes: Seq[DataType],
- serdeProps: Seq[(String, String)]): AbstractSerDe = {
-
- val serde =
Utils.classForName(serdeClassName).newInstance.asInstanceOf[AbstractSerDe]
-
+ serdeProps: Seq[(String, String)]) = {
val columnTypesNames =
columnTypes.map(_.toTypeInfo.getTypeName()).mkString(",")
-
var propsMap = serdeProps.toMap + (serdeConstants.LIST_COLUMNS ->
columns.mkString(","))
propsMap = propsMap + (serdeConstants.LIST_COLUMN_TYPES ->
columnTypesNames)
-
+ propsMap = propsMap + (serdeConstants.FIELD_DELIM -> "\t")
--- End diff --
line delimiter is control by RecorderWriter, see TextRecordWriter as an
example:
``` scala
public void write(Writable row) throws IOException {
Text text = (Text) row;
Text escapeText = text;
if (HiveConf.getBoolVar(conf, HiveConf.ConfVars.HIVESCRIPTESCAPE)) {
escapeText = HiveUtils.escapeText(text);
}
out.write(escapeText.getBytes(), 0, escapeText.getLength());
out.write(Utilities.newLineCode);
}
```
---
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]