Skip to content
Closed
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 @@ -501,7 +501,9 @@ object VeloxBackendSettings extends BackendSettingsApi {
(conf.isUseGlutenShuffleManager || conf.shuffleManagerSupportsColumnarShuffle)
}

override def enableJoinKeysRewrite(): Boolean = false
override def enableJoinKeysRewrite(): Boolean = {
GlutenConfig.get.hashJoinKeysRewrite

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the previous value is false?

}

override def supportHashBuildJoinTypeOnLeft: JoinType => Boolean = {
t =>
Expand Down
1 change: 1 addition & 0 deletions docs/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ nav_order: 15
| spark.gluten.sql.fallbackRegexpExpressions | false | If true, fall back all regexp expressions. There are a few incompatible cases between RE2 (used by native engine) and java.util.regex (used by Spark). User should enable this property if their incompatibility is intolerable. |
| spark.gluten.sql.fallbackUnexpectedMetadataParquet | false | If enabled, Gluten will not offload scan when unexpected metadata is detected. |
| spark.gluten.sql.fallbackUnexpectedMetadataParquet.limit | 10 | If supplied, metadata of `limit` number of Parquet files will be checked to determine whether to fall back to java scan. |
| spark.gluten.sql.hashjoin.key.rewrite | false | Enable or disable spark hash join key rewrite |
| spark.gluten.sql.injectNativePlanStringToExplain | false | When true, Gluten will inject native plan tree to Spark's explain output. |
| spark.gluten.sql.mergeTwoPhasesAggregate.enabled | true | Whether to merge two phases aggregate if there are no other operators between them. |
| spark.gluten.sql.native.arrow.reader.enabled | false | This is config to specify whether to enable the native columnar csv reader |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,8 @@ class GlutenConfig(conf: SQLConf) extends GlutenCoreConfig(conf) {

def smallFileThreshold: Double = getConf(SMALL_FILE_THRESHOLD)

def hashJoinKeysRewrite: Boolean = getConf(HASHJOIN_KEY_REWRITE_ENABLED)

def expressionBlacklist: Set[String] = {
val blacklistSet = getConf(EXPRESSION_BLACK_LIST)
.map(_.toLowerCase(Locale.ROOT).split(",").map(_.trim()).filter(_.nonEmpty).toSet)
Expand Down Expand Up @@ -1585,4 +1587,10 @@ object GlutenConfig extends ConfigRegistry {
"total size of small files is below this threshold.")
.doubleConf
.createWithDefault(0.5)

val HASHJOIN_KEY_REWRITE_ENABLED =
buildConf("spark.gluten.sql.hashjoin.key.rewrite")
.doc("Enable or disable spark hash join key rewrite")
.booleanConf
.createWithDefault(false)
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package org.apache.spark.sql.execution

import org.apache.gluten.backendsapi.BackendsApiManager
import org.apache.gluten.config.GlutenConfig
import org.apache.gluten.execution.GlutenPlan
import org.apache.gluten.extension.columnar.transition.Convention
import org.apache.gluten.metrics.GlutenTimeMetric
Expand Down Expand Up @@ -73,7 +74,8 @@ case class ColumnarSubqueryBroadcastExec(
private def canRewriteAsLongType(keys: Seq[Expression]): Boolean = {
// TODO: support BooleanType, DateType and TimestampType
keys.forall(_.dataType.isInstanceOf[IntegralType]) &&
keys.map(_.dataType.defaultSize).sum <= 8
keys.map(_.dataType.defaultSize).sum <= 8 &&
GlutenConfig.get.hashJoinKeysRewrite
}

@transient
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,8 @@ class VeloxTestSettings extends BackendTestSettings {
.excludeByPrefix("SPARK-35675")

enableSuite[GlutenBroadcastJoinSuite]
// Disable hash join key rewrite feature in Gluten
.exclude("join key rewritten")
.exclude("Shouldn't change broadcast join buildSide if user clearly specified")
.exclude("Shouldn't bias towards build right if user didn't specify")
.exclude("SPARK-23192: broadcast hint should be retained after using the cached data")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,8 @@ class VeloxTestSettings extends BackendTestSettings {
enableSuite[GlutenEnsureRequirementsSuite]

enableSuite[GlutenBroadcastJoinSuite]
// Disable hash join key rewrite feature in Gluten
.exclude("join key rewritten")
.exclude("Shouldn't change broadcast join buildSide if user clearly specified")
.exclude("Shouldn't bias towards build right if user didn't specify")
.exclude("SPARK-23192: broadcast hint should be retained after using the cached data")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,8 @@ class VeloxTestSettings extends BackendTestSettings {
enableSuite[GlutenEnsureRequirementsSuite]

enableSuite[GlutenBroadcastJoinSuite]
// Disable hash join key rewrite feature in Gluten
.exclude("join key rewritten")
.exclude("Shouldn't change broadcast join buildSide if user clearly specified")
.exclude("Shouldn't bias towards build right if user didn't specify")
.exclude("SPARK-23192: broadcast hint should be retained after using the cached data")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,8 @@ class VeloxTestSettings extends BackendTestSettings {
enableSuite[GlutenEnsureRequirementsSuite]

enableSuite[GlutenBroadcastJoinSuite]
// Disable hash join key rewrite feature in Gluten
.exclude("join key rewritten")
.exclude("Shouldn't change broadcast join buildSide if user clearly specified")
.exclude("Shouldn't bias towards build right if user didn't specify")
.exclude("SPARK-23192: broadcast hint should be retained after using the cached data")
Expand Down
2 changes: 2 additions & 0 deletions package/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,8 @@
<ignoreClass>org.apache.spark.memory.TaskMemoryManager</ignoreClass>
<!-- guava -->
<ignoreClass>com.google.thirdparty.publicsuffix*</ignoreClass>
<ignoreClass>org.apache.spark.sql.execution.joins.HashJoin*</ignoreClass>
<ignoreClass>org.apache.spark.sql.execution.joins.HashedRelationInfo*</ignoreClass>
</ignoreClasses>
<scopes>
<scope>compile</scope>
Expand Down
Loading
Loading