我正在尝试在java中将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();
写入我的Cassandra数据库。我正在尝试:
SELECT * FROM pair_tick.price WHERE asset = 1 and date>='2006-06-08 15:30:00' LIMIT 10;
CQL查询(已经工作)是
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)
当我尝试执行此查询时,出现此错误:
function clean
{
Get-ChildItem -path C:\testFolderCheck 'obj' -Recurse -force | Remove-Item -force -Recurse
Get-ChildItem -path C:\testFolderCheck 'bin' -Recurse -force | Remove-Item -force -Recurse
}
clean
如何避免此错误? 提前谢谢!