Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CORE] Add custom cost evaluator for optimize buildSide of shuffled hash join #6143

Merged
merged 3 commits into from
Jun 20, 2024

Conversation

zml1206
Copy link
Contributor

@zml1206 zml1206 commented Jun 19, 2024

What changes were proposed in this pull request?

Split from #6093 .
Add custom cost evaluator for use the smaller table to build hashmap in shuffled hash join.

How was this patch tested?

Copy link

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:

Copy link

Run Gluten Clickhouse CI

@zml1206
Copy link
Contributor Author

zml1206 commented Jun 19, 2024

cc @zhztheplayer @ulysses-you thank you.

"If true and gluten enabled, use " +
"org.apache.spark.sql.execution.adaptive.GlutenCostEvaluator as custom cost " +
"evaluator class, else follow the configuration " +
"org.apache.spark.sql.execution.adaptive.GlutenCostEvaluator.")
Copy link
Member

Choose a reason for hiding this comment

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

org.apache.spark.sql.execution.adaptive.GlutenCostEvaluator this should be corrected

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My mistake, fixed, thank you.

Copy link

Run Gluten Clickhouse CI

zhztheplayer
zhztheplayer previously approved these changes Jun 19, 2024
Copy link
Member

@zhztheplayer zhztheplayer left a comment

Choose a reason for hiding this comment

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

Thanks!

case class GlutenCostEvaluator() extends CostEvaluator with SQLConfHelper {
override def evaluateCost(plan: SparkPlan): Cost = {
val forceOptimizeSkewedJoin = conf.getConf(SQLConf.ADAPTIVE_FORCE_OPTIMIZE_SKEWED_JOIN)
new GlutenCost(SimpleCostEvaluator(forceOptimizeSkewedJoin), plan)
Copy link
Contributor

Choose a reason for hiding this comment

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

if (GlutenConfig.getConf.enableGluten) {
  GlutenCost(SimpleCostEvaluator(forceOptimizeSkewedJoin), plan)
} else {
  SimpleCostEvaluator(forceOptimizeSkewedJoin)
}

To make it as a query level config.

Copy link

Run Gluten Clickhouse CI

Copy link
Contributor

@ulysses-you ulysses-you left a comment

Choose a reason for hiding this comment

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

lgtm if tests pass

@ulysses-you ulysses-you merged commit 38d7e10 into apache:main Jun 20, 2024
37 of 38 checks passed
@zml1206
Copy link
Contributor Author

zml1206 commented Jun 20, 2024

Thank you for review. @ulysses-you @zhztheplayer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants