-
Notifications
You must be signed in to change notification settings - Fork 28k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-40615][SQL] Check unsupported data types when decorrelating subqueries #38050
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -879,6 +879,11 @@ | |
"Expressions referencing the outer query are not supported outside of WHERE/HAVING clauses<treeNode>" | ||
] | ||
}, | ||
"UNSUPPORTED_CORRELATED_REFERENCE_DATA_TYPE" : { | ||
"message" : [ | ||
"Correlated column reference '<expr>' cannot be <dataType> type" | ||
] | ||
}, | ||
"UNSUPPORTED_CORRELATED_SCALAR_SUBQUERY" : { | ||
"message" : [ | ||
"Correlated scalar subqueries can only be used in filters, aggregations, projections, and UPDATE/MERGE/DELETE commands<treeNode>" | ||
|
@@ -888,11 +893,6 @@ | |
"message" : [ | ||
"IN/EXISTS predicate subqueries can only be used in filters, joins, aggregations, window functions, projections, and UPDATE/MERGE/DELETE commands<treeNode>" | ||
] | ||
}, | ||
"UNSUPPORTED_CORRELATED_REFERENCE_DATA_TYPE" : { | ||
"message" : [ | ||
"Correlated column reference '<expr>' cannot be <dataType> type" | ||
] | ||
} | ||
} | ||
}, | ||
|
@@ -3138,4 +3138,4 @@ | |
"<className> must override either <m1> or <m2>" | ||
] | ||
} | ||
} | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: revert this. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ package org.apache.spark.sql.catalyst.optimizer | |
|
||
import scala.collection.mutable.ArrayBuffer | ||
|
||
import org.apache.spark.SparkException | ||
import org.apache.spark.sql.catalyst.expressions._ | ||
import org.apache.spark.sql.catalyst.expressions.SubExprUtils._ | ||
import org.apache.spark.sql.catalyst.plans._ | ||
|
@@ -369,7 +370,7 @@ object DecorrelateInnerQuery extends PredicateHelper { | |
throw QueryCompilationErrors.unsupportedCorrelatedReferenceDataTypeError( | ||
o, a.dataType, plan.origin) | ||
} else { | ||
throw new IllegalStateException(s"Unable to decorrelate subquery: " + | ||
throw SparkException.internalError(s"Unable to decorrelate subquery: " + | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why this change? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh I saw Wenchen's comment above. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See #38050 (comment) |
||
s"join condition '${cond.sql}' cannot be resolved.") | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 this is better!