viirya commented on a change in pull request #35695:
URL: https://github.com/apache/spark/pull/35695#discussion_r817066645



##########
File path: 
external/kafka-0-10/src/main/scala/org/apache/spark/streaming/kafka010/KafkaUtils.scala
##########
@@ -184,10 +184,10 @@ object KafkaUtils extends Logging {
    */
   private[kafka010] def fixKafkaParams(kafkaParams: ju.HashMap[String, 
Object]): Unit = {
     logWarning(s"overriding ${ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG} to 
false for executor")
-    kafkaParams.put(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, false: 
java.lang.Boolean)
+    kafkaParams.putIfAbsent(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, false: 
java.lang.Boolean)
 
     logWarning(s"overriding ${ConsumerConfig.AUTO_OFFSET_RESET_CONFIG} to none 
for executor")
-    kafkaParams.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "none")
+    kafkaParams.putIfAbsent(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "none")

Review comment:
       I think the Spark doc 
https://spark.apache.org/docs/latest/structured-streaming-kafka-integration.html#kafka-specific-configurations
 explains this.




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



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

Reply via email to