title: Select in Cassandra with Java (datastax driver) by timestamp
body: <p>I am trying to do a <code>SELECT</code> in java into my Cassandra database. I am trying it with: </p>
  
  <pre><code>Statement statement = QueryBuilder.select()
         .all()
         .from(keySpaceName, tableName)                      
         .where((QueryBuilder.eq("asset", categoryPos)))
         .and(QueryBuilder.gte("date", "2006-06-08 00:00:00"))
         .limit(10)
         .allowFiltering()
         .enableTracing();
  </code></pre>
  
  <p>The CQL query (already working) is </p>
  
  <pre><code>SELECT * FROM pair_tick.price WHERE asset = 1 and date&gt;='2006-06-08 15:30:00' LIMIT 10;
  </code></pre>
  
  <p>When I am trying to execute this query, I get this error:</p>
  
  <pre><code>The RuntimeException could not be mapped to a response, re-throwing to the HTTP container
  com.datastax.driver.core.exceptions.InvalidQueryException: Expected 8 or 0 byte long for date (10)
   at com.datastax.driver.core.exceptions.InvalidQueryException.copy(InvalidQueryException.java:50)
   at com.datastax.driver.core.DriverThrowables.propagateCause(DriverThrowables.java:37)
   at com.datastax.driver.core.DefaultResultSetFuture.getUninterruptibly(DefaultResultSetFuture.java:244)
   at com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:55)
   at com.nexow.services.HistoricService.getHistoric(HistoricService.java:86)
   at com.nexow.HistoricController.getHistoric(HistoricController.java:38)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
   at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:185)
   at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
   at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:288)
   at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
  </code></pre>
  
  <p>How can avoid this error?
  Thank you in advance!</p>