gaborgsomogyi commented on a change in pull request #24441: [SPARK-27494][SS]
Null values don't work in Kafka source v2
URL: https://github.com/apache/spark/pull/24441#discussion_r278561668
##########
File path:
external/kafka-0-10-sql/src/test/scala/org/apache/spark/sql/kafka010/KafkaMicroBatchSourceSuite.scala
##########
@@ -1511,6 +1515,54 @@ abstract class KafkaSourceSuiteBase extends
KafkaSourceTest {
CheckAnswer(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17)
)
}
+
+ protected def testNullableKeyValue(trigger: Trigger): Unit = {
+ val table = "kafka_null_key_value_source_test"
+ withTable(table) {
+ val topic = newTopic()
+ testUtils.createTopic(topic)
+ testUtils.withProducer { producer =>
Review comment:
The producer.send() could result in duplicate writes of messages due to
internal retries (such case the test fails). Using `withTranscationalProducer`
and `.option("kafka.isolation.level", "read_committed")` could increase
reliability of the test (though since Kafka broker runs in-memory I don't see
high change of this).
A side note I've tested it and `withTranscationalProducer` works fine with
some modifications.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]