LuciferYang commented on code in PR #37943:
URL: https://github.com/apache/spark/pull/37943#discussion_r975244093


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/command/tables.scala:
##########
@@ -1044,7 +1044,7 @@ trait ShowCreateTableCommandBase extends SQLConfHelper {
     metadata
       .comment
       .map("COMMENT '" + escapeSingleQuotedString(_) + "'\n")
-      .foreach(builder.append)
+      .foreach(s => builder.append(s))

Review Comment:
   ```scala
   case class TestObj(testValue: Option[String] = None)
   def appendToBuilder(obj: TestObj, builder: StringBuilder): Unit = {
     obj.testValue.foreach(builder.append)
   }
   ```
   
   In Scala 2.13.8:
   
   ```
   Welcome to Scala 2.13.8 (OpenJDK 64-Bit Server VM, Java 1.8.0_322).
   Type in expressions for evaluation. Or try :help.
   
   scala> :paste
   // Entering paste mode (ctrl-D to finish)
   
   case class TestObj(testValue: Option[String] = None)
   def appendToBuilder(obj: TestObj, builder: StringBuilder): Unit = {
     obj.testValue.foreach(builder.append)
   }
   
   
   // Exiting paste mode, now interpreting.
   
   class TestObj
   def appendToBuilder(obj: TestObj, builder: StringBuilder): Unit
   
   scala>
   ```
   
   In Scala 2.13.9
   
   ```
   Welcome to Scala 2.13.9 (OpenJDK 64-Bit Server VM, Java 1.8.0_322).
   Type in expressions for evaluation. Or try :help.
   
   scala> :paste
   // Entering paste mode (ctrl-D to finish)
   
   case class TestObj(testValue: Option[String] = None)
   def appendToBuilder(obj: TestObj, builder: StringBuilder): Unit = {
     obj.testValue.foreach(builder.append)
   }
   
   
   // Exiting paste mode, now interpreting.
   
   
     obj.testValue.foreach(builder.append)
                                   ^
   <pastie>:3: error: type mismatch;
    found   : (x: Char): builder.type <and> (x: Double): builder.type <and> (x: 
Float): builder.type <and> (x: Long): builder.type <and> (x: Int): builder.type 
<and> (x: Short): builder.type <and> (x: Byte): builder.type <and> (x: 
Boolean): builder.type <and> (s: StringBuilder): builder.type <and> (cs: 
CharSequence): builder.type <and> (s: String): builder.type <and> (x: Any): 
builder.type (with underlying type (x: Char): builder.type <and> (x: Double): 
builder.type <and> (x: Float): builder.type <and> (x: Long): builder.type <and> 
(x: Int): builder.type <and> (x: Short): builder.type <and> (x: Byte): 
builder.type <and> (x: Boolean): builder.type <and> (s: StringBuilder): 
builder.type <and> (cs: CharSequence): builder.type <and> (s: String): 
builder.type <and> (x: Any): builder.type)
    required: String => ?
   ```
   
   It seems that this is not an understandable change. I think we should  skip 
the upgrade of Scala 2.13.9
   
   WDYT? @dongjoon-hyun @srowen @HyukjinKwon 



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

To unsubscribe, e-mail: [email protected]

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