kokoluciferus avatar image
kokoluciferus asked Erick Ramirez answered

Invalid string constant error when inserting into UDT column using python driver

I am doing the Normalization exercise on DS220 using python driver from local PC.

I created UDT type as shown:


I also created videos_by_actor table as shown:


I am using python to extract csv data into cassandra videos_by_actor table as shown:


The following error is being generated:


The error reads: Invalid string constant. with the encoding column in the csv file covered in parentheses. However, when I printed the encoding column out from csv, it is in curly braces which is normal for the UDT I am creating.

Is this a bug in cassandra python driver? I have ensured to follow the documentation in properly creating encoding UDT type with type frozen<video_encoding>. Is there anything I am missing here?

Finally, If I wanna use Astra for learning purposes, Is there any resource I can use to get started. More importantly, I will like to document my every step in Astra from table creation to insertion and querying just like I would using a python script.

I will appreciate assistance in debugging this issue!

user-defined typeds220
1621242681884.png (16.3 KiB)
1621242769732.png (30.6 KiB)
1621243080370.png (92.3 KiB)
1621243180064.png (79.8 KiB)
1 comment
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 ·

I'd like to make a friendly request and ask that you paste the outputs in text instead of screenshots. A lot of the engineers who answer questions here respond during their free time on their mobile devices and screenshots are very difficult to read.

It would make it easier to help you if you paste the text instead. Cheers!

0 Likes 0 ·

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered

[Closed due to no user response]

10 |1000

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