Skip to content

Conversation

@mgyucht
Copy link
Contributor

@mgyucht mgyucht commented Aug 25, 2025

What changes are proposed in this pull request?

This PR fixes a bug in the selectSparkVersion() method in ClustersExt.java where 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 (in operator) 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

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]>
@mgyucht mgyucht temporarily deployed to test-trigger-is August 25, 2025 16:50 — with GitHub Actions Inactive
@mgyucht mgyucht temporarily deployed to test-trigger-is August 25, 2025 16:51 — with GitHub Actions Inactive
@mgyucht mgyucht temporarily deployed to test-trigger-is August 25, 2025 16:52 — with GitHub Actions Inactive
@mgyucht mgyucht temporarily deployed to test-trigger-is August 25, 2025 16:52 — with GitHub Actions Inactive
@mgyucht mgyucht temporarily deployed to test-trigger-is August 25, 2025 16:56 — with GitHub Actions Inactive
@mgyucht mgyucht temporarily deployed to test-trigger-is August 25, 2025 16:57 — with GitHub Actions Inactive
@mgyucht mgyucht temporarily deployed to test-trigger-is August 26, 2025 10:29 — with GitHub Actions Inactive
@mgyucht mgyucht temporarily deployed to test-trigger-is August 26, 2025 10:30 — with GitHub Actions Inactive
@mgyucht mgyucht temporarily deployed to test-trigger-is August 26, 2025 14:26 — with GitHub Actions Inactive
@mgyucht mgyucht temporarily deployed to test-trigger-is August 26, 2025 14:26 — with GitHub Actions Inactive
@github-actions
Copy link

If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger:
go/deco-tests-run/sdk-java

Inputs:

  • PR number: 504
  • Commit SHA: 6d253e11b4249d6b8807180b2dc4fbf8050540ca

Checks will be approved automatically on success.

@mgyucht mgyucht requested a review from hectorcast-db August 26, 2025 14:39
@mgyucht mgyucht added this pull request to the merge queue Aug 27, 2025
Merged via the queue into main with commit 06e9a66 Aug 27, 2025
15 checks passed
@mgyucht mgyucht deleted the fix-spark-version-selector-contains branch August 27, 2025 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants