gengliangwang commented on a change in pull request #24025: [SPARK-27106][SQL]
merge CaseInsensitiveStringMap and DataSourceOptions
URL: https://github.com/apache/spark/pull/24025#discussion_r265088245
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/FileDataSourceV2.scala
##########
@@ -44,7 +44,7 @@ trait FileDataSourceV2 extends TableProvider with
DataSourceRegister {
Option(map.get("paths")).map { pathStr =>
objectMapper.readValue(pathStr, classOf[Array[String]]).toSeq
}.orElse(Option(map.get("path")).map(Seq(_))).getOrElse {
- throw new IllegalArgumentException("'path' must be given when reading
files.")
+ Nil
Review comment:
```
protected def getPaths(map: CaseInsensitiveStringMap): Seq[String] = {
Option(map.get("paths")).map { pathStr =>
val objectMapper = new ObjectMapper()
objectMapper.readValue(pathStr, classOf[Array[String]]).toSeq
}.getOrElse {
Option(map.get("path")).toSeq
}
}
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]