dongjoon-hyun commented on code in PR #44636:
URL: https://github.com/apache/spark/pull/44636#discussion_r1470694281
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/FileStreamSource.scala:
##########
@@ -113,16 +118,42 @@ class FileStreamSource(
// Visible for testing and debugging in production.
val seenFiles = new SeenFilesMap(maxFileAgeMs, fileNameOnly)
- private var allFilesForTriggerAvailableNow: Seq[(SparkPath, Long)] = _
+ private var allFilesForTriggerAvailableNow: Seq[NewFileEntry] = _
metadataLog.restore().foreach { entry =>
seenFiles.add(entry.sparkPath, entry.timestamp)
}
seenFiles.purge()
- logInfo(s"maxFilesPerBatch = $maxFilesPerBatch, maxFileAgeMs =
$maxFileAgeMs")
+ logInfo(s"maxFilesPerBatch = $maxFilesPerBatch, " +
+ s"maxBytesPerBatch = $maxBytesPerBatch, maxFileAgeMs = $maxFileAgeMs")
+
+ private var unreadFiles: Seq[NewFileEntry] = _
- private var unreadFiles: Seq[(SparkPath, Long)] = _
+ /**
+ * Split files into a selected/unselected pair according to a total size
threshold.
+ * Always puts the 1st element in a left split and keep adding it to a left
split
+ * until reaches a specified threshold or [[Long.MaxValue]].
+ */
+ private def takeFilesUntilMax(files: Seq[NewFileEntry], maxSize: Long):
+ (FilesSplit, FilesSplit) = {
Review Comment:
FYI, Apache Spark community follows the following Scala guideline.
- https://spark.apache.org/contributing.html
> For Scala code, Apache Spark follows the official [Scala style
guide](http://docs.scala-lang.org/style/) and [Databricks Scala
guide](https://github.com/databricks/scala-style-guide). The latter is
preferred. To format Scala code, run ./dev/scalafmt prior to submitting a PR.
This is the guideline for this line.
-
https://github.com/databricks/scala-style-guide?tab=readme-ov-file#spacing-and-indentation
> Return types can be either on the same line as the last parameter, or
start a new line with 2 space indent.
Please fix like this.
```scala
- private def takeFilesUntilMax(files: Seq[NewFileEntry], maxSize: Long):
- (FilesSplit, FilesSplit) = {
+ private def takeFilesUntilMax(files: Seq[NewFileEntry], maxSize: Long)
+ : (FilesSplit, FilesSplit) = {
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]