srielau commented on code in PR #59468:
URL: https://github.com/apache/spark/pull/59468#discussion_r4287235210


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/CharVarcharUtils.scala:
##########
@@ -208,6 +208,30 @@ object CharVarcharUtils extends Logging with 
SparkCharVarcharUtils {
     }
   }
 
+  /**
+   * CHAR/VARCHAR map keys are never padded or trimmed. A CHAR(n) key must 
already be exactly
+   * n characters; a VARCHAR(n) key must already be at most n. STRING and 
other key types fit.
+   * Avro map-key checks use this; JSON/XML keep equivalent local checks for 
now.
+   */
+  def charVarcharMapKeyExceedsLimit(key: UTF8String, keyType: DataType): 
Boolean = {

Review Comment:
   Renamed to `charVarcharMapKeyViolatesLength` in 882633ae4e9 and documented 
that CHAR(n) fails when the key is shorter or longer than n (VARCHAR remains an 
upper bound). AvroDeserializer is the only caller.



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