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-8865][STREAMING] FIX BUG: check key in kafka params #7254

Closed
wants to merge 1 commit into from

Conversation

guowei2
Copy link
Contributor

@guowei2 guowei2 commented Jul 7, 2015

No description provided.

@sarutak
Copy link
Member

sarutak commented Jul 7, 2015

Could you add a test case to KafkaClusterSuite? Otherwise, LGTM.

@sarutak
Copy link
Member

sarutak commented Jul 7, 2015

Also, could you add a brief description?

@SparkQA
Copy link

SparkQA commented Jul 7, 2015

Test build #36648 has finished for PR 7254 at commit 48ca17a.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@srowen
Copy link
Member

srowen commented Jul 7, 2015

LGTM. The explanation is that contains == containsValue

@tdas
Copy link
Contributor

tdas commented Jul 9, 2015

@koeninger Please take a look at this. I am curious as to how it fails.

@koeninger
Copy link
Contributor

"zookeeper.connect" and "group.id" aren't necessary for anything in the kafka direct stream.

But they're expected to be present in a kafka consumer config, and overriding that behavior wasn't possible. So as a workaround, we set them to a blank string. That way users don't have to define unnecessary settings in the kafka param map passed to the KafkaUtils constructor. We talked through that during the original development of the direct stream.

The code as it is released today is almost always going to set a blank string, regardless of what users pass in, because contains on a java property object is not the equivalent of containsKey, it is containsValue. This just fixes it so that if they do pass in values for those keys, for whatever personal reasons they have, the values won't get overwritten with a blank string.

TL;DR this should have no impact, but is a good bugfix so that the code does what it looks like it's supposed to.

@koeninger
Copy link
Contributor

In case it wasn't clear, LGTM

I don't think it needs a test case, because it would be testing behavior that spark doesn't care about (we don't deal with group id or zookeeper connect)

@tdas
Copy link
Contributor

tdas commented Jul 9, 2015

@koeninger Thank you very much for the explanation. I am going to add this to the JIRa.
@guowei2 Thank you for catching this bug, I am going to merge this to master, branch 1.4 and branch-1.3

asfgit pushed a commit that referenced this pull request Jul 9, 2015
Author: guowei2 <guowei@growingio.com>

Closes #7254 from guowei2/spark-8865 and squashes the following commits:

48ca17a [guowei2] fix contains key

(cherry picked from commit 8977003)
Signed-off-by: Tathagata Das <tathagata.das1565@gmail.com>
asfgit pushed a commit that referenced this pull request Jul 9, 2015
Author: guowei2 <guowei@growingio.com>

Closes #7254 from guowei2/spark-8865 and squashes the following commits:

48ca17a [guowei2] fix contains key

(cherry picked from commit 8977003)
Signed-off-by: Tathagata Das <tathagata.das1565@gmail.com>
@asfgit asfgit closed this in 8977003 Jul 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants