2

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?

n3o
  • 69
  • 1
  • 2
  • 11
  • 1
    Can you show some Codes? – ErickBest Jun 24 '13 at 08:21
  • 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;) pentaho data import works fine and no give error. these are the only line of cose that I would try to run – n3o Jun 24 '13 at 08:56
  • I have tried with cassandra cql shell and works, but I don't understand why don't function with cli client...moreover, if i want calculate the time of query execution, how I did make? what command I must use? – n3o Jun 24 '13 at 09:18

1 Answers1

2

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.

Community
  • 1
  • 1
Lyuben Todorov
  • 13,987
  • 5
  • 50
  • 69
  • ok, thanks for answer me, now I have other question to make you: 1)in cli is not possible select all the rows instead first 100 only? 2)is possible in cql see the time of execution query? in cassandra i have read that isn't possible make the join such as sql, ther isn't a shortcut to issue this disadvantage? – n3o Jun 24 '13 at 10:20
  • ok, thanks for answer me, now I have other question to make you: 1)in cli is not possible select all the rows instead first 100 only? 2)in cassandra i have read that isn't possible make the join such as sql, ther isn't a shortcut to issue this disadvantage? 3)is possible in cql and/or in cli see the time of execution query? I must make a compare between query esecution time of a dbms sql and query esecution time of a column dbms with query and data generated from tpc-h benchmark here http://www.tpc.org/tpch/ – n3o Jun 24 '13 at 10:28
  • ok thanks, you don't know nothing about how find the time of execution of a query? – n3o Jun 24 '13 at 11:22
  • @user2515445 Not from the cli / cqlsh but there are a variety of benchmarking tools that come with datastax community edition or you could use the `cassandra-stress` tool located in `/pathtoC*/tools/bin/` – Lyuben Todorov Jun 24 '13 at 11:24
  • can you help me to find one tool available? – n3o Jun 24 '13 at 12:34
  • when i try to start cassandra-stress.bat I have the following message: – n3o Jun 24 '13 at 12:56
  • Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/cassandra/stress/Stress Caused by: java.lang.ClassNotFoundException: org.apache.cassandra.stress.Stress at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) – n3o Jun 24 '13 at 12:57
  • Could not find the main class: org.apache.cassandra.stress.Stress. Program will exit. Moreover, if I want to use cassandra-stress after start.bat I must use --enable-cql Select * from supplier; as is being written here? http://www.datastax.com/docs/1.2/references/stress – n3o Jun 24 '13 at 12:58
  • Lyuben Todorov can you help me? – n3o Jun 24 '13 at 16:11
  • @user2515445 It's a dependency failiure. You need to work out what JARs you need and add the correct ones to your class path. That can be very tricky. Also maybe you've not set JAVA_HOME ? – Lyuben Todorov Jun 24 '13 at 17:36
  • JAVA_HOME is set to C:\Program Files (x86)\DataStax Community\jre\ in computer ->advanced settings->variable environment...if you have cassandra on your pc can share stress on mediafire? I don't understand because isn't installed on thar directory... with cassandra stress I can run any query or only insert of 1000000 of row such here http://www.datastax.com/docs/1.2/references/stress? the query that I want measure are select... – n3o Jun 24 '13 at 18:29