cloud-fan commented on a change in pull request #29585:
URL: https://github.com/apache/spark/pull/29585#discussion_r490205448
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/subquery.scala
##########
@@ -510,16 +514,16 @@ object RewriteCorrelatedScalarSubquery extends
Rule[LogicalPlan] {
*/
private def constructLeftJoins(
child: LogicalPlan,
- subqueries: ArrayBuffer[ScalarSubquery]): LogicalPlan = {
+ subqueries: ArrayBuffer[(ScalarSubquery, ExprId)]): LogicalPlan = {
subqueries.foldLeft(child) {
- case (currentChild, ScalarSubquery(query, conditions, _)) =>
+ case (currentChild, (ScalarSubquery(query, conditions, _), newExprId)) =>
val origOutput = query.output.head
val resultWithZeroTups = evalSubqueryOnZeroTups(query)
if (resultWithZeroTups.isEmpty) {
// CASE 1: Subquery guaranteed not to have the COUNT bug
Project(
- currentChild.output :+ origOutput,
+ currentChild.output :+ Alias(origOutput, origOutput.name)(exprId =
newExprId),
Review comment:
why do we need a new expr id here?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]