[ https://issues.apache.org/jira/browse/SPARK-26360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16720859#comment-16720859 ]
ASF GitHub Bot commented on SPARK-26360: ---------------------------------------- asfgit closed pull request #23309: [SPARK-26360]remove redundant validateQuery call URL: https://github.com/apache/spark/pull/23309 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaSourceProvider.scala b/external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaSourceProvider.scala index 6a0c2088ac3d1..4b8b5c0019b44 100644 --- a/external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaSourceProvider.scala +++ b/external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaSourceProvider.scala @@ -266,8 +266,6 @@ private[kafka010] class KafkaSourceProvider extends DataSourceRegister // We convert the options argument from V2 -> Java map -> scala mutable -> scala immutable. val producerParams = kafkaParamsForProducer(options.asMap.asScala.toMap) - KafkaWriter.validateQuery(schema.toAttributes, producerParams, topic) - new KafkaStreamingWriteSupport(topic, producerParams, schema) } ---------------------------------------------------------------- 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: us...@infra.apache.org > Avoid extra validateQuery call in createStreamingWriteSupport > ------------------------------------------------------------- > > Key: SPARK-26360 > URL: https://issues.apache.org/jira/browse/SPARK-26360 > Project: Spark > Issue Type: Improvement > Components: Structured Streaming > Affects Versions: 2.3.2, 2.4.0 > Reporter: Wu Wenjie > Priority: Trivial > Fix For: 3.0.0 > > > When I'm reading structured streaming source code, I find there is a > redundant KafkaWriter.validateQuery() function call in > createStreamingWriteSupport func in class `KafkaSourceProvider`. > {code:scala} > // KafkaSourceProvider.scala > override def createStreamingWriteSupport( > queryId: String, > schema: StructType, > mode: OutputMode, > options: DataSourceOptions): StreamingWriteSupport = { > ..... > // validate once here > KafkaWriter.validateQuery(schema.toAttributes, producerParams, topic) > // validate twice here > new KafkaStreamingWriteSupport(topic, producerParams, schema) > } > // KafkaStreamingWriteSupport.scala > class KafkaStreamingWriteSupport( > topic: Option[String], > producerParams: ju.Map[String, Object], > schema: StructType) > extends StreamingWriteSupport { > validateQuery(schema.toAttributes, producerParams, topic) > .... > } > {code} > > I think we just need to remove one of these two. -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org