You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Jordan Moore (JIRA)" <ji...@apache.org> on 2019/05/01 22:00:03 UTC

[jira] [Created] (KAFKA-8310) CommandLineUtils.parseKeyValueArgs --property flag too greedy when splitting key=value pairs

Jordan Moore created KAFKA-8310:
-----------------------------------

             Summary: CommandLineUtils.parseKeyValueArgs --property flag too greedy when splitting key=value pairs
                 Key: KAFKA-8310
                 URL: https://issues.apache.org/jira/browse/KAFKA-8310
             Project: Kafka
          Issue Type: Bug
          Components: producer 
            Reporter: Jordan Moore


The CommandLineUtils split apart all equal signs in the key-value pair rather than just the first, therefore making something like this fail.
{code:java}
--property value.schema='{"name":"foo", "type":"string", "doc": "key=value"}'{code}
as it tries to assign these two properties separately
{code:java}
{"name":"foo", "type":"string", "doc": "key{code}
{code:java}
value"}{code}
Issue here

[https://github.com/apache/kafka/blob/trunk/core/src/main/scala/kafka/utils/CommandLineUtils.scala#L99]

Ideally, the code should do something like indexOf("="), to get the first one, then substring from there.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)