You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/03/02 07:15:17 UTC

[GitHub] [spark] LuciferYang commented on a change in pull request #31698: [SPARK-34587][CORE][SQL][DSTREAM][SS] Replaces map and getOrElse(false/true) with exists/forall

LuciferYang commented on a change in pull request #31698:
URL: https://github.com/apache/spark/pull/31698#discussion_r585312138



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/MicroBatchExecution.scala
##########
@@ -357,10 +357,8 @@ class MicroBatchExecution(
   private def isNewDataAvailable: Boolean = {
     availableOffsets.exists {
       case (source, available) =>
-        committedOffsets
-          .get(source)
-          .map(committed => committed != available)
-          .getOrElse(true)

Review comment:
       ```
   committedOffsets
             .get(source)
             .forall(committed => committed != available)
   ```
   
   can be further simplified as
   
   ```
   !committedOffsets
             .get(source).contains(available)
   ```




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org