-
Notifications
You must be signed in to change notification settings - Fork 33
Fix selectSparkVersion() to use contains() instead of equals() #504
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The current implementation of selectSparkVersion() was broken when sparkVersion is supplied. The code was requiring an exact match instead of using contains(), which never matched real Databricks Runtime version names like "12.2 LTS (includes Apache Spark 3.3.2, Scala 2.12)". This change aligns the Java SDK with the Go and Python SDK implementations, which both use contains()/in operations for sparkVersion matching. Fixes the issue described in PR #229. Added comprehensive unit tests covering: - Successful spark version matching with realistic API response data - Multiple matches with latest=true/false behavior - Integration with other selector parameters (ML, etc.) - Error cases for non-existent versions 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
|
If integration tests don't run automatically, an authorized user can run them manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
hectorcast-db
approved these changes
Aug 27, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changes are proposed in this pull request?
This PR fixes a bug in the
selectSparkVersion()method inClustersExt.javawhere spark version matching doesn't work with real Databricks Runtime version names.The current
equals()implementation fails because real Databricks Runtime version names contain additional information. For example, the actual version name is"13.3 LTS (includes Apache Spark 3.4.1, Scala 2.12)", not just"Apache Spark 3.4.1". Both the Go SDK (strings.Contains()) and Python SDK (inoperator) use substring matching for this functionality.Originally reported in PR #229 with real API response data.
How is this tested?
Added a focused unit test
sparkVersionWithSparkVersionParameter()that demonstrates the fix works with realistic API response data. The test uses a version name in the actual format returned by the Databricks API:"13.3 LTS (includes Apache Spark 3.4.1, Scala 2.12)".Fixes #229