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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Duplicate
    • 1.1.0
    • 2.1.0
    • producer
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: