igor.rmarinho_185445 avatar image
igor.rmarinho_185445 asked igor.rmarinho_185445 edited

Loading data with COPY FROM returns ParseError, "can't interpret '08' as a time"

On DSE 5.1.17 while loading data with COPY FROM in cqlsh, I am getting the following error:

$ cqlsh  with header=true AND CHUNKSIZE=100 AND NULL='null' " --connect-timeout 30
Reading options from the command line: {'header': 'true', 'null': 'null', 'chunksize': '1'}
Using 3 child process
Starting copy of shift_package_by_id_v2 with columns [company_id, bid_id, id, assignments, created_via_integration, display_name, external_id, original_ids, quantity, shifts, status].

<stdin>:1:Failed to import 1 rows: ParseError - Failed to parse [{day_of_week: 1, start_time_local: 08:30:00.000000000, duration: 'PT4H'}, {day_of_week: 2, start_time_local: 08:30:00.000000000, duration: 'PT4H'}, {day_of_week: 3, start_time_local: 08:30:00.000000000, duration: 'PT4H'}, {day_of_week: 4, start_time_local: 08:30:00.000000000, duration: 'PT4H'}, {day_of_week: 5, start_time_local: 08:30:00.000000000, duration: 'PT4H'}] : can't interpret '08' as a time,  given up without retries

It seems to be a bug, the first time I did the same COPY FROM and was ok now I getting this error.

The table schema is:

CREATE TABLE shift_package_by_id_v2 (
    company_id timeuuid,
    bid_id text,
    id text,
    assignments frozen<list<frozen<assignment>>>,
    created_via_integration boolean,
    display_name text,
    external_id text,
    original_ids frozen<list<text>>,
    quantity int,
    shifts frozen<list<frozen<shift>>>,
    status text,
    PRIMARY KEY ((company_id, bid_id), id)

Any thought?

10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Erick Ramirez avatar image Erick Ramirez ♦♦ commented ·

@igor.rmarinho_185445 Your table schema shows that you're using a user-defined type (UDT). Please post the definition of the shift UDT as well.

In addition, can you post a simplified schema and attach test CSV (1 or 2 rows is enough, not the whole data set) with steps to replicate the issue? Not looking for you to post your actual table schema, just a simplified one to make it easier to troubleshoot what's going on. Cheers!

1 Like 1 ·
igor.rmarinho_185445 avatar image igor.rmarinho_185445 Erick Ramirez ♦♦ commented ·

Hi Erick, I attached one row of the table as well


shift (
    day_of_week int,
    start_time_local time,
    duration text

cqlsh shift_package_by_id_v2 to 'shift_package_by_id_v2.csv' 
with header=true" --request-timeout 60 --connect-timeout 30 

cqlsh -e "COPY shift_package_by_id_v2 from 'shift_package_by_id_v2.csv' 
with header=true"

Thank you!

0 Likes 0 ·

0 Answers