[GitHub] spark pull request #16251: [SPARK-18826][SS]Add 'newestFirst' option to File...
Github user tdas commented on a diff in the pull request: https://github.com/apache/spark/pull/16251#discussion_r92487038 --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/FileStreamOptions.scala --- @@ -53,4 +53,15 @@ class FileStreamOptions(parameters: CaseInsensitiveMap) extends Logging { /** Options as specified by the user, in a case-insensitive map, without "path" set. */ val optionMapWithoutPath: Map[String, String] = parameters.filterKeys(_ != "path") + + /** Whether to scan new files first. */ --- End diff -- Can you elaborate this comment further. In a trigger when it finds unprocessed files, it will first process the latest file. Also, isnt latest more common than newest? --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org
[GitHub] spark pull request #16251: [SPARK-18826][SS]Add 'newestFirst' option to File...
GitHub user zsxwing opened a pull request: https://github.com/apache/spark/pull/16251 [SPARK-18826][SS]Add 'newestFirst' option to FileStreamSource ## What changes were proposed in this pull request? When starting a stream with a lot of backfill and maxFilesPerTrigger, the user could often want to start with most recent files first. This would let you keep low latency for recent data and slowly backfill historical data. This PR adds a new option `newestFirst` to control this behavior. When it's true, `FileStreamSource` will sort the files by the modified time from newest to oldest, and take the first `maxFilesPerTrigger` files as a new batch. ## How was this patch tested? The added test. You can merge this pull request into a Git repository by running: $ git pull https://github.com/zsxwing/spark newest-first Alternatively you can review and apply these changes as the patch at: https://github.com/apache/spark/pull/16251.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #16251 commit 58a57d4004c45ff2290b95ec8c70ef95828d379b Author: Shixiong Zhu Date: 2016-12-12T05:15:10Z Add 'newestFirst' option to FileStreamSource --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org