n3o
n3o

Reputation: 89

Syntax error at position 7: unexpected "*" for `Select * FROM mytable;`

I write because I've a problem with cassandra; after have imported the data from pentaho as show here http://wiki.pentaho.com/display/BAD/Write+Data+To+Cassandra

when I try to execute the query Select * FROM mytable;

cassandre give me an error message Syntax error at position 7: unexpected "*" for Select * FROM mytable;.

and don't show the results of query.Why? what does it mean that error?

Upvotes: 2

Views: 2077

Answers (1)

Lyuben Todorov
Lyuben Todorov

Reputation: 14173

the step that i make are the follow:

  1. start cassandra cli utility;
  2. use keyspace added from pentaho; (use tpc_h);
  3. select to show the data added (Select * FROM mytable;)

The cassandra-cli does not support any CQL version. It has its own syntax which you can find on datastax's website.

Just for clarity, in cql to select everything from a table (aka column-family) called mytable stored in a keyspace called myks you would use:

SELECT * FROM myks.mytable;

The equivalent in cassandra-cli would *roughly be :

USE myks;
LIST mytable;


***** In the cli you are limited to selecting the first 100 rows. If this is a problem you can use the limit clause to specify how many rows you want:

LIST mytable limit 10000;

As for this:

in cassandra i have read that isn't possible make the join such as sql, ther isn't a shortcut to issue this disadvantage

There is a reason why joins don't exist in Cassandra, its for the same reason that C* isn't ACID compliant, it sacrifices that functionality for it's amazing performance and scalability, so it's not a disadvantage, you just need to re-think your model if you need joins. Also take a look at this question / answer.

Upvotes: 2

Related Questions