huaxingao commented on a change in pull request #29535:
URL: https://github.com/apache/spark/pull/29535#discussion_r479422041



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/trees/TreeNode.scala
##########
@@ -544,6 +545,8 @@ abstract class TreeNode[BaseType <: TreeNode[BaseType]] 
extends Product {
     case None => Nil
     case Some(null) => Nil
     case Some(any) => any :: Nil
+    case map: CaseInsensitiveStringMap =>
+      truncatedString(map.entrySet().toArray(), "[", ", ", "]", maxFields) :: 
Nil

Review comment:
       I tried this:
   ```
   scala> val options = Map(
        | "Key1" -> "Value1",
        | "key2" -> "vaue2"
        | )
   options: scala.collection.immutable.Map[String,String] = Map(Key1 -> Value1, 
key2 -> vaue2)
   
   scala> val map = new CaseInsensitiveStringMap(options.asJava)
   map: org.apache.spark.sql.util.CaseInsensitiveStringMap = 
org.apache.spark.sql.util.CaseInsensitiveStringMap@9f174175
   
   scala> map.asCaseSensitiveMap().entrySet().toArray()
   res3: Array[Object] = Array(Key1=Value1, key2=vaue2)
   ```
   I used `case map: CaseInsensitiveStringMap` for pattern matching, I guess we 
are probably OK?




----------------------------------------------------------------
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