Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-8310

CommandLineUtils.parseKeyValueArgs --property flag too greedy when splitting key=value pairs

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Trivial
    • Resolution: Duplicate
    • Affects Version/s: 1.1.0
    • Fix Version/s: 2.1.0
    • Component/s: producer
    • Labels:
      None

      Description

      The CommandLineUtils split apart all equal signs in the key-value pair rather than just the first, therefore making something like this fail.

      --property value.schema='{"name":"foo", "type":"string", "doc": "key=value"}'

      as it tries to assign these two properties separately

      {"name":"foo", "type":"string", "doc": "key
      value"}

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                cricket007 Jordan Moore
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: