You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gluten.apache.org by "surnaik (via GitHub)" <gi...@apache.org> on 2025/06/02 08:08:48 UTC
[PR] [VL] Fix DPP not working for Arrow Scan [incubator-gluten]
surnaik opened a new pull request, #9829:
URL: https://github.com/apache/incubator-gluten/pull/9829
## What changes were proposed in this pull request?
Scan that gets pushed to Spark that return Arrow compatible vectors fails when DPP is present since the filteredPartitions subquery is never scheduled by Spark
## How was this patch tested?
Manual Test with a Datasource that return Arrow Vector
--
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: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [VL] Fix DPP not working for Arrow Scan [incubator-gluten]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #9829:
URL: https://github.com/apache/incubator-gluten/pull/9829#issuecomment-2945166934
Run Gluten Clickhouse CI on x86
--
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: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [VL] Fix DPP not working for Arrow Scan [incubator-gluten]
Posted by "jinchengchenghh (via GitHub)" <gi...@apache.org>.
jinchengchenghh merged PR #9829:
URL: https://github.com/apache/incubator-gluten/pull/9829
--
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: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [VL] Fix DPP not working for Arrow Scan [incubator-gluten]
Posted by "jinchengchenghh (via GitHub)" <gi...@apache.org>.
jinchengchenghh commented on PR #9829:
URL: https://github.com/apache/incubator-gluten/pull/9829#issuecomment-2954450545
Thanks for your fix.
--
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: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [VL] Fix DPP not working for Arrow Scan [incubator-gluten]
Posted by "zhztheplayer (via GitHub)" <gi...@apache.org>.
zhztheplayer commented on code in PR #9829:
URL: https://github.com/apache/incubator-gluten/pull/9829#discussion_r2126832985
##########
shims/spark35/src/main/scala/org/apache/spark/sql/execution/datasources/v2/BatchScanExecShim.scala:
##########
@@ -146,10 +146,35 @@ abstract class BatchScanExecShim(
}
}
-abstract class ArrowBatchScanExecShim(original: BatchScanExec) extends DataSourceV2ScanExecBase {
- @transient override lazy val inputPartitions: Seq[InputPartition] = original.inputPartitions
-
- override def keyGroupedPartitioning: Option[Seq[Expression]] = original.keyGroupedPartitioning
+abstract class ArrowBatchScanExecShim(original: BatchScanExec)
+ extends BatchScanExecShim(
+ original.output,
+ original.scan,
+ original.runtimeFilters,
+ original.spjParams.keyGroupedPartitioning,
+ original.ordering,
+ original.table,
+ original.spjParams.commonPartitionValues,
+ original.spjParams.applyPartialClustering,
+ original.spjParams.replicatePartitions
+ ) {
+ override def scan: Scan = original.scan
override def ordering: Option[Seq[SortOrder]] = original.ordering
+
+ override def output: Seq[Attribute] = original.output
+
+ override lazy val metrics = {
+ Map("numOutputRows" -> SQLMetrics.createMetric(sparkContext, "number of output rows")) ++
+ customMetrics
+ }
+
+ override def doExecuteColumnar(): RDD[ColumnarBatch] = {
+ val numOutputRows = longMetric("numOutputRows")
+ inputRDD.asInstanceOf[RDD[ColumnarBatch]].map {
+ b =>
+ numOutputRows += b.numRows()
+ b
+ }
+ }
Review Comment:
Any difference of this code among the Spark versions? Or else we can move it to `ArrowBatchScanExec.scala`?
--
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: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [VL] Fix DPP not working for Arrow Scan [incubator-gluten]
Posted by "surnaik (via GitHub)" <gi...@apache.org>.
surnaik commented on PR #9829:
URL: https://github.com/apache/incubator-gluten/pull/9829#issuecomment-2933353826
@jinchengchenghh Could you please take a look!
--
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: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [VL] Fix DPP not working for Arrow Scan [incubator-gluten]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #9829:
URL: https://github.com/apache/incubator-gluten/pull/9829#issuecomment-2929992087
Run Gluten Clickhouse CI on x86
--
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: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [VL] Fix DPP not working for Arrow Scan [incubator-gluten]
Posted by "jackylee-ch (via GitHub)" <gi...@apache.org>.
jackylee-ch commented on PR #9829:
URL: https://github.com/apache/incubator-gluten/pull/9829#issuecomment-2933043421
For V2 Source Scan, you can try [this PR](https://github.com/apache/spark/pull/37514) to support DPP.
--
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: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [VL] Fix DPP not working for Arrow Scan [incubator-gluten]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #9829:
URL: https://github.com/apache/incubator-gluten/pull/9829#issuecomment-2929339923
Run Gluten Clickhouse CI on x86
--
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: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [VL] Fix DPP not working for Arrow Scan [incubator-gluten]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #9829:
URL: https://github.com/apache/incubator-gluten/pull/9829#issuecomment-2943874206
Run Gluten Clickhouse CI on x86
--
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: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [VL] Fix DPP not working for Arrow Scan [incubator-gluten]
Posted by "surnaik (via GitHub)" <gi...@apache.org>.
surnaik commented on PR #9829:
URL: https://github.com/apache/incubator-gluten/pull/9829#issuecomment-2947892681
@zhztheplayer could you please take a look, test failure seems unrelated, passing locally
--
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: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [VL] Fix DPP not working for Arrow Scan [incubator-gluten]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #9829:
URL: https://github.com/apache/incubator-gluten/pull/9829#issuecomment-2943877151
Run Gluten Clickhouse CI on x86
--
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: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [VL] Fix DPP not working for Arrow Scan [incubator-gluten]
Posted by "surnaik (via GitHub)" <gi...@apache.org>.
surnaik commented on PR #9829:
URL: https://github.com/apache/incubator-gluten/pull/9829#issuecomment-2954479770
> Please also update the PR description including [#9829 (comment)](https://github.com/apache/incubator-gluten/pull/9829#issuecomment-2933287774)
Done. Thanks for your review!
--
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: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [VL] Fix DPP not working for Arrow Scan [incubator-gluten]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #9829:
URL: https://github.com/apache/incubator-gluten/pull/9829#issuecomment-2931434618
Run Gluten Clickhouse CI on x86
--
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: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [VL] Fix DPP not working for Arrow Scan [incubator-gluten]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #9829:
URL: https://github.com/apache/incubator-gluten/pull/9829#issuecomment-2929339080
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICEGJ-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
Thanks for opening a pull request!
Could you open an issue for this pull request on Github Issues?
https://github.com/apache/incubator-gluten/issues
Then could you also rename ***commit message*** and ***pull request title*** in the following format?
[GLUTEN-${ISSUES_ID}][COMPONENT]feat/fix: ${detailed message}
See also:
* [Other pull requests](https://github.com/apache/incubator-gluten/pulls/)
--
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: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [VL] Fix DPP not working for Arrow Scan [incubator-gluten]
Posted by "surnaik (via GitHub)" <gi...@apache.org>.
surnaik commented on PR #9829:
URL: https://github.com/apache/incubator-gluten/pull/9829#issuecomment-2929346785
@FelixYBW @PHILO-HE please review. Thanks!
--
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: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [VL] Fix DPP not working for Arrow Scan [incubator-gluten]
Posted by "surnaik (via GitHub)" <gi...@apache.org>.
surnaik commented on code in PR #9829:
URL: https://github.com/apache/incubator-gluten/pull/9829#discussion_r2126865468
##########
shims/spark35/src/main/scala/org/apache/spark/sql/execution/datasources/v2/BatchScanExecShim.scala:
##########
@@ -146,10 +146,35 @@ abstract class BatchScanExecShim(
}
}
-abstract class ArrowBatchScanExecShim(original: BatchScanExec) extends DataSourceV2ScanExecBase {
- @transient override lazy val inputPartitions: Seq[InputPartition] = original.inputPartitions
-
- override def keyGroupedPartitioning: Option[Seq[Expression]] = original.keyGroupedPartitioning
+abstract class ArrowBatchScanExecShim(original: BatchScanExec)
+ extends BatchScanExecShim(
+ original.output,
+ original.scan,
+ original.runtimeFilters,
+ original.spjParams.keyGroupedPartitioning,
+ original.ordering,
+ original.table,
+ original.spjParams.commonPartitionValues,
+ original.spjParams.applyPartialClustering,
+ original.spjParams.replicatePartitions
+ ) {
+ override def scan: Scan = original.scan
override def ordering: Option[Seq[SortOrder]] = original.ordering
+
+ override def output: Seq[Attribute] = original.output
+
+ override lazy val metrics = {
+ Map("numOutputRows" -> SQLMetrics.createMetric(sparkContext, "number of output rows")) ++
+ customMetrics
+ }
+
+ override def doExecuteColumnar(): RDD[ColumnarBatch] = {
+ val numOutputRows = longMetric("numOutputRows")
+ inputRDD.asInstanceOf[RDD[ColumnarBatch]].map {
+ b =>
+ numOutputRows += b.numRows()
+ b
+ }
+ }
Review Comment:
This is same, I’ll move it to a new file. Thanks!
--
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: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [VL] Fix DPP not working for Arrow Scan [incubator-gluten]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #9829:
URL: https://github.com/apache/incubator-gluten/pull/9829#issuecomment-2930560197
Run Gluten Clickhouse CI on x86
--
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: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [VL] Fix DPP not working for Arrow Scan [incubator-gluten]
Posted by "surnaik (via GitHub)" <gi...@apache.org>.
surnaik commented on PR #9829:
URL: https://github.com/apache/incubator-gluten/pull/9829#issuecomment-2933287774
> For V2 Source Scan, you can try [this PR](https://github.com/apache/spark/pull/37514) to support DPP.
Thanks, currently, BatchScanExec does support DPP but when we use the ArrowScanReplaceRule, the ArrowBatchScan doesn’t support it since it doesn’t implement the filteredPartitions
--
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: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [VL] Fix DPP not working for Arrow Scan [incubator-gluten]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #9829:
URL: https://github.com/apache/incubator-gluten/pull/9829#issuecomment-2931135305
Run Gluten Clickhouse CI on x86
--
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: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org