Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-32621

Cbimport - Allow user to specify function and field delimiters

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • None
    • 5.5.2, 6.5.0
    • tools
    • None

    Description

      Currently both '%' and '#' are used within cbimport to specify embedded fields or functions (such as MONO_INCR or UUID).

      If you actually want to use these characters within your key, e.g. 'Airline#USA#10', you would have to escape these by using double '#' instead:

      /opt/couchbase/bin/cbimport json -c couchbase://localhost -u Administrator -p password -b travel-sample -d file://output.json -f lines -g '%type%##%country%###MONO_INCR#'
      

      Instead of needing to escape characters, it would be good if instead the user could specify custom delimiters to use to represent functions or fields.

      An example usage would look something like below:

      /opt/couchbase/bin/cbimport json -c couchbase://localhost -u Administrator -p password -b travel-sample -d file://output.json -f lines -g '%type%#%country%#$MONO_INCR$' --function-delimiter='$'
      

      This not only makes the key generators more readable if you do need to use '%' or '#' in but it will probably make the parsing code simpler as you would not need to account for the cases where delimiters are escaped.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              carlos.gonzalez Carlos Gonzalez Betancort (Inactive)
              matt.carabine Matt Carabine (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty