1

I try to load with dsbulk a huge amount of data into a table wit a set using:

dsbulk load test.json \
-h cassandra-db -u ... -p ... -k mykeyspace \
-query "update mykeyspace.mytable set value_s = value_s +{:value_s} where value_1=:value_1 and value_2=:value_2"

I get the following error:

Operation LOAD_20220629-122020-418911 failed: Invalid set literal for value_s: bind variables are not supported inside collection literals

If I use

-query "update mykeyspace.mytable set value_s = value_s +{'mystaticvalue'} where value_1=:value_1 and value_2=:value_2"

the load is executed as expected. Anyone an idea how I can parameterize my set svalue?

Alternatively, I can create individual update statements, which I then execute via the cqlsh. Unfortunately the processing time is really slow. I have > 1 billion records to insert.

Erick Ramirez
  • 13,964
  • 1
  • 18
  • 23
dank
  • 21
  • 3

1 Answers1

0

Unfortunately, Cassandra does not allow the use of bind variables when updating CQL collections. As a result, you won't be able to do it with the Bulk Loader either. Cheers!

Erick Ramirez
  • 13,964
  • 1
  • 18
  • 23
  • This "UPDATE statements are required if the target table is a counter table, and the columns are updated with incremental operations (SET col1 = col1 + :fieldA) where :fieldA is a column in the input data." from https://docs.datastax.com/en/dsbulk/docs/reference/schemaOptions.html says something different. What do I misunderstand? Sure, the comment explicit talks about counter tables. However, I cant understand, why this feature shout not be able to use for normal tables. – dank Jun 30 '22 at 05:53
  • It's not a DSBulk issue -- Cassandra doesn't allow you to use bind variables on columns which are CQL collections. Cheers! – Erick Ramirez Jun 30 '22 at 07:07