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

cbtransfer CSV import exception if row doesn't match headers

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-beta-2
    • Fix Version/s: 2.1.0
    • Component/s: tools
    • Security Level: Public
    • Labels:
      None

      Description

      If a CSV file has a row that has fewer fields than the first "column definition row"... For example...

      lastname,firstname,city
      yaseen,rahim,RS
      ghods,farshid,SF
      yen
      barr,sharon,PA

      Then the cbtransfer CSV importer will throw an exception when it hits the row "yen", as that row has fewer fields (1) than the first field definition row that says there should be 3 fields.

      Traceback (most recent call last):
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 530, in __bootstrap_inner
      self.run()
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 483, in run
      self._target(*self.args, **self._kwargs)
      File "/Users/steveyen/work/membase/dev/voltron.couchbase/build/membase-cli/pump.py", line 264, in run_worker
      source_map, sink_map, self.ctl, curx).run()
      File "/Users/steveyen/work/membase/dev/voltron.couchbase/build/membase-cli/pump.py", line 321, in run
      rv_batch, batch = self.source.provide_batch()
      File "/Users/steveyen/work/membase/dev/voltron.couchbase/build/membase-cli/pump_csv.py", line 84, in provide_batch
      doc[field] = number_try_parse(vals[i])
      IndexError: list index out of range

      # Subject Project Status CR V
      For Gerrit Dashboard: &For+MB-7103=message:MB-7103

        Activity

        Show
        steve Steve Yen added a comment - http://review.couchbase.org/#/c/22295/
        Hide
        steve Steve Yen added a comment -

        to 2.0.2 per bug-scrub

        Show
        steve Steve Yen added a comment - to 2.0.2 per bug-scrub
        Hide
        steve Steve Yen added a comment -

        Bin, I think these might be in gerrit already, but probably on the wrong branch. Can you help rescue them?
        Thanks,
        Steve

        Show
        steve Steve Yen added a comment - Bin, I think these might be in gerrit already, but probably on the wrong branch. Can you help rescue them? Thanks, Steve
        Hide
        bcui Bin Cui (Inactive) added a comment -

        Merge Steve's change into 2.0.2 branch

        Show
        bcui Bin Cui (Inactive) added a comment - Merge Steve's change into 2.0.2 branch
        Hide
        maria Maria McDuff (Inactive) added a comment -

        pls verify in current 2.0.2 build

        Show
        maria Maria McDuff (Inactive) added a comment - pls verify in current 2.0.2 build
        Hide
        abhinav Abhinav Dangeti added a comment -

        Verified change, yet to be merged though.

        Show
        abhinav Abhinav Dangeti added a comment - Verified change, yet to be merged though.

          People

          • Assignee:
            abhinav Abhinav Dangeti
            Reporter:
            steve Steve Yen
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Gerrit Reviews

              There are no open Gerrit changes