You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (JIRA)" <ji...@apache.org> on 2017/03/08 12:06:38 UTC

[jira] [Commented] (SPARK-19853) Uppercase Kafka topics fail when startingOffsets are SpecificOffsets

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

Apache Spark commented on SPARK-19853:
--------------------------------------

User 'uncleGen' has created a pull request for this issue:
https://github.com/apache/spark/pull/17209

> Uppercase Kafka topics fail when startingOffsets are SpecificOffsets
> --------------------------------------------------------------------
>
>                 Key: SPARK-19853
>                 URL: https://issues.apache.org/jira/browse/SPARK-19853
>             Project: Spark
>          Issue Type: Bug
>          Components: Structured Streaming
>    Affects Versions: 2.1.0
>            Reporter: Chris Bowden
>            Priority: Trivial
>
> When using the KafkaSource with Structured Streaming, consumer assignments are not what the user expects if startingOffsets is set to an explicit set of topics/partitions in JSON where the topic(s) happen to have uppercase characters. When StartingOffsets is constructed, the original string value from options is transformed toLowerCase to make matching on "earliest" and "latest" case insensitive. However, the toLowerCase json is passed to SpecificOffsets for the terminal condition, so topic names may not be what the user intended by the time assignments are made with the underlying KafkaConsumer.
> From KafkaSourceProvider:
> {code}
> val startingOffsets = caseInsensitiveParams.get(STARTING_OFFSETS_OPTION_KEY).map(_.trim.toLowerCase) match {
>     case Some("latest") => LatestOffsets
>     case Some("earliest") => EarliestOffsets
>     case Some(json) => SpecificOffsets(JsonUtils.partitionOffsets(json))
>     case None => LatestOffsets
>   }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org