beliefer opened a new pull request #32513: URL: https://github.com/apache/spark/pull/32513
### What changes were proposed in this pull request? Currently, Spark doesn't support `LeafRunnableCommand` as sub query. Because the `LeafRunnableCommand` always output `GenericInternalRow` and some node(e.g. `SortExec`, `AdaptiveExecutionExec`, `WholeCodegenExec`) will convert `GenericInternalRow` to `UnsafeRow`. So will causes error as follows: ``` java.lang.ClassCastException org.apache.spark.sql.catalyst.expressions.GenericInternalRow cannot be cast to org.apache.spark.sql.catalyst.expressions.UnsafeRow ``` ### Why are the changes needed? Complete query some DDL with CTES. ### Does this PR introduce _any_ user-facing change? 'Yes'. After this PR, we can support more syntax when query with CTE. ### How was this patch tested? New tests. -- 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: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org