You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "ueshin (via GitHub)" <gi...@apache.org> on 2025/01/10 22:35:30 UTC

[PR] [SPARK-50789][CONNECT] The inputs for typed aggregations should be analyzed [spark]

ueshin opened a new pull request, #49449:
URL: https://github.com/apache/spark/pull/49449

   ### What changes were proposed in this pull request?
   
   Fixes `SparkConnectPlanner` to analyze the inputs for typed aggregations.
   
   ### Why are the changes needed?
   
   The inputs for typed aggregations should be analyzed.
   
   For example:
   
   ```scala
   val ds = Seq("abc", "xyz", "hello").toDS().select("*").as[String]
   ds.groupByKey(_.length).reduceGroups(_ + _).show()
   ```
   
   fails with:
   
   ```
   org.apache.spark.SparkException: [INTERNAL_ERROR] Invalid call to toAttribute on unresolved object SQLSTATE: XX000
     org.apache.spark.sql.catalyst.analysis.Star.toAttribute(unresolved.scala:439)
     org.apache.spark.sql.catalyst.plans.logical.Project.$anonfun$output$1(basicLogicalOperators.scala:74)
     scala.collection.immutable.List.map(List.scala:247)
     scala.collection.immutable.List.map(List.scala:79)
     org.apache.spark.sql.catalyst.plans.logical.Project.output(basicLogicalOperators.scala:74)
     org.apache.spark.sql.connect.planner.SparkConnectPlanner.transformExpressionWithTypedReduceExpression(SparkConnectPlanner.scala:2340)
     org.apache.spark.sql.connect.planner.SparkConnectPlanner.$anonfun$transformKeyValueGroupedAggregate$1(SparkConnectPlanner.scala:2244)
     scala.collection.immutable.List.map(List.scala:247)
     scala.collection.immutable.List.map(List.scala:79)
     org.apache.spark.sql.connect.planner.SparkConnectPlanner.transformKeyValueGroupedAggregate(SparkConnectPlanner.scala:2244)
     org.apache.spark.sql.connect.planner.SparkConnectPlanner.transformAggregate(SparkConnectPlanner.scala:2232)
   ...
   ```
   
   ### Does this PR introduce _any_ user-facing change?
   
   The failure will not appear.
   
   ### How was this patch tested?
   
   Added the related tests.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   No.
   


-- 
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-unsubscribe@spark.apache.org

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


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


Re: [PR] [SPARK-50789][CONNECT] The inputs for typed aggregations should be analyzed [spark]

Posted by "ueshin (via GitHub)" <gi...@apache.org>.
ueshin commented on PR #49449:
URL: https://github.com/apache/spark/pull/49449#issuecomment-2587991164

   The remaining test failures are not related to this PR.


-- 
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-unsubscribe@spark.apache.org

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


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


Re: [PR] [SPARK-50789][CONNECT] The inputs for typed aggregations should be analyzed [spark]

Posted by "ueshin (via GitHub)" <gi...@apache.org>.
ueshin commented on PR #49449:
URL: https://github.com/apache/spark/pull/49449#issuecomment-2587991513

   Thanks! merging to master.


-- 
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-unsubscribe@spark.apache.org

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


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


Re: [PR] [SPARK-50789][CONNECT] The inputs for typed aggregations should be analyzed [spark]

Posted by "ueshin (via GitHub)" <gi...@apache.org>.
ueshin closed pull request #49449: [SPARK-50789][CONNECT] The inputs for typed aggregations should be analyzed
URL: https://github.com/apache/spark/pull/49449


-- 
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-unsubscribe@spark.apache.org

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


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