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



##########
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:
       @maropu Thanks. Looks much better :-)




----------------------------------------------------------------
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:
[email protected]



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

Reply via email to