ueshin commented on code in PR #46918:
URL: https://github.com/apache/spark/pull/46918#discussion_r1631670942


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/FunctionTableSubqueryArgumentExpression.scala:
##########
@@ -165,20 +165,18 @@ case class FunctionTableSubqueryArgumentExpression(
    * when the partition has changed.
    */
   lazy val partitioningExpressionIndexes: Seq[Int] = {
-    val extraPartitionByExpressionsToIndexes: Map[Expression, Int] =
-      extraProjectedPartitioningExpressions.map(_.child).zipWithIndex.toMap
-    partitionByExpressions.map { e =>
-      subqueryOutputs.getOrElse(e, extraPartitionByExpressionsToIndexes(e) + 
plan.output.length)
+    (0 until extraProjectedPartitioningExpressions.length).map { i =>
+      if (selectedInputExpressions.nonEmpty) {
+        selectedInputExpressions.length + i

Review Comment:
   This will break
   
https://github.com/apache/spark/blob/51188ed56620c17841dac60f7f2a9330a1087d6e/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/FunctionTableSubqueryArgumentExpression.scala#L124
   if `selectedInputExpressions.length` and `plan.output.length` are different.



-- 
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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to