maropu commented on a change in pull request #28425:
URL: https://github.com/apache/spark/pull/28425#discussion_r418414748



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/DataSourceV2ScanExecBase.scala
##########
@@ -46,6 +47,35 @@ trait DataSourceV2ScanExecBase extends LeafExecNode {
     Utils.redact(sqlContext.sessionState.conf.stringRedactionPattern, result)
   }
 
+  /**
+   * Shorthand for calling redactString() without specifying redacting rules
+   */
+  protected def redact(text: String): String = {
+    Utils.redact(sqlContext.sessionState.conf.stringRedactionPattern, text)
+  }
+
+
+  override def verboseStringWithOperatorId(): String = {
+    val metaDataStr = if (scan.isInstanceOf[SupportsMetadata]) {
+      val scanWithExplainSupport: SupportsMetadata = 
scan.asInstanceOf[SupportsMetadata]
+      val metadataStr = 
scanWithExplainSupport.getMetaData.toSeq.sorted.filterNot {
+        case (_, value) if (value.isEmpty || value.equals("[]")) => true
+        case (_, _) => false
+      }.map {
+        case (key, value) => s"$key: ${redact(value)}"
+      }

Review comment:
       nit: format
   ```
       val metaDataStr = scan match {
         case s: SupportsMetadata =>
           s.getMetaData().toSeq.sorted.flatMap {
             case (key, value) if value.isEmpty || value.equals("[]") =>
               Some(s"$key: ${redact(value)}")
             case _ =>
               None
           }
         case _ =>
           Seq(scan.description())
       }
   ```




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



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

Reply via email to