HyukjinKwon commented on code in PR #59305:
URL: https://github.com/apache/spark/pull/59305#discussion_r4281737658


##########
sql/api/src/main/scala/org/apache/spark/sql/types/StructField.scala:
##########
@@ -77,7 +77,8 @@ case class StructField(
   }
 
   private[sql] def dataTypeJsonValue: JValue = {
-    if (stringCollationMetadata.isEmpty && 
charVarcharCollationMetadata.isEmpty) {
+    if (stringCollationMetadata.isEmpty && 
charVarcharCollationMetadata.isEmpty &&
+      !dataType.existsRecursively(_.isInstanceOf[FileType])) {

Review Comment:
   Thanks, verified. `StructField.scala` is back to the master version. 
`FileType` now writes its mode in its own JSON form, so a FILE-bearing field 
without collation metadata takes the same fast path as any other field. The new 
`DataTypeSuite` test checks that `MAP<STRING COLLATE UTF8_BINARY, FILE 
EXTERNAL>` keeps `"string collate UTF8_BINARY"` for its key next to a `"file 
external"` value.
   
   <!-- SPARK_DEV_REVIEW_REPLY 
{"feedback_id":"inline:4266608466","thread_id":"inline:4266608466","verdict_sha256":"dd0f0b043aa0bd9e45ac7e480360c185049eb5efe3b5404706b4cfc8adf6852f"}
 -->



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