dongjinleekr commented on a change in pull request #22282: [SPARK-23539][SS] 
Add support for Kafka headers in Structured Streaming
URL: https://github.com/apache/spark/pull/22282#discussion_r255325789
 
 

 ##########
 File path: 
external/kafka-0-10-sql/src/test/scala/org/apache/spark/sql/kafka010/KafkaTestUtils.scala
 ##########
 @@ -485,3 +504,22 @@ class KafkaTestUtils(withBrokerProps: Map[String, Object] 
= Map.empty) extends L
   }
 }
 
+object KafkaTestUtils {
+
+  def assertEqual(lhs: (String, Array[(String, Array[Byte])]),
+                  rhs: (String, Array[(String, Array[Byte])])): Unit = {
+    assert(lhs._1 == rhs._1)
+    assert(lhs._2.size == rhs._2.size)
+    (0 until lhs._2.size) foreach { i =>
+      assert(lhs._2(i)._1 == rhs._2(i)._1)
+      assert(lhs._2(i)._2.deep == rhs._2(i)._2.deep)
+    }
+  }
+
+  def assertEqual(lhs: Array[(String, Array[(String, Array[Byte])])],
 
 Review comment:
   I tried it, but it throws an error; One alternative I think is defining 
`KafkaTest` trait like `AnalysisTest` which extends `SparkFunSuite` and make 
`KafkaDataConsumerSuite` extend it like `SparkSqlParserSuite` extends 
`AnalysisTest.` How about this plan?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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]

Reply via email to