cloud-fan commented on code in PR #38050:
URL: https://github.com/apache/spark/pull/38050#discussion_r990171074
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/DecorrelateInnerQuery.scala:
##########
@@ -360,7 +360,20 @@ object DecorrelateInnerQuery extends PredicateHelper {
// +- Aggregate [a1] [a1 AS a']
// +- OuterQuery
val conditions = outerReferenceMap.map {
- case (o, a) => EqualNullSafe(a, OuterReference(o))
+ case (o, a) =>
+ val cond = EqualNullSafe(a, OuterReference(o))
+ // SPARK-40615: Certain data types (e.g. MapType) do not support
ordering, so
+ // the EqualNullSafe join condition can become unresolved.
+ if (!cond.resolved) {
+ if (!RowOrdering.isOrderable(a.dataType)) {
+ throw
QueryCompilationErrors.unsupportedCorrelatedReferenceDataTypeError(
+ o, a.dataType, plan.origin)
+ } else {
+ throw new IllegalStateException(s"Unable to decorrelate
subquery: " +
Review Comment:
if this should never happen, let's use `SparkException.internalError`
--
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]