-
Notifications
You must be signed in to change notification settings - Fork 2.2k
[SparkConnector][No Review]FixNoClassDefFoundError for MetadataVersionUtil #48837
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
FabianMeiswinkel
merged 10 commits into
Azure:main
from
xinlian12:fix/cosmos-spark-metadataversion-noclass
Apr 17, 2026
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
8be5fd2
Fix NoClassDefFoundError for MetadataVersionUtil in Cosmos Spark conn…
xinlian12 43ad5d5
Add unit tests for inlined validateVersion logic
xinlian12 90ca3f6
Add change feed micro-batch streaming scenarios to Databricks live te…
xinlian12 50e51e8
Fix change feed streaming checkpoint path in Databricks notebooks
xinlian12 880994d
Simplify change feed streaming test to use memory sink
xinlian12 11bfba7
Remove change feed streaming scenarios from Databricks notebooks
xinlian12 51bb567
Re-add change feed streaming with shared logic in both notebooks
xinlian12 b999e3f
Remove change feed streaming from AAD/MSI notebook
xinlian12 b469e86
Add diagnostic logging to MSI change feed streaming test
xinlian12 4c78890
Remove change feed streaming from MSI notebook
xinlian12 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
69 changes: 69 additions & 0 deletions
69
...mos-spark_3/src/test/scala/com/azure/cosmos/spark/ChangeFeedInitialOffsetWriterSpec.scala
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
| package com.azure.cosmos.spark | ||
|
|
||
| class ChangeFeedInitialOffsetWriterSpec extends UnitSpec { | ||
|
|
||
| "validateVersion" should "return version for valid version string within supported range" in { | ||
| ChangeFeedInitialOffsetWriter.validateVersion("v1", 1) shouldBe 1 | ||
| } | ||
|
|
||
| it should "return version when version is less than max supported" in { | ||
| ChangeFeedInitialOffsetWriter.validateVersion("v1", 5) shouldBe 1 | ||
| } | ||
|
|
||
| it should "return version when version equals max supported" in { | ||
| ChangeFeedInitialOffsetWriter.validateVersion("v3", 3) shouldBe 3 | ||
| } | ||
|
|
||
| it should "throw IllegalStateException for version exceeding max supported" in { | ||
| val exception = intercept[IllegalStateException] { | ||
| ChangeFeedInitialOffsetWriter.validateVersion("v2", 1) | ||
| } | ||
| exception.getMessage should include("UnsupportedLogVersion") | ||
| exception.getMessage should include("v1") | ||
| exception.getMessage should include("v2") | ||
| } | ||
|
|
||
| it should "throw IllegalStateException for non-numeric version" in { | ||
| val exception = intercept[IllegalStateException] { | ||
| ChangeFeedInitialOffsetWriter.validateVersion("vabc", 1) | ||
| } | ||
| exception.getMessage should include("malformed") | ||
| } | ||
|
|
||
| it should "throw IllegalStateException for empty string" in { | ||
| val exception = intercept[IllegalStateException] { | ||
| ChangeFeedInitialOffsetWriter.validateVersion("", 1) | ||
| } | ||
| exception.getMessage should include("malformed") | ||
| } | ||
|
|
||
| it should "throw IllegalStateException for string without v prefix" in { | ||
| val exception = intercept[IllegalStateException] { | ||
| ChangeFeedInitialOffsetWriter.validateVersion("1", 1) | ||
| } | ||
| exception.getMessage should include("malformed") | ||
| } | ||
|
|
||
| it should "throw IllegalStateException for v0 (zero version)" in { | ||
| val exception = intercept[IllegalStateException] { | ||
| ChangeFeedInitialOffsetWriter.validateVersion("v0", 1) | ||
| } | ||
| exception.getMessage should include("malformed") | ||
| } | ||
|
|
||
| it should "throw IllegalStateException for negative version" in { | ||
| val exception = intercept[IllegalStateException] { | ||
| ChangeFeedInitialOffsetWriter.validateVersion("v-1", 1) | ||
| } | ||
| exception.getMessage should include("malformed") | ||
| } | ||
|
|
||
| it should "throw IllegalStateException for version string with only v" in { | ||
| val exception = intercept[IllegalStateException] { | ||
| ChangeFeedInitialOffsetWriter.validateVersion("v", 1) | ||
| } | ||
| exception.getMessage should include("malformed") | ||
| } | ||
| } |
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
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.
Uh oh!
There was an error while loading. Please reload this page.