Skip to content

[SPARK-50985][SS] Classify Kafka Timestamp Offsets mismatch error instead of assert and throw error for missing server in KafkaTokenProvider#49662

Closed
micheal-o wants to merge 3 commits intoapache:masterfrom
micheal-o:KafkaTimestampOffsetErrFix
Closed

[SPARK-50985][SS] Classify Kafka Timestamp Offsets mismatch error instead of assert and throw error for missing server in KafkaTokenProvider#49662
micheal-o wants to merge 3 commits intoapache:masterfrom
micheal-o:KafkaTimestampOffsetErrFix

Conversation

@micheal-o
Copy link
Contributor

What changes were proposed in this pull request?

  1. In Kafka offset reader, for timestamp offsets, we assert that the assigned partitions is equal to specified partitions. Removing the assert and throwing a classified error for better error presentation
  2. In Kafka config updater, when we setAuthenticationConfigIfNeeded, we don't handle the case where user didn't specify the bootsrap server, hence leading to NoSuchElementException. Now throwing a properly classified error.

Why are the changes needed?

Error classification for better user experience

Does this PR introduce any user-facing change?

Yes, error classification

How was this patch tested?

Added new tests

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

No

@HyukjinKwon HyukjinKwon changed the title [SPARK-50985][SS] - Classify Kafka Timestamp Offsets mismatch error instead of assert and throw error for missing server in KafkaTokenProvider [SPARK-50985][SS] Classify Kafka Timestamp Offsets mismatch error instead of assert and throw error for missing server in KafkaTokenProvider Jan 25, 2025
Copy link
Contributor

@HeartSaVioR HeartSaVioR left a comment

Choose a reason for hiding this comment

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

Looks good in general. A couple comments.

Copy link
Contributor

@HeartSaVioR HeartSaVioR left a comment

Choose a reason for hiding this comment

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

+1

@HeartSaVioR
Copy link
Contributor

@HeartSaVioR
Copy link
Contributor

Thanks! Merging to master/4.0.

HeartSaVioR pushed a commit that referenced this pull request Feb 4, 2025
…tead of assert and throw error for missing server in KafkaTokenProvider

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

1. In Kafka offset reader, for timestamp offsets, we assert that the assigned partitions is equal to specified partitions. Removing the assert and throwing a classified error for better error presentation
2. In Kafka config updater, when we setAuthenticationConfigIfNeeded, we don't handle the case where user didn't specify the bootsrap server, hence leading to NoSuchElementException. Now throwing a properly classified error.

### Why are the changes needed?

Error classification for better user experience

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

Yes, error classification

### How was this patch tested?

Added new tests

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

No

Closes #49662 from micheal-o/KafkaTimestampOffsetErrFix.

Authored-by: micheal-o <micheal.okutubo@gmail.com>
Signed-off-by: Jungtaek Lim <kabhwan.opensource@gmail.com>
(cherry picked from commit 572f57a)
Signed-off-by: Jungtaek Lim <kabhwan.opensource@gmail.com>
zifeif2 pushed a commit to zifeif2/spark that referenced this pull request Nov 14, 2025
…tead of assert and throw error for missing server in KafkaTokenProvider

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

1. In Kafka offset reader, for timestamp offsets, we assert that the assigned partitions is equal to specified partitions. Removing the assert and throwing a classified error for better error presentation
2. In Kafka config updater, when we setAuthenticationConfigIfNeeded, we don't handle the case where user didn't specify the bootsrap server, hence leading to NoSuchElementException. Now throwing a properly classified error.

### Why are the changes needed?

Error classification for better user experience

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

Yes, error classification

### How was this patch tested?

Added new tests

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

No

Closes apache#49662 from micheal-o/KafkaTimestampOffsetErrFix.

Authored-by: micheal-o <micheal.okutubo@gmail.com>
Signed-off-by: Jungtaek Lim <kabhwan.opensource@gmail.com>
(cherry picked from commit 1b19de6)
Signed-off-by: Jungtaek Lim <kabhwan.opensource@gmail.com>
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.

2 participants