Skip to content

Copy from fails to import blob columns #13

@MichiganL

Description

@MichiganL

Hi,

ycqlsh fails to import blob columns using the copy from command (yugabyte version 2.14.3.1-b1).
I get the following error message:
Failed to import 1 rows: ParseError - Failed to parse 0xff : global name 'BlobType' is not defined, given up without retries Failed to process 1 rows; failed rows written to import_ks_test.err

Steps to reproduce the issue:

docker run --rm -d --name yugabyte yugabytedb/yugabyte:2.14.3.1-b1 bin/yugabyted start --daemon=false

docker exec -it yugabyte /bin/bash

ycqlsh

create keyspace ks;
-- create minimal table with a blob column
create table ks.test(key text primary key, value blob);
insert into ks.test(key, value) values('k1', 0xff);
copy ks.test to 'test.dump';

-- copying the table from the dump fails
copy ks.test from 'test.dump';

Failed to import 1 rows: ParseError - Failed to parse 0xff : global name 'BlobType' is not defined,  given up without retries
Failed to process 1 rows; failed rows written to import_ks_test.err

Adding the import "from cqlshlib.formatting import BlobType" to cqlsh/copyutil.py fixed the issue for me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions