Meet unit test coverage standards for Spark custom datasource lib
Fix the potential hive NPE issue for hive delimiter
@@ -527,10 +527,14 @@ class DefaultSource(apiClientFactory: (String, Option[String], Option[String]) =
"inferSchema" -> "false",
"header" -> "false",
"delimiter" -> {
+ if (schema.getDelimiter != null) {
schema.getDelimiter.contains("\\") match {
case true => schema.getDelimiter.replace("\\", "").toInt.toChar.toString
case false => schema.getDelimiter
}
+ } else {
+ null
+ }
},
"collectionItemsDelimiter" -> {
if (schema.getCollectionItemsDelimiter != null) {
