shivadarshan-devadiga commented on code in PR #60750:
URL: https://github.com/apache/spark/pull/60750#discussion_r4642173331


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ApplyCharTypePaddingHelper.scala:
##########
@@ -84,46 +101,37 @@ object ApplyCharTypePaddingHelper {
     expression match {
       // String literal is treated as char type when it's compared to a char 
type column.
       // We should pad the shorter one to the longer length.
-      case b @ BinaryComparison(e @ AttrOrOuterRef(attr), lit) if lit.foldable 
=>
-        padAttrLitCmp(e, attr.metadata, padCharCol, lit)
+      case b @ BinaryComparison(e @ RawTypedRef(c: CharType), lit) if 
lit.foldable =>

Review Comment:
   Fixed. Both binary-comparison cases now require a string-typed constant 
(`isStringConstant`), so `s.c = array(1)` reaches `CheckAnalysis` and fails 
with `DATATYPE_MISMATCH.BINARY_OP_DIFF_TYPES`, which the same test checks.



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