cloud-fan commented on code in PR #58581:
URL: https://github.com/apache/spark/pull/58581#discussion_r3992298561


##########
python/pyspark/sql/types.py:
##########
@@ -1366,10 +1390,15 @@ def processDataType(dt: DataType, fieldPath: str) -> 
None:
         return collationMetadata
 
     def _isCollatedString(self, dt: DataType) -> bool:
-        return isinstance(dt, StringType) and not dt.isUTF8BinaryCollation()
+        if isinstance(dt, StringType):
+            return not dt.isUTF8BinaryCollation()
+        if isinstance(dt, (CharType, VarcharType)):
+            return not dt.isUTF8BinaryCollation()

Review Comment:
   Confirmed. Python now handles CharType and VarcharType explicitly before 
StringType, preserves their lengths, and the exact JSON-shape coverage 
distinguishes omitted, explicit UTF8_BINARY, and non-binary collations; Scala 
also records every explicitly present constrained-type collation. Thanks.
   
   <!-- SPARK_DEV_REVIEW_REPLY 
{"feedback_id":"inline:3960045561","thread_id":"inline:3960045561","verdict_sha256":"6589e22ffe707c3bd9369fb32374493f89e04a55522cafa345f3f56c24ee1b04"}
 -->



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