Github user HeartSaVioR commented on a diff in the pull request:

    https://github.com/apache/spark/pull/21721#discussion_r206010370
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/ProgressReporter.scala
 ---
    @@ -143,18 +150,50 @@ trait ProgressReporter extends Logging {
         }
         logDebug(s"Execution stats: $executionStats")
     
    +    // extracts custom metrics from readers and writers
    +    def extractMetrics(getMetrics: () => CustomMetrics,
    +                      onInvalidMetrics: (Exception) => Unit): 
Option[JValue] = {
    +      val metrics = getMetrics()
    +      if (metrics != null) {
    --- End diff --
    
    We could de-indent via `return early`: it would be simpler cause there's 
nothing but returning `None` if metrics is null, and style guide has such case 
as one of exceptional case where return statement is preferred.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to