shivadarshan-devadiga commented on code in PR #60756:
URL: https://github.com/apache/spark/pull/60756#discussion_r4653380619
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ApplyCharTypePaddingHelper.scala:
##########
@@ -158,33 +180,93 @@ object ApplyCharTypePaddingHelper {
i.copy(value = newChildren.head, list = newChildren.tail)
}
+ // Like the cases above, for a scalar subquery of a CHAR column compared
with a string
+ // literal, a column, or another scalar subquery.
+ // Unlike the cases above, these don't truncate values longer than their
CHAR length.
+ case b @ BinaryComparison(e @ CharScalarSubquery(metadata), lit) if
lit.foldable =>
Review Comment:
Fixed. The scalar-subquery cases now require the constant to evaluate
(`canEvaluate`, as `ConstantFolding.tryFold` does), and leave the comparison as
it is otherwise. The IN-list case and the IN-subquery constants use the same
check. Your query is in the set-operations test and returns true under ANSI.
--
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]