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

PicklingError: Can't pickle <class 'cqlshlib.copyutil.video_encoding'>: attribute lookup video_encoding on cqlshlib.copyutil failed

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Triage Needed
    • Normal
    • Resolution: Unresolved
    • None
    • CQL/Interpreter
    • None
    • All
    • None

    Description

      This seems to be a different issue than Cassandra-14982 :

      $ cqlsh --version
      cqlsh 6.8.0

      Following Datastax Academy course DS220, in the Denormalization exercise. I received 

      PicklingError: Can't pickle <class 'cqlshlib.copyutil.video_encoding'>: attribute lookup video_encoding on cqlshlib.copyutil failed

      on the COPY command into the following table:

      CREATE TYPE IF NOT EXISTS video_encoding (
      encoding TEXT,
      height INT,
      width INT,
      bit_rates SET<TEXT>
      );
      
      CREATE TABLE videos_by_actor (
      actor text,
      added_date timestamp,
      video_id timeuuid,
      character_name text,
      description text,
      encoding frozen<video_encoding>,
      tags set<text>,
      title text,
      user_id uuid,
      PRIMARY KEY ( (actor), added_date, video_id )
      ) WITH CLUSTERING ORDER BY ( added_date desc, video_id asc);
      
      COPY videos_by_actor(actor,added_date,video_id,character_name,description,encoding,tags,title,user_id) FROM 'videos_by_actor.csv' WITH HEADER = true

      Now, as it turns out my PRIMARY KEY was non-unique (noted when I failed to load as many records as were in the file), and when I changed to:

       PRIMARY KEY ((actor), added_date, video_id, character_name)

      the command worked. BUT the following options also worked (though they both dropped records):

       WITH HEADER = true AND MINBATCHSIZE=1 AND MAXBATCHSIZE=1 AND PAGESIZE=10;

      and

       WITH HEADER = true AND NUMPROCESSES=1;

      So this seems to be a problem of multi-threading and user-defined TYPEs?

      I'll note that I'm running inside a WSL2 Docker Container based on ubuntu:bionic:
      $ uname -a
      Linux node-1 4.19.104-microsoft-standard #1 SMP Wed Feb 19 06:37:35 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

      Attachments

        1. videos_by_actor.csv.gz
          1.75 MB
          Phil Miesle

        Activity

          People

            Unassigned Unassigned
            mieslep Phil Miesle
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: