Skip to content
This repository has been archived by the owner on Sep 18, 2023. It is now read-only.

[NSE-1164] Limit the max column num in WSCG #1165

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,9 @@ class GazellePluginConfig(conf: SQLConf) extends Logging {
conf
.getConfString("spark.oap.sql.columnar.shuffleSplitDefaultSize", "8192").toInt

val maxWholeStageCodegenColumnNum: Int =
conf.getConfString("spark.oap.sql.columnar.codegen.maxColumnNum", "30").toInt

val numaBindingInfo: GazelleNumaBindingInfo = {
val enableNumaBinding: Boolean =
conf.getConfString("spark.oap.sql.columnar.numaBinding", "false").toBoolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ case class ColumnarConditionProjectExec(
}
}
}
true
super.supportColumnarCodegen
}

def getKernelFunction(childTreeNode: TreeNode): TreeNode = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ case class ColumnarBroadcastHashJoinExec(
override def getChild: SparkPlan = streamedPlan

override def supportColumnarCodegen: Boolean = {
this.supportCodegen
this.supportCodegen && super.supportColumnarCodegen
}

val output_skip_alias =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ case class ColumnarHashAggregateExec(
}
}
}
return true
super.supportColumnarCodegen
}

def getKernelFunction: TreeNode = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ case class ColumnarShuffledHashJoinExec(
}

override def supportColumnarCodegen: Boolean = {
this.supportCodegen
this.supportCodegen && super.supportColumnarCodegen
}

val output_skip_alias =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ case class ColumnarSortExec(
Seq(child.executeColumnar())
}

override def supportColumnarCodegen: Boolean = true
override def supportColumnarCodegen: Boolean = super.supportColumnarCodegen

override def getBuildPlans: Seq[(SparkPlan, SparkPlan)] = child match {
case c: ColumnarCodegenSupport if c.supportColumnarCodegen == true =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ case class ColumnarSortMergeJoinExec(
return false
}
}
true
super.supportColumnarCodegen
}

val output_skip_alias =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ trait ColumnarCodegenSupport extends SparkPlan {
/**
* Whether this SparkPlan supports whole stage codegen or not.
*/
def supportColumnarCodegen: Boolean = true
def supportColumnarCodegen: Boolean = {
// TODO: support large num columns in WSCG
output.size <= GazellePluginConfig.getSessionConf.maxWholeStageCodegenColumnNum
}

/**
* Returns all the RDDs of ColumnarBatch which generates the input rows.
Expand Down Expand Up @@ -91,7 +94,7 @@ case class ColumnarWholeStageCodegenExec(child: SparkPlan)(val codegenStageId: I

// This is not strictly needed because the codegen transformation happens after the columnar
// transformation but just for consistency
override def supportColumnarCodegen: Boolean = true
override def supportColumnarCodegen: Boolean = super.supportColumnarCodegen

override def supportsColumnar: Boolean = true

Expand Down