Skip to content

Commit

Permalink
[SPARK-50905][SQL][TESTS] Rename Customer* to Custom* in `SparkSe…
Browse files Browse the repository at this point in the history
…ssionExtensionSuite`

### What changes were proposed in this pull request?

This PR aims to rename `Customer*` to `Custom*` in `SparkSessionExtensionSuite` like the other existing ones in the same file.
- `CustomAggHint`
- `CustomAggregateRule`
- `CustomSortHint`
- `CustomSortRule`

### Why are the changes needed?

To make the comment and code consistently by using a general term `Custom` instead of `Customer`.

### Does this PR introduce _any_ user-facing change?

No, this is a renaming in test cases.

### How was this patch tested?

Pass the CIs.

### Was this patch authored or co-authored using generative AI tooling?

No.

Closes #49587 from dongjoon-hyun/SPARK-50905.

Authored-by: Dongjoon Hyun <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
  • Loading branch information
dongjoon-hyun committed Jan 21, 2025
1 parent dabd212 commit 001e244
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ class SparkSessionExtensionSuite extends SparkFunSuite with SQLHelper with Adapt
test("custom aggregate hint") {
// The custom hint allows us to replace the aggregate (without grouping keys) with just
// Literal.
withSession(Seq(_.injectHintResolutionRule(CustomerAggregateHintResolutionRule),
withSession(Seq(_.injectHintResolutionRule(CustomAggregateHintResolutionRule),
_.injectOptimizerRule(CustomAggregateRule))) { session =>
val res = session.range(10).agg(max("id")).as("max_id")
.hint("MAX_VALUE", "id", 10)
Expand All @@ -562,7 +562,7 @@ class SparkSessionExtensionSuite extends SparkFunSuite with SQLHelper with Adapt

test("custom sort hint") {
// The custom hint allows us to replace the sort with its input
withSession(Seq(_.injectHintResolutionRule(CustomerSortHintResolutionRule),
withSession(Seq(_.injectHintResolutionRule(CustomSortHintResolutionRule),
_.injectOptimizerRule(CustomSortRule))) { session =>
val res = session.range(10).sort("id")
.hint("INPUT_SORTED")
Expand Down Expand Up @@ -1263,7 +1263,7 @@ case class CustomAggHint(attribute: AttributeReference, max: Int) extends Aggreg

// Attaches the CustomAggHint to the aggregate node without grouping keys if the aggregate
// function is MAX over the specified column.
case class CustomerAggregateHintResolutionRule(spark: SparkSession) extends Rule[LogicalPlan] {
case class CustomAggregateHintResolutionRule(spark: SparkSession) extends Rule[LogicalPlan] {
val MY_HINT_NAME = Set("MAX_VALUE")

def isMax(expr: NamedExpression, attribute: String): Option[AttributeReference] = {
Expand Down Expand Up @@ -1316,7 +1316,7 @@ case class CustomAggregateRule(spark: SparkSession) extends Rule[LogicalPlan] {
case class CustomSortHint(inputSorted: Boolean) extends SortHint

// Attaches the CustomSortHint to the sort node.
case class CustomerSortHintResolutionRule(spark: SparkSession) extends Rule[LogicalPlan] {
case class CustomSortHintResolutionRule(spark: SparkSession) extends Rule[LogicalPlan] {
val MY_HINT_NAME = Set("INPUT_SORTED")

private def applySortHint(plan: LogicalPlan): LogicalPlan = plan.transformDown {
Expand Down

0 comments on commit 001e244

Please sign in to comment.