<?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: Unable to load data to hive table in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-load-data-to-hive-table/m-p/221129#M84425</link>
    <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/97233/sivasai2006.html" nodeid="97233"&gt;@Sivakumar Mahalingam&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Additionally there are few syntax errors in your Hive Query.&lt;/P&gt;&lt;P&gt;Also the "&lt;STRONG&gt;date&lt;/STRONG&gt;" is a reserved keyword so you should not use it. Or you will have to apply hive additional params to tell hive to allow using reserved keywords like following:&lt;/P&gt;&lt;PRE&gt;set hive.support.sql11.reserved.keywords=false;&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Create Directory on HDFS:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;# su - hdfs -c "hdfs dfs -mkdir -p /user/hive/data/weather"
# su - hdfs -c "hdfs dfs -chown -R hive:hadoop /user/hive/data/weather"
# su - hdfs -c "hdfs dfs -chmod -R 777 /user/hive/data/weather"&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;NOTE: &lt;/STRONG&gt;Above is just dummy directory creation instructions ... you should change the permission based on your requirement.&lt;BR /&gt;&lt;BR /&gt;The try creating the table as following:&lt;/P&gt;&lt;PRE&gt;CREATE TABLE weather ( wban int, date1 String, precip int) 
ROW FORMAT DELIMITED 
FIELDS TERMINATED BY ',' 
LOCATION '/user/hive/data/weather';&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;</description>
    <pubDate>Thu, 18 Oct 2018 09:22:53 GMT</pubDate>
    <dc:creator>jsensharma</dc:creator>
    <dc:date>2018-10-18T09:22:53Z</dc:date>
    <item>
      <title>Unable to load data to hive table</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-load-data-to-hive-table/m-p/221127#M84423</link>
      <description>&lt;P&gt;CREATE TABLE weather (wban INT, date STRING, precip INT)&lt;BR /&gt;ROW FORMAT DELIMITED&lt;BR /&gt;FIELDS TERMINATED BY ','&lt;BR /&gt;LOCATION '/etc/hive/data/weather';&lt;/P&gt;&lt;P&gt;Getting error while creating the table,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException(message:hdfs://quickstart.cloudera:8020/etc/hive/data/weather is not a directory or unable to create one)&lt;/P&gt;</description>
      <pubDate>Thu, 18 Oct 2018 08:57:40 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-load-data-to-hive-table/m-p/221127#M84423</guid>
      <dc:creator>sivasai2006</dc:creator>
      <dc:date>2018-10-18T08:57:40Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to load data to hive table</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-load-data-to-hive-table/m-p/221128#M84424</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/97233/sivasai2006.html" nodeid="97233"&gt;@Sivakumar Mahalingam&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The PATH is not valid.&lt;/P&gt;&lt;P&gt;It is expecting the path to be on HDFS so please verify if the PATH exist on hdfs?&lt;/P&gt;&lt;PRE&gt;# su - hdfs -c "hdfs dfs -ls /etc/hive/data/weather"&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Oct 2018 09:01:48 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-load-data-to-hive-table/m-p/221128#M84424</guid>
      <dc:creator>jsensharma</dc:creator>
      <dc:date>2018-10-18T09:01:48Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to load data to hive table</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-load-data-to-hive-table/m-p/221129#M84425</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/97233/sivasai2006.html" nodeid="97233"&gt;@Sivakumar Mahalingam&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Additionally there are few syntax errors in your Hive Query.&lt;/P&gt;&lt;P&gt;Also the "&lt;STRONG&gt;date&lt;/STRONG&gt;" is a reserved keyword so you should not use it. Or you will have to apply hive additional params to tell hive to allow using reserved keywords like following:&lt;/P&gt;&lt;PRE&gt;set hive.support.sql11.reserved.keywords=false;&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Create Directory on HDFS:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;# su - hdfs -c "hdfs dfs -mkdir -p /user/hive/data/weather"
# su - hdfs -c "hdfs dfs -chown -R hive:hadoop /user/hive/data/weather"
# su - hdfs -c "hdfs dfs -chmod -R 777 /user/hive/data/weather"&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;NOTE: &lt;/STRONG&gt;Above is just dummy directory creation instructions ... you should change the permission based on your requirement.&lt;BR /&gt;&lt;BR /&gt;The try creating the table as following:&lt;/P&gt;&lt;PRE&gt;CREATE TABLE weather ( wban int, date1 String, precip int) 
ROW FORMAT DELIMITED 
FIELDS TERMINATED BY ',' 
LOCATION '/user/hive/data/weather';&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Oct 2018 09:22:53 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-load-data-to-hive-table/m-p/221129#M84425</guid>
      <dc:creator>jsensharma</dc:creator>
      <dc:date>2018-10-18T09:22:53Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to load data to hive table</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-load-data-to-hive-table/m-p/221130#M84426</link>
      <description>&lt;P&gt;bash-4.1$ hdfs dfs -ls /etc/hive/data/weather&lt;BR /&gt;-rw-r--r--  1 cloudera supergroup  220 2018-10-17 13:03 /etc/hive/data/weather&lt;/P&gt;</description>
      <pubDate>Thu, 18 Oct 2018 09:32:15 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-load-data-to-hive-table/m-p/221130#M84426</guid>
      <dc:creator>sivasai2006</dc:creator>
      <dc:date>2018-10-18T09:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to load data to hive table</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-load-data-to-hive-table/m-p/221131#M84427</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/97233/sivasai2006.html" nodeid="97233"&gt;@Sivakumar Mahalingam&lt;BR /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Notice "-rw-r--r--"  which indicate that the supplied path is a File &lt;STRONG&gt;(Not a Directory)&lt;/STRONG&gt; Thats the reason you got an error earlier like:&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;hdfs://quickstart.cloudera:8020/etc/hive/data/weather is not a directory or unable to create one&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;You have the mentioned PATH as a "file"  it should be directory. Try running the following command and then &lt;/P&gt;&lt;PRE&gt;# hdfs dfs -ls /etc/hive/data&lt;/PRE&gt;&lt;P&gt;.&lt;BR /&gt;&lt;A rel="user" href="https://community.cloudera.com/users/97233/sivasai2006.html" nodeid="97233"&gt;&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Thu, 18 Oct 2018 09:37:59 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-load-data-to-hive-table/m-p/221131#M84427</guid>
      <dc:creator>jsensharma</dc:creator>
      <dc:date>2018-10-18T09:37:59Z</dc:date>
    </item>
  </channel>
</rss>

