<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: java.sql.SQLException: Error while processing statement : FAILED: Execution Error, return code 1 in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/java-sql-SQLException-Error-while-processing-statement/m-p/82490#M84956</link>
    <description>The Move part failed, it could be the user did not have write access to the directory where data reside in $targetPathStr?&lt;BR /&gt;&lt;BR /&gt;The LOAD DATA command will try to move the source to destination, so if user does not have write access, it will fail.&lt;BR /&gt;&lt;BR /&gt;The error you posted does not seen complete, there should be further "Caused by" part?</description>
    <pubDate>Sat, 17 Nov 2018 07:38:02 GMT</pubDate>
    <dc:creator>EricL</dc:creator>
    <dc:date>2018-11-17T07:38:02Z</dc:date>
    <item>
      <title>java.sql.SQLException: Error while processing statement : FAILED: Execution Error, return code 1 fro</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/java-sql-SQLException-Error-while-processing-statement/m-p/82361#M84955</link>
      <description>&lt;P&gt;I am using hive-jdbc to load data into table, and the code is:&lt;/P&gt;&lt;PRE&gt; String targetDb = "dbname";&lt;BR /&gt; Connection con = DriverManager.&lt;SPAN&gt;getConnection&lt;/SPAN&gt;(&lt;SPAN&gt;"jdbc:hive2://localhost:10000/" &lt;/SPAN&gt;+ targetDb);&lt;BR /&gt; Statement stmt = con.createStatement();&lt;BR /&gt;&lt;BR /&gt; String &lt;SPAN&gt;targetPathStr &lt;/SPAN&gt;= &lt;SPAN&gt;"/user/hive/warehouse/migration_warehouse/"&lt;/SPAN&gt;;&lt;BR /&gt; String targetTable = "tablename";&lt;BR /&gt; String sql = &lt;SPAN&gt;"load data inpath '" &lt;/SPAN&gt;+ &lt;SPAN&gt;targetPathStr &lt;/SPAN&gt;+ &lt;SPAN&gt;"' into table " &lt;/SPAN&gt;+ targetTable +&lt;BR /&gt; &lt;SPAN&gt;" PARTITION (part_date = '" &lt;/SPAN&gt;+ targetPartDate + &lt;SPAN&gt;"')"&lt;/SPAN&gt;;&lt;BR /&gt; System.&lt;SPAN&gt;out&lt;/SPAN&gt;.println(&lt;SPAN&gt;"Running: " &lt;/SPAN&gt;+ sql);&lt;BR /&gt; stmt.execute(sql);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;I got an Exception:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;java.sql.SQLException: Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.MoveTask
        at org.apache.hive.jdbc.HiveStatement.execute(HiveStatement.java:284)
        at com.sdg.dpd.tools.Service.HiveImportService.loadSql(HiveImportService.java:76)
        at com.sdg.dpd.tools.web.HiveImportController.setImportPara(HiveImportController.java:33)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        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:205)
        at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)
        at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97)
        at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)
        at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)
        at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967)
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
        at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
        at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
        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:52)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at org.springframework.boot.web.filter.ApplicationContextHeaderFilter.doFilterInternal(ApplicationContextHeaderFilter.java:55)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        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.trace.WebRequestTraceFilter.doFilterInternal(WebRequestTraceFilter.java:111)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        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:99)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        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.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:109)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        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.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        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:197)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        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.autoconfigure.MetricsFilter.doFilterInternal(MetricsFilter.java:106)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        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:198)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:496)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
        at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)
        at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
        at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)
        at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:745)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;More info:&lt;/P&gt;&lt;P&gt;1. My CDH version is Hadoop 2.6.0-cdh5.11.1, and I am sure that the path is correct.&lt;/P&gt;&lt;P&gt;2.This problem is similar to&amp;nbsp;&lt;A href="https://community.cloudera.com/t5/Batch-SQL-Apache-Hive/return-code-1-from-org-apache-hadoop-hive-ql-exec-MoveTask/m-p/62200" target="_blank"&gt;https://community.cloudera.com/t5/Batch-SQL-Apache-Hive/return-code-1-from-org-apache-hadoop-hive-ql-exec-MoveTask/m-p/62200&lt;/A&gt;, I have try the method (set source directory and target directory different).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 13:53:56 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/java-sql-SQLException-Error-while-processing-statement/m-p/82361#M84955</guid>
      <dc:creator>Zhichao</dc:creator>
      <dc:date>2022-09-16T13:53:56Z</dc:date>
    </item>
    <item>
      <title>Re: java.sql.SQLException: Error while processing statement : FAILED: Execution Error, return code 1</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/java-sql-SQLException-Error-while-processing-statement/m-p/82490#M84956</link>
      <description>The Move part failed, it could be the user did not have write access to the directory where data reside in $targetPathStr?&lt;BR /&gt;&lt;BR /&gt;The LOAD DATA command will try to move the source to destination, so if user does not have write access, it will fail.&lt;BR /&gt;&lt;BR /&gt;The error you posted does not seen complete, there should be further "Caused by" part?</description>
      <pubDate>Sat, 17 Nov 2018 07:38:02 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/java-sql-SQLException-Error-while-processing-statement/m-p/82490#M84956</guid>
      <dc:creator>EricL</dc:creator>
      <dc:date>2018-11-17T07:38:02Z</dc:date>
    </item>
    <item>
      <title>Re: java.sql.SQLException: Error while processing statement : FAILED: Execution Error, return code 1</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/java-sql-SQLException-Error-while-processing-statement/m-p/82549#M84957</link>
      <description>&lt;P&gt;Hi EricL,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Thank you for your useful reply. It is because the user didn't have right to write.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; As for the&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;"Caused by" part, I am using a springboot application and it don't remind any other infomation besides the log I posted above. When I use beeline and "! connect&amp;nbsp;jdbc:hive2://localhost:10000/&lt;/SPAN&gt;&lt;SPAN&gt;" command, it remind the the&amp;nbsp;write access things.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Nov 2018 06:50:34 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/java-sql-SQLException-Error-while-processing-statement/m-p/82549#M84957</guid>
      <dc:creator>Zhichao</dc:creator>
      <dc:date>2018-11-19T06:50:34Z</dc:date>
    </item>
  </channel>
</rss>

