记录一次presto sql执行报错 Error executing query的解决办法

在执行presto sql 时报错截图如下:

记录一次presto sql执行报错 Error executing query的解决办法_第1张图片

 查看后台执行报错日志

java.sql.SQLException: Error executing query
at com.facebook.presto.jdbc.PrestoStatement.internalExecute(PrestoStatement.java:307)
at com.facebook.presto.jdbc.PrestoStatement.execute(PrestoStatement.java:230)
at com.facebook.presto.jdbc.PrestoPreparedStatement.close(PrestoPreparedStatement.java:95)
at com.alibaba.druid.util.JdbcUtils.close(JdbcUtils.java:106)
at com.alibaba.druid.pool.DruidAbstractDataSource.closePreapredStatement(DruidAbstractDataSource.java:2011)
at com.alibaba.druid.pool.PreparedStatementPool.closeRemovedStatement(PreparedStatementPool.java:175)
at com.alibaba.druid.pool.PreparedStatementPool.remove(PreparedStatementPool.java:80)
at com.alibaba.druid.pool.DruidPooledConnection.closePoolableStatement(DruidPooledConnection.java:186)
at com.alibaba.druid.pool.DruidPooledPreparedStatement.close(DruidPooledPreparedStatement.java:201)
at com.alibaba.druid.util.JdbcUtils.close(JdbcUtils.java:106)
at com.alibaba.druid.pool.DruidConnectionHolder.reset(DruidConnectionHolder.java:321)
at com.alibaba.druid.pool.DruidDataSource.recycle(DruidDataSource.java:1910)
at com.alibaba.druid.pool.DruidPooledConnection.recycle(DruidPooledConnection.java:325)
at com.alibaba.druid.pool.DruidPooledConnection.close(DruidPooledConnection.java:270)
at com.anjiplus.template.gaea.business.modules.datasource.service.impl.DataSourceServiceImpl.executeRelationalDb(DataSourceServiceImpl.java:311)
at com.anjiplus.template.gaea.business.modules.datasource.service.impl.DataSourceServiceImpl.execute(DataSourceServiceImpl.java:141)
at com.anjiplus.template.gaea.business.modules.datasource.service.impl.DataSourceServiceImpl$$FastClassBySpringCGLIB$$5ad1cfae.invoke()
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:687)
at com.anjiplus.template.gaea.business.modules.datasource.service.impl.DataSourceServiceImpl$$EnhancerBySpringCGLIB$$39b94fc7.execute()
at com.anjiplus.template.gaea.business.modules.dataset.service.impl.DataSetServiceImpl.testTransform(DataSetServiceImpl.java:345)
at com.anjiplus.template.gaea.business.modules.dataset.service.impl.DataSetServiceImpl$$FastClassBySpringCGLIB$$839a8ea6.invoke()
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:687)
at com.anjiplus.template.gaea.business.modules.dataset.service.impl.DataSetServiceImpl$$EnhancerBySpringCGLIB$$df26a7af.testTransform()
at com.anjiplus.template.gaea.business.modules.dataset.controller.DataSetController.testTransform(DataSetController.java:161)
at sun.reflect.GeneratedMethodAccessor729.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:878)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:792)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:652)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at com.github.xiaoymin.knife4j.spring.filter.ProductionSecurityFilter.doFilter(ProductionSecurityFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at com.github.xiaoymin.knife4j.spring.filter.SecurityBasicAuthFilter.doFilter(SecurityBasicAuthFilter.java:90)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at com.anji.plus.gaea.GaeaAutoConfiguration$WebGaeaAutoConfiguration.lambda$registrationBean$0(GaeaAutoConfiguration.java:188)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at com.anjiplus.template.gaea.business.filter.TokenFilter.doFilter(TokenFilter.java:158)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at com.anjiplus.template.gaea.business.filter.UrlDecodeFilter.doFilter(UrlDecodeFilter.java:44)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:93)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:747)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:374)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1590)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.RuntimeException: Error starting query at http://10.3.62.102:8743/v1/statement returned an invalid response: JsonResponse{statusCode=431, statusMessage=Request Header Fields Too Large, headers={connection=[close], content-length=[74], content-type=[text/html;charset=iso-8859-1]}, hasValue=false} [Error: 

Bad Message 431

reason: Request Header Fields Too Large
] at com.facebook.presto.jdbc.internal.client.StatementClientV1.requestFailedException(StatementClientV1.java:497) at com.facebook.presto.jdbc.internal.client.StatementClientV1.(StatementClientV1.java:138) at com.facebook.presto.jdbc.internal.client.StatementClientFactory.newStatementClient(StatementClientFactory.java:24) at com.facebook.presto.jdbc.QueryExecutor.startQuery(QueryExecutor.java:46) at com.facebook.presto.jdbc.PrestoConnection.startQuery(PrestoConnection.java:774) at com.facebook.presto.jdbc.PrestoStatement.internalExecute(PrestoStatement.java:263) ... 94 common frames omitted

解决办法:

在presto 数据源配置的 config.properties 配置文件中  添加 如下配置:

http-server.max-response-header-size=5MB
http-server.max-request-header-size=5MB

然后重启presto ,问题解决。亲测有效!!

你可能感兴趣的:(presto,大数据)