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

[SPARK-45753][CORE] Support spark.deploy.driverIdPattern #43615

Closed
wants to merge 3 commits into from

Conversation

dongjoon-hyun
Copy link
Member

@dongjoon-hyun dongjoon-hyun commented Nov 1, 2023

What changes were proposed in this pull request?

This PR aims to support spark.deploy.driverIdPattern for Apache Spark 4.0.0.

Why are the changes needed?

This allows the users to be able to control driver ID pattern.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Pass the CIs with the newly added test case.

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

No.

@github-actions github-actions bot added the CORE label Nov 1, 2023
@dongjoon-hyun
Copy link
Member Author

Could you review this Spark Master class improvement, @yaooqinn ?

@yaooqinn
Copy link
Member

yaooqinn commented Nov 1, 2023

Patterns like below will use space for padding,

"driver-%s-%4d".format("20231111111111", 1)
driver-20231111111111-   1

Can we have a test too to see if other components, such as UI, driver work properly?

@dongjoon-hyun
Copy link
Member Author

Thank you for review.

  • We can enforce a simple rule like No Space at Configuration check funtion. I'll add that.
  • BTW, Spark doesn't validate in spark.sql.redaction.options.regex in general.

", e.g., `driver-20231031224459-0019`. Please be careful to generate unique IDs")
.version("4.0.0")
.stringConf
.checkValue(!_.format(new Date(), 0).exists(_.isWhitespace), "Whitespace is not allowed.")
Copy link
Member Author

Choose a reason for hiding this comment

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

We execute String.format here in advance to prevent the failure in Master class.

assert(master.invokePrivate(_newDriverId(submitDate)) === "my-driver-00001")
}

test("SPARK-45753: Prevent invalid driver id patterns") {
Copy link
Member Author

Choose a reason for hiding this comment

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

Here is a test case for that.

@dongjoon-hyun
Copy link
Member Author

Could you review this once more, @yaooqinn ? I believe this is the best effort we can.

@yaooqinn
Copy link
Member

yaooqinn commented Nov 1, 2023

LGTM, thanks for the updates

@dongjoon-hyun
Copy link
Member Author

Thank you so much always!

@dongjoon-hyun
Copy link
Member Author

Thank you! Merged to master for Apache Spark 4.0.0.

@dongjoon-hyun dongjoon-hyun deleted the SPARK-45753 branch November 1, 2023 15:17
szehon-ho pushed a commit to szehon-ho/spark that referenced this pull request Feb 7, 2024
### What changes were proposed in this pull request?

This PR aims to support `spark.deploy.driverIdPattern` for Apache Spark 4.0.0.

### Why are the changes needed?

This allows the users to be able to control driver ID pattern.

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

No.

### How was this patch tested?

Pass the CIs with the newly added test case.

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

No.

Closes apache#43615 from dongjoon-hyun/SPARK-45753.

Authored-by: Dongjoon Hyun <dhyun@apple.com>
Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants