Github user tdas commented on a diff in the pull request:

    https://github.com/apache/spark/pull/4511#discussion_r24467148
  
    --- Diff: 
external/kafka/src/test/scala/org/apache/spark/streaming/kafka/KafkaRDDSuite.scala
 ---
    @@ -40,43 +41,70 @@ class KafkaRDDSuite extends KafkaStreamSuiteBase with 
BeforeAndAfter {
         tearDownKafka()
       }
     
    -  test("Kafka RDD") {
    +  test("Kafka RDD basic usage") {
    +    val sparkConf = new 
SparkConf().setMaster("local[4]").setAppName(this.getClass.getSimpleName)
    +    sc = new SparkContext(sparkConf)
    +    val topic = "topicbasic"
    +    createTopic(topic)
    +    val messages = Set("the", "quick", "brown", "fox")
    +    sendMessages(topic, messages.toArray)
    +
    +
    +    val kafkaParams = Map("metadata.broker.list" -> brokerAddress,
    +      "group.id" -> s"test-consumer-${Random.nextInt(10000)}")
    +
    +    val offsetRanges = Array(OffsetRange(topic, 0, 0, messages.size))
    +
    +    val rdd =  KafkaUtils.createRDD[String, String, StringDecoder, 
StringDecoder](
    +      sc, kafkaParams, offsetRanges)
    +
    +    val received = rdd.map(_._2).collect.toSet
    +    assert(received === messages)
    +  }
    +
    +  test("Kafka RDD integration") {
    --- End diff --
    
    nit: integration doesnt quite mean much. Might be worth naming the tests 
"create by topic" and "create by topic and offset ranges"


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to