zhztheplayer commented on code in PR #7686:
URL: https://github.com/apache/incubator-gluten/pull/7686#discussion_r1818566654
##########
gluten-substrait/src/main/scala/org/apache/gluten/planner/cost/RoughCostModel.scala:
##########
@@ -16,50 +16,62 @@
*/
package org.apache.gluten.planner.cost
-import org.apache.gluten.execution.RowToColumnarExecBase
+import org.apache.gluten.GlutenConfig
import org.apache.gluten.extension.columnar.transition.{ColumnarToRowLike,
RowToColumnarLike}
import org.apache.gluten.utils.PlanUtil
import org.apache.spark.sql.catalyst.expressions.{Alias, Attribute,
NamedExpression}
-import org.apache.spark.sql.execution.{ColumnarToRowExec, ProjectExec,
RowToColumnarExec, SparkPlan}
-import org.apache.spark.sql.types.{ArrayType, MapType, StructType}
+import org.apache.spark.sql.execution.{ColumnarToRowExec, DataSourceScanExec,
LeafExecNode, ProjectExec, RowToColumnarExec, SparkPlan}
+import org.apache.spark.sql.execution.adaptive.AdaptiveSparkPlanExec
/** A rough cost model with some empirical heuristics. */
class RoughCostModel extends LongCostModel {
+ private def getSizeFactor(plan: SparkPlan): Long = {
+ // Get the bytes size that the plan needs to consume
+ val sizeBytes = plan match {
+ case scan: DataSourceScanExec => getStatSizeBytes(scan)
+ case _: LeafExecNode => 0L
Review Comment:
Why this line is needed?
##########
gluten-substrait/src/main/scala/org/apache/gluten/planner/cost/RoughCostModel.scala:
##########
@@ -16,50 +16,62 @@
*/
package org.apache.gluten.planner.cost
-import org.apache.gluten.execution.RowToColumnarExecBase
+import org.apache.gluten.GlutenConfig
import org.apache.gluten.extension.columnar.transition.{ColumnarToRowLike,
RowToColumnarLike}
import org.apache.gluten.utils.PlanUtil
import org.apache.spark.sql.catalyst.expressions.{Alias, Attribute,
NamedExpression}
-import org.apache.spark.sql.execution.{ColumnarToRowExec, ProjectExec,
RowToColumnarExec, SparkPlan}
-import org.apache.spark.sql.types.{ArrayType, MapType, StructType}
+import org.apache.spark.sql.execution.{ColumnarToRowExec, DataSourceScanExec,
LeafExecNode, ProjectExec, RowToColumnarExec, SparkPlan}
+import org.apache.spark.sql.execution.adaptive.AdaptiveSparkPlanExec
/** A rough cost model with some empirical heuristics. */
class RoughCostModel extends LongCostModel {
+ private def getSizeFactor(plan: SparkPlan): Long = {
+ // Get the bytes size that the plan needs to consume
+ val sizeBytes = plan match {
+ case scan: DataSourceScanExec => getStatSizeBytes(scan)
Review Comment:
Do we need to consider DSV2?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]