You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/12/13 14:03:00 UTC

[jira] [Commented] (SPARK-26360) Avoid extra validateQuery call in createStreamingWriteSupport

    [ https://issues.apache.org/jira/browse/SPARK-26360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16720200#comment-16720200 ] 

ASF GitHub Bot commented on SPARK-26360:
----------------------------------------

JasonWayne opened a new pull request #23309: [SPARK-26360]remove extra validateQuery call
URL: https://github.com/apache/spark/pull/23309
 
 
   ## What changes were proposed in this pull request?
   remove an redundant `KafkaWriter.validateQuery` call in `KafkaSourceProvider `
   
   ## How was this patch tested?
   Just removing duplicate codes, so I just build and run unit tests.
   

----------------------------------------------------------------
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:
users@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
>
> When I'm reading structured streaming source code, I find there is a extra 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-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org