spark-rapids
spark-rapids copied to clipboard
[AUDIT] [SPARK-48466][SQL] Create dedicated node for EmptyRelation in AQE
Is your feature request related to a problem? Please describe. Filing this to investigate further. Spark added new node EmptyRelationExec.
pr: https://github.com/apache/spark/pull/46830 issue: https://issues.apache.org/jira/browse/SPARK-48466
We should check as it wraps the logical plan, do we need to do anything with this for tests, for tooling, or AQE type things.
Scope: implement GPU version of EmptyRelationExec.
I was able to get the code to fallback, but I don't think that it matters at all.
val df1 = spark.read.parquet("/data/tpcds/SF200_parquet_decimal/store_sales/").select("ss_sold_date_sk", "ss_sold_time_sk").filter("ss_sold_date_sk = 0")
val df2 = spark.read.parquet("/data/tpcds/SF200_parquet_decimal/store_sales/").selectExpr("ss_sold_date_sk", "ss_item_sk")
df1.join(df2, df1("ss_sold_date_sk") === df2("ss_sold_date_sk")).show()
25/07/29 17:58:35 WARN GpuOverrides:
!Exec <CollectLimitExec> cannot run on GPU because the Exec CollectLimitExec has been disabled, and is disabled by default because Collect Limit replacement can be slower on the GPU, if huge number of rows in a batch it could help by limiting the number of rows transferred from GPU to CPU. Set spark.rapids.sql.exec.CollectLimitExec to true if you wish to enable it
@Partitioning <SinglePartition$> could run on GPU
25/07/29 17:58:35 WARN GpuOverrides:
!Exec <CollectLimitExec> cannot run on GPU because the Exec CollectLimitExec has been disabled, and is disabled by default because Collect Limit replacement can be slower on the GPU, if huge number of rows in a batch it could help by limiting the number of rows transferred from GPU to CPU. Set spark.rapids.sql.exec.CollectLimitExec to true if you wish to enable it
@Partitioning <SinglePartition$> could run on GPU
25/07/29 17:58:35 WARN GpuOverrides:
!Exec <CollectLimitExec> cannot run on GPU because the Exec CollectLimitExec has been disabled, and is disabled by default because Collect Limit replacement can be slower on the GPU, if huge number of rows in a batch it could help by limiting the number of rows transferred from GPU to CPU. Set spark.rapids.sql.exec.CollectLimitExec to true if you wish to enable it
@Partitioning <SinglePartition$> could run on GPU
25/07/29 17:58:36 WARN GpuOverrides:
! <EmptyRelationExec> cannot run on GPU because GPU does not currently support the operator class org.apache.spark.sql.execution.EmptyRelationExec
25/07/29 17:58:36 WARN GpuOverrides:
! <EmptyRelationExec> cannot run on GPU because GPU does not currently support the operator class org.apache.spark.sql.execution.EmptyRelationExec
+---------------+---------------+---------------+----------+
|ss_sold_date_sk|ss_sold_time_sk|ss_sold_date_sk|ss_item_sk|
+---------------+---------------+---------------+----------+
+---------------+---------------+---------------+----------+
We do fall back for the EmptyRelationExec, but it is all of the plan at that point. It includes the original logical plan simply so that the UI has something to show what did and didn't run. So if we did implement a GPU version, then we would output no rows from it and force a GpuColumnarToRowsExec to execute just to yet again have no result. I personally think it is better to keep it as is. If someone runs into a problem with this we can add it to the allow list for checks https://github.com/NVIDIA/spark-rapids/blob/b55a42ae6f36819afd7c7f73af2a9937c3750ad7/sql-plugin/src/main/scala/com/nvidia/spark/rapids/GpuTransitionOverrides.scala#L627-L683 but it would require us to add a shim, so for now I am opting to not make that change.