Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-10854

cqlsh COPY FROM csv having line with more than one consecutive ',' delimiter is throwing 'list index out of range'

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Low
    • Resolution: Fixed
    • 2.1.13, 2.2.5, 3.0.3, 3.2
    • Legacy/Tools
    • None
    • cqlsh 5.0.1 | Cassandra 2.1.11.969 | DSE 4.8.3 | CQL spec 3.2.1

    • Low

    Description

      cqlsh COPY FROM csv having line with more than one consecutive ',' delimiter is throwing 'list index out of range'

      Steps to re-produce:

      CREATE TABLE tracks_by_album (
        album_title TEXT,
        album_year INT,
        performer TEXT STATIC,
        album_genre TEXT STATIC,
        track_number INT,
        track_title TEXT,
        PRIMARY KEY ((album_title, album_year), track_number)
      );
      

      Create a file: tracks_by_album.csv having following 2 lines :

      album,year,performer,genre,number,title
      a,2015,b c d,e f g,,
      
      cqlsh> COPY music.tracks_by_album
           (album_title, album_year, performer, album_genre, track_number, track_title)
      FROM '~/tracks_by_album.csv'
      WITH HEADER = 'true';
      
      Error :
      Starting copy of music.tracks_by_album with columns ['album_title', 'album_year', 'performer', 'album_genre', 'track_number', 'track_title'].
      
      list index out of range
      Aborting import at record #1. Previously inserted records are still present, and some records after that may be present as well.
      

      Attachments

        Activity

          People

            stefania Stefania Alborghetti
            puspendu.banerjee@gmail.com Puspendu Banerjee
            Stefania Alborghetti
            Paulo Motta
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: