Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-27106][SQL] merge CaseInsensitiveStringMap and DataSourceOptions #24025

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  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
    }
  }

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class RateStreamMicroBatchStream(

override def toString: String = s"RateStreamV2[rowsPerSecond=$rowsPerSecond, " +
s"rampUpTimeSeconds=$rampUpTimeSeconds, " +
s"numPartitions=${Option(options.get(NUM_PARTITIONS)).getOrElse("default")}"
s"numPartitions=${options.getOrDefault(NUM_PARTITIONS, "default")}"
}

case class RateStreamMicroBatchInputPartition(
Expand Down