cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From S├ębastien Pierre <sebastien.pie...@gmail.com>
Subject Cassandra with LongType columns
Date Thu, 21 Jan 2010 20:56:59 GMT
Hi !

So I moved forward using Cassandra for logging HTTP traffic, and I come up
with the following schema:

  <Keyspaces>
    <Keyspace Name="AdKit">
      <ColumnFamily CompareWith="TimeUUIDType" Name="Logs"/>
      <ColumnFamily CompareWith="LongType"     Name="Campaigns"/>
    </Keyspace>
  </Keyspaces>

Next thing, I started cassandra-cli and wanted to populate the db with some
data:

set AdKit.Campaigns['campaigns']*['0']* = '{<JSON-encoded thing>}'

however, I get the following error

Exception null
InvalidRequestException(why:A long is exactly 8 bytes)
    at
org.apache.cassandra.service.Cassandra$insert_result.read(Cassandra.java:7804)
    at
org.apache.cassandra.service.Cassandra$Client.recv_insert(Cassandra.java:391)
    at
org.apache.cassandra.service.Cassandra$Client.insert(Cassandra.java:364)
    at org.apache.cassandra.cli.CliClient.executeSet(CliClient.java:205)
    at org.apache.cassandra.cli.CliClient.executeCLIStmt(CliClient.java:60)
    at org.apache.cassandra.cli.CliMain.processCLIStmt(CliMain.java:103)
    at org.apache.cassandra.cli.CliMain.main(CliMain.java:143)

but when I try this:

set AdKit.Campaigns['campaigns']*[0]* = '{<JSON-encoded thing>}'

I get another error

line 1:33 mismatched input '0' expecting StringLiteral
Exception null
InvalidRequestException(why:column name must not be empty)
    at
org.apache.cassandra.service.Cassandra$insert_result.read(Cassandra.java:7804)
    at
org.apache.cassandra.service.Cassandra$Client.recv_insert(Cassandra.java:391)
    at
org.apache.cassandra.service.Cassandra$Client.insert(Cassandra.java:364)
    at org.apache.cassandra.cli.CliClient.executeSet(CliClient.java:205)
    at org.apache.cassandra.cli.CliClient.executeCLIStmt(CliClient.java:60)
    at org.apache.cassandra.cli.CliMain.processCLIStmt(CliMain.java:103)
    at org.apache.cassandra.cli.CliMain.main(CliMain.java:143)

I wasn't able to find example with Long or Time keys... could somebody
enlighten me ?

 -- S├ębastien

Mime
View raw message