我正在尝试查询cassandra表并尝试根据我的过滤器检索行数据的子集 但我得到的却是因为缺少EOF
@ repository -
@Query("select * from customer_request where product_id = ?0 and date_period = ?1 WHERE token(K) > token('offset') and token(K) < token('rowNumber')")
List<CustomerRequest> findByProduct(String productId, String datePeriod,
Integer offset, Integer rowNumber);
我在这里做错了什么? [尝试添加逻辑t获取行的子集。在第一次请求时,我将传递offset = 0,并且rowNumber = 10]
错误日志: -
com.datastax.driver.core.exceptions.SyntaxError:第1行:104缺少EOF,其中&#39; (...&#39; PI_NAME_CHANGE&#39;和receipt_period =&#39; 2016-02-06&#39; [where]令牌......) at com.datastax.driver.core.exceptions.SyntaxError.copy(SyntaxError.java:35) at com.datastax.driver.core.DefaultResultSetFuture.extractCauseFromExecutionException(DefaultResultSetFuture.java:269) at com.datastax.driver.core.DefaultResultSetFuture.getUninterruptibly(DefaultResultSetFuture.java:183) 在com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:52) 在org.springframework.cassandra.core.CqlTemplate $ 12.doInSession(CqlTemplate.java:503) 在org.springframework.cassandra.core.CqlTemplate $ 12.doInSession(CqlTemplate.java:494) 在org.springframework.cassandra.core.CqlTemplate.doExecute(CqlTemplate.java:471) 在org.springframework.cassandra.core.CqlTemplate.doExecute(CqlTemplate.java:494) 在org.springframework.cassandra.core.CqlTemplate.doExecute(CqlTemplate.java:483) 在org.springframework.cassandra.core.CqlTemplate.query(CqlTemplate.java:393) 在org.springframework.cassandra.core.CqlTemplate.query(CqlTemplate.java:420) 在org.springframework.cassandra.core.CqlTemplate.query(CqlTemplate.java:414) 在org.springframework.data.cassandra.repository.query.AbstractCassandraQuery.execute(AbstractCassandraQuery.java:122) at org.springframework.data.repository.core.support.RepositoryFactorySupport $ QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:454) at org.springframework.data.repository.core.support.RepositoryFactorySupport $ QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:432) 在org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) 在org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:61) 在org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) 在org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) 在org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) 在org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207) 在com.sun.proxy。$ Proxy74.findByProductIdAndReceiptPeriod(未知来源) at com.fmr.docgen.service.transaction.IncomingRequestServiceImpl.findCustomerRequest(IncomingRequestServiceImpl.java:96) 在com.fmr.docgen.controller.TransactionController.findCustomerRequest(TransactionController.java:262) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 在java.lang.reflect.Method.invoke(Method.java:497) 在org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215) 在org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132) 在org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104) 在org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:749) 在org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:689) 在org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83) 在org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:938) 在org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870) 在org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961) 在org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852) 在javax.servlet.http.HttpServlet.service(HttpServlet.java:624) 在org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837) 在javax.servlet.http.HttpServlet.service(HttpServlet.java:731) 在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) 在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) 在org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) 在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) 在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) 在org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) 在org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) 在org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505) 在org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) 在org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) 在org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:957) 在org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) 在org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423) 在org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1079) at org.apache.coyote.AbstractProtocol $ AbstractConnectionHandler.process(AbstractProtocol.java:620) at org.apache.tomcat.util.net.JIoEndpoint $ SocketProcessor.run(JIoEndpoint.java:316) 在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:617) 在org.apache.tomcat.util.threads.TaskThread $ WrappingRunnable.run(TaskThread.java:61)
答案 0 :(得分:1)
WHERE标记(K)
K 分区键列的名称?
令牌(&#39;偏移&#39)
不应该是令牌(?2)吗? 令牌(&#39; rowNumber&#39;)
的注释相同