0

I tried ALTER TABLE with a valid timeuuid column name -

cqlsh:dbase> ALTER TABLE jdata ADD 4f8eca60-1498-11e4-b6e6-ed7706c00c12 timeuuid;
Bad Request: line 1:24 no viable alternative at input '4f8eca60-1498-11e4-b6e6-ed7706c00c12'

So, I next tried with quotes and it worked -

cqlsh:dbase> ALTER TABLE jdata ADD "4f8eca60-1498-11e4-b6e6-ed7706c00c12" timeuuid;
cqlsh:dbase> 

But the table description now looks ugly with column name in quotes -

cqlsh:dbase> describe columnfamily jdata;

CREATE TABLE jdata (
  abc text,
  "4f8eca60-1498-11e4-b6e6-ed7706c00c12" timeuuid,
  xyz text,
  PRIMARY KEY ((abc), xyz)
) WITH
  bloom_filter_fp_chance=0.010000 AND
  blah blah;

So I need help with a ALTER command to create timeuuid column using CQL without quotes.

Bharadwaj
  • 1,361
  • 1
  • 9
  • 24

1 Answers1

0

The NAME of the column is a String by definition. So you can't put anything different from a String as column name.

create table invalidnames (2 text primary key, 5 int);
**Bad Request**: line 1:47 mismatched input '5' expecting ')'

while with strings works

create table validnames (two text primary key, five int);

The name of the column and the type of the column are not related in any way

HTH, Carlo

Carlo Bertuccini
  • 19,615
  • 3
  • 28
  • 39