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

cbtransfer CSV import parses 000000 incorrectly

    Details

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

      Description

      If you have a CSV input file that looks like...

      id,age,body,index,name
      221,19,0000000000,221,221
      71,71,0000000000,71,71
      553,48,0000000000,553,553

      Then...

      cbtransfer file.csv stdout:

      Will incorrect translate the "0000000000" as a numeric 0 instead of a string of multiple '0' characters.

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

        Activity

        Show
        steve Steve Yen added a comment - http://review.couchbase.org/#/c/22294/1
        Show
        steve Steve Yen added a comment - http://review.couchbase.org/#/c/22293/1
        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 added a comment -

        Based on CBD-603, we parse 00000 to numeric value for fields other than id. So it won't be a bug

        Show
        bcui Bin Cui added a comment - Based on CBD-603, we parse 00000 to numeric value for fields other than id. So it won't be a bug
        Hide
        bcui Bin Cui added a comment -

        Merge Steve change into 2.0.2 branch.

        Show
        bcui Bin Cui added a comment - Merge Steve 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
        Chisheng Chisheng Hong (Inactive) added a comment -

        Verified with build 2.0.2-762 on centos machine.
        Create file.csv:
        id,age,body,index,name
        221,19,0000000000,221,221
        71,71,0000000000,71,71
        553,48,0000000000,553,553

        [root@slv-0702 ~]# cd /opt/couchbase/bin/
        [root@slv-0702 bin]# ./cbtransfer ~/file.csv stdout:
        set 221 0 0 73

        {"body": "0000000000", "index": 221, "age": 19, "id": "221", "name": 221}

        set 71 0 0 70

        {"body": "0000000000", "index": 71, "age": 71, "id": "71", "name": 71}

        set 553 0 0 73

        {"body": "0000000000", "index": 553, "age": 48, "id": "553", "name": 553}

        .
        bucket: file.csv, msgs transferred...
        : total | last | per sec
        batch : 1 | 1 | 16.6
        byte : 15 | 15 | 249.3
        msg : 3 | 3 | 49.9
        done

        Show
        Chisheng Chisheng Hong (Inactive) added a comment - Verified with build 2.0.2-762 on centos machine. Create file.csv: id,age,body,index,name 221,19,0000000000,221,221 71,71,0000000000,71,71 553,48,0000000000,553,553 [root@slv-0702 ~] # cd /opt/couchbase/bin/ [root@slv-0702 bin] # ./cbtransfer ~/file.csv stdout: set 221 0 0 73 {"body": "0000000000", "index": 221, "age": 19, "id": "221", "name": 221} set 71 0 0 70 {"body": "0000000000", "index": 71, "age": 71, "id": "71", "name": 71} set 553 0 0 73 {"body": "0000000000", "index": 553, "age": 48, "id": "553", "name": 553} . bucket: file.csv, msgs transferred... : total | last | per sec batch : 1 | 1 | 16.6 byte : 15 | 15 | 249.3 msg : 3 | 3 | 49.9 done

          People

          • Assignee:
            Chisheng Chisheng Hong (Inactive)
            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