<?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: return code 1 from org.apache.hadoop.hive.ql.exec.MoveTask in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/return-code-1-from-org-apache-hadoop-hive-ql-exec-MoveTask/m-p/62165#M71494</link>
    <description>&lt;P&gt;The problem is running the LOAD query with OVERWRITE option and having the source data file (location where the CSV file is placed) being in the same directory as the table is located in.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Unable to move 
&lt;STRONG&gt;source&lt;/STRONG&gt; 
hdfs://quickstart.cloudera:8020/user/data/stocks/stocks.csv to
&lt;STRONG&gt;destination&lt;/STRONG&gt; 
hdfs://quickstart.cloudera:8020/user/data/stocks/stocks.csv&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The solution would be to move the source data file into a different hdfs directory and load the data into the table from there or alternatively, if the table is newly created you can leave the overwrite part out of the query.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;Note:&lt;/U&gt; In general, if your data is already there in table's location, you don't need to load data again, you can simply define the table using the external&amp;nbsp;keyword, which leaves the files in place, but creates the table definition in the hive metastore.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;PRE&gt;$ cat /tmp/sample.txt
1 a
2 b
3 c

$ hdfs dfs -mkdir  /data1
$ hdfs dfs -chown hive:hive /data1
$ hdfs dfs -cp /tmp/sample.txt /data1

$ hive
hive&amp;gt; CREATE EXTERNAL TABLE weather6 (col1 INT, col2 STRING)
    &amp;gt; COMMENT 'Employee details'
    &amp;gt; ROW FORMAT DELIMITED FIELDS TERMINATED BY ' '
    &amp;gt; STORED AS TEXTFILE
    &amp;gt; LOCATION '/data1';

hive&amp;gt; select * from weather6;
OK
1	a
2	b
3	c&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 24 Nov 2017 08:10:30 GMT</pubDate>
    <dc:creator>AutoIN</dc:creator>
    <dc:date>2017-11-24T08:10:30Z</dc:date>
    <item>
      <title>return code 1 from org.apache.hadoop.hive.ql.exec.MoveTask</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/return-code-1-from-org-apache-hadoop-hive-ql-exec-MoveTask/m-p/62020#M71493</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hive is complaning when I try to import a csv into a table I created called "stocks." The table is set up as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;hive&amp;gt; describe stocks;&lt;BR /&gt;OK&lt;BR /&gt;exchng string&lt;BR /&gt;symbol string&lt;BR /&gt;ymd string&lt;BR /&gt;price_open float&lt;BR /&gt;price_high float&lt;BR /&gt;price_low float&lt;BR /&gt;price_close float&lt;BR /&gt;volume int&lt;BR /&gt;price_adj_close float&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I try to load data from a csv as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;hive&amp;gt; load data inpath '/user/data/stocks/stocks.csv'&lt;BR /&gt;&amp;gt; overwrite into table human_resources.stocks;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I then get the following error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Loading data to table human_resources.stocks&lt;BR /&gt;Failed with exception Unable to move source hdfs://quickstart.cloudera:8020/user/data/stocks/stocks.csv to destination hdfs://quickstart.cloudera:8020/user/data/stocks/stocks.csv&lt;BR /&gt;FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.MoveTask&lt;BR /&gt;hive&amp;gt; describe table stocks;&lt;BR /&gt;FAILED: SemanticException [Error 10001]: Table not found table&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't think that the file is corrupted. You can see the file in the link below and it's just a normal csv file - in fact, it was provided by the author of the Hive book I'm working through.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.vaughn-s.net/hadoop/stocks.csv" target="_blank"&gt;http://www.vaughn-s.net/hadoop/stocks.csv&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The image file I'm using is cloudera-quickstart-vm-5.10.0-0-vmware, I'm not sure if I need to update or not.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 12:32:40 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/return-code-1-from-org-apache-hadoop-hive-ql-exec-MoveTask/m-p/62020#M71493</guid>
      <dc:creator>Nayland</dc:creator>
      <dc:date>2022-09-16T12:32:40Z</dc:date>
    </item>
    <item>
      <title>Re: return code 1 from org.apache.hadoop.hive.ql.exec.MoveTask</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/return-code-1-from-org-apache-hadoop-hive-ql-exec-MoveTask/m-p/62165#M71494</link>
      <description>&lt;P&gt;The problem is running the LOAD query with OVERWRITE option and having the source data file (location where the CSV file is placed) being in the same directory as the table is located in.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Unable to move 
&lt;STRONG&gt;source&lt;/STRONG&gt; 
hdfs://quickstart.cloudera:8020/user/data/stocks/stocks.csv to
&lt;STRONG&gt;destination&lt;/STRONG&gt; 
hdfs://quickstart.cloudera:8020/user/data/stocks/stocks.csv&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The solution would be to move the source data file into a different hdfs directory and load the data into the table from there or alternatively, if the table is newly created you can leave the overwrite part out of the query.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;Note:&lt;/U&gt; In general, if your data is already there in table's location, you don't need to load data again, you can simply define the table using the external&amp;nbsp;keyword, which leaves the files in place, but creates the table definition in the hive metastore.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;PRE&gt;$ cat /tmp/sample.txt
1 a
2 b
3 c

$ hdfs dfs -mkdir  /data1
$ hdfs dfs -chown hive:hive /data1
$ hdfs dfs -cp /tmp/sample.txt /data1

$ hive
hive&amp;gt; CREATE EXTERNAL TABLE weather6 (col1 INT, col2 STRING)
    &amp;gt; COMMENT 'Employee details'
    &amp;gt; ROW FORMAT DELIMITED FIELDS TERMINATED BY ' '
    &amp;gt; STORED AS TEXTFILE
    &amp;gt; LOCATION '/data1';

hive&amp;gt; select * from weather6;
OK
1	a
2	b
3	c&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Nov 2017 08:10:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/return-code-1-from-org-apache-hadoop-hive-ql-exec-MoveTask/m-p/62165#M71494</guid>
      <dc:creator>AutoIN</dc:creator>
      <dc:date>2017-11-24T08:10:30Z</dc:date>
    </item>
    <item>
      <title>Re: return code 1 from org.apache.hadoop.hive.ql.exec.MoveTask</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/return-code-1-from-org-apache-hadoop-hive-ql-exec-MoveTask/m-p/62200#M71495</link>
      <description>Woops, I had completely overlooked that. Thanks!</description>
      <pubDate>Sun, 26 Nov 2017 00:20:16 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/return-code-1-from-org-apache-hadoop-hive-ql-exec-MoveTask/m-p/62200#M71495</guid>
      <dc:creator>Nayland</dc:creator>
      <dc:date>2017-11-26T00:20:16Z</dc:date>
    </item>
    <item>
      <title>Re: return code 1 from org.apache.hadoop.hive.ql.exec.MoveTask</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/return-code-1-from-org-apache-hadoop-hive-ql-exec-MoveTask/m-p/91496#M71496</link>
      <description>&lt;P&gt;Hi ,&lt;BR /&gt;While am creating a table I'm getting the following error:&lt;/P&gt;&lt;PRE&gt;hive&amp;gt; CREATE TABLE ETL.FeedControl
    &amp;gt; (
    &amp;gt; feedName STRING,
    &amp;gt; sourceSystem STRING,
    &amp;gt; fileName STRING,
    &amp;gt; fileFormat STRING,
    &amp;gt; landingPath STRING,
    &amp;gt; rejectThreshold INT,
    &amp;gt; addBusDateCol STRING,
    &amp;gt; header_trailer_Flag STRING,
    &amp;gt; rawZonePath STRING,
    &amp;gt; outputTableName STRING,
    &amp;gt; sourceTableName STRING,
    &amp;gt; dataSourceType STRING
    &amp;gt; )
    &amp;gt; row format serde 'org.apache.hadoop.hive.serde2.OpenCSVSerde'
    &amp;gt; with serdeproperties (
    &amp;gt; "separatorChar" = ",",
    &amp;gt; "quoteChar"     = "'",
    &amp;gt; "escapeChar"    = "\\"
    &amp;gt; )
    &amp;gt; stored as textfile;
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException(message:Got exception: java.net.ConnectException Call From localhost/127.0.0.1 to caaspoc64:8020 failed on connection exception: java.net.ConnectException: Connection refused; For more details see:  http://wiki.apache.org/hadoop/ConnectionRefused)&lt;/PRE&gt;&lt;P&gt;Can you please explain what the error means and how to resolve it?&lt;BR /&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2019 04:36:05 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/return-code-1-from-org-apache-hadoop-hive-ql-exec-MoveTask/m-p/91496#M71496</guid>
      <dc:creator>Bhagya</dc:creator>
      <dc:date>2019-06-12T04:36:05Z</dc:date>
    </item>
  </channel>
</rss>

