diff options
author | uncleGen <hustyugm@gmail.com> | 2017-03-12 17:46:31 -0700 |
---|---|---|
committer | Shixiong Zhu <shixiong@databricks.com> | 2017-03-12 17:52:20 -0700 |
commit | 0a4d06a7c3db9fec2b6f050a631e8b59b0e9376e (patch) | |
tree | 51ed33dce2cdb5e5c28db3a12c759fe341f1eb9e /sql/core | |
parent | 9f8ce4825e378b6a856ce65cb9986a5a0f0b624e (diff) | |
download | spark-0a4d06a7c3db9fec2b6f050a631e8b59b0e9376e.tar.gz spark-0a4d06a7c3db9fec2b6f050a631e8b59b0e9376e.tar.bz2 spark-0a4d06a7c3db9fec2b6f050a631e8b59b0e9376e.zip |
[SPARK-19853][SS] uppercase kafka topics fail when startingOffsets are SpecificOffsets
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.
KafkaSourceProvider.scala:
```
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
}
```
Thank cbowden for reporting.
Jenkins
Author: uncleGen <hustyugm@gmail.com>
Closes #17209 from uncleGen/SPARK-19853.
Diffstat (limited to 'sql/core')
0 files changed, 0 insertions, 0 deletions