-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-25644][SS]Fix java foreachBatch in DataStreamWriter #22633
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
Conversation
|
cc @tdas |
HeartSaVioR
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor comment (2 cents) but LGTM. Nice catch!
| } | ||
|
|
||
| @Test | ||
| public void testForeachBatchAPI() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MINOR: I guess it will be duplicated effort on both Scala and Java suite, but IMHO adding sanity check wouldn't hurt much and prevent further possible misses.
|
Test build #96953 has finished for PR 22633 at commit
|
|
Test build #96955 has finished for PR 22633 at commit
|
| @@ -0,0 +1,89 @@ | |||
| /* | |||
| * Licensed to the Apache Software Foundation (ASF) under one or more | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zsxwing . Could you fix the indentation of Apache License?
| @After | ||
| public void tearDown() { | ||
| Utils.deleteRecursively(new File(input)); | ||
| spark.stop(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since deleteRecursively can raise IOException, can we have try ... finally ... to ensure spark.stop invocation?
| @Test | ||
| public void testForeachAPI() { | ||
| StreamingQuery query = spark | ||
| .readStream() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: 2 space indentation
|
|
||
| @Override | ||
| public void process(String value) { | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tiny nit: I would just public void process(String value) { }
|
Looks like |
|
Looks fine to me |
|
Test build #96971 has finished for PR 22633 at commit
|
|
retest this please |
|
Test build #96982 has finished for PR 22633 at commit
|
|
Right. It's weird that |
dongjoon-hyun
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, LGTM.
|
Thanks. Merging to master and 2.4. |
## What changes were proposed in this pull request? The java `foreachBatch` API in `DataStreamWriter` should accept `java.lang.Long` rather `scala.Long`. ## How was this patch tested? New java test. Closes #22633 from zsxwing/fix-java-foreachbatch. Authored-by: Shixiong Zhu <[email protected]> Signed-off-by: Shixiong Zhu <[email protected]>
|
It turns out that we didn't check Scala 2.12 build. I'll make a follow-up. |
## What changes were proposed in this pull request? The java `foreachBatch` API in `DataStreamWriter` should accept `java.lang.Long` rather `scala.Long`. ## How was this patch tested? New java test. Closes apache#22633 from zsxwing/fix-java-foreachbatch. Authored-by: Shixiong Zhu <[email protected]> Signed-off-by: Shixiong Zhu <[email protected]>
What changes were proposed in this pull request?
The java
foreachBatchAPI inDataStreamWritershould acceptjava.lang.Longratherscala.Long.How was this patch tested?
New java test.