Hardik Rana
Hardik Rana

Reputation: 476

IN CASSANDRA, not able to create table with precision and scale values

  1. I am not able to create table using decimal precision
  2. I am not able to create table using varchar length property

    create table tf (a decimal(9,8) primary key );

    create table tf (a varchar(9) primary key );

error :

com.datastax.driver.core.exceptions.SyntaxError:
  line 1:26 no viable alternative at input '(' (create table tf (a [decimal](...)

Upvotes: 1

Views: 305

Answers (1)

craigpastro
craigpastro

Reputation: 850

In Cassandra, you do not specify the precision of decimals or lengths of varchars. See https://docs.datastax.com/en/dse/5.1/cql/cql/cql_reference/refDataTypes.html.

You will also need to specify a primary key.

Upvotes: 2

Related Questions