-
Notifications
You must be signed in to change notification settings - Fork 28.3k
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-20496][SS] Bug in KafkaWriter Looks at Unanalyzed Plans #17804
Conversation
cc @brkyvz this should be good to go. |
Test build #76271 has finished for PR 17804 at commit
|
Test build #76272 has finished for PR 17804 at commit
|
@anabranch can you open this against branch-2.1 instead of master? |
@hvanhovell We need this fix in master as well. It somehow works magically in master, but is broken for sure in 2.1 |
yeah it's broken in both, only visible in 1. Not sure if that needs to be in 2 PRs. |
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 nits, LGTM. Will merge pending tests + nit addressing
@@ -26,13 +26,16 @@ import org.scalatest.time.SpanSugar._ | |||
|
|||
import org.apache.spark.SparkException | |||
import org.apache.spark.sql._ | |||
import org.apache.spark.sql.catalyst.analysis.UnresolvedException |
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: unnecessary import
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.
done
import org.apache.spark.sql.streaming._ | ||
import org.apache.spark.sql.test.SharedSQLContext | ||
import org.apache.spark.sql.types.{BinaryType, DataType} | ||
|
||
class KafkaSinkSuite extends StreamTest with SharedSQLContext { | ||
|
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: delete line
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.
done
.option("kafka.bootstrap.servers", testUtils.brokerAddress) | ||
.option("topic", topic) | ||
.save() | ||
|
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: extra line
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.
done
val topic = newTopic() | ||
testUtils.createTopic(topic) | ||
|
||
inputEvents.write |
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: wrong indentation. + I would add a comment here that this would used to throw an UnresolvedException
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.
done
@@ -108,6 +111,22 @@ class KafkaSinkSuite extends StreamTest with SharedSQLContext { | |||
s"save mode overwrite not allowed for kafka")) | |||
} | |||
|
|||
test("batch - enforce analyzed plans SPARK-20496") { |
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: SPARK-20496: batch - enforce analyzed plans
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.
done
LGTM! |
Test build #76275 has finished for PR 17804 at commit
|
merging to master, branch-2.2 and branch-2.1 |
## What changes were proposed in this pull request? We didn't enforce analyzed plans in Spark 2.1 when writing out to Kafka. ## How was this patch tested? New unit test. Please review http://spark.apache.org/contributing.html before opening a pull request. Author: Bill Chambers <bill@databricks.com> Closes #17804 from anabranch/SPARK-20496-2. (cherry picked from commit 733b81b) Signed-off-by: Burak Yavuz <brkyvz@gmail.com>
## What changes were proposed in this pull request? We didn't enforce analyzed plans in Spark 2.1 when writing out to Kafka. ## How was this patch tested? New unit test. Please review http://spark.apache.org/contributing.html before opening a pull request. Author: Bill Chambers <bill@databricks.com> Closes #17804 from anabranch/SPARK-20496-2. (cherry picked from commit 733b81b) Signed-off-by: Burak Yavuz <brkyvz@gmail.com>
We didn't enforce analyzed plans in Spark 2.1 when writing out to Kafka. New unit test. Please review http://spark.apache.org/contributing.html before opening a pull request. Author: Bill Chambers <bill@databricks.com> Closes apache#17804 from anabranch/SPARK-20496-2.
What changes were proposed in this pull request?
We didn't enforce analyzed plans in Spark 2.1 when writing out to Kafka.
How was this patch tested?
New unit test.
Please review http://spark.apache.org/contributing.html before opening a pull request.