<?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: Can Hadoop/Hive support data access over a REST API?  Any examples? in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Can-Hadoop-Hive-support-data-access-over-a-REST-API-Any/m-p/119772#M82550</link>
    <description>&lt;A rel="user" href="https://community.cloudera.com/users/2348/divakarreddya.html" nodeid="2348"&gt;@Divakar Annapureddy&lt;/A&gt;&lt;P&gt; yes via WebHCAT and WebHDFS&lt;/P&gt;&lt;PRE&gt;# this will execute a hive query and save result to hdfs file in your home directory called output
curl -s -d execute="select+*+from+sample_08;" \
       -d statusdir="output" \
       'http://localhost:50111/templeton/v1/hive?user.name=root'
       
# if you ls on the directory, it will have two files, stderr and stdout
hdfs dfs -ls output

# if the job succeeded, you can cat the stdout file and view the results
hdfs dfs -cat output/stdout       

WebHDFS

# list the output directory, notice the webhdfs port
curl -i "http://sandbox.hortonworks.com:50070/webhdfs/v1/user/root/output/?op=LISTSTATUS"

# read the output file
curl -i -L "http://sandbox.hortonworks.com:50070/webhdfs/v1/user/root/output/stdout?op=OPEN"

# rename a file, if you get dr. who error, add &amp;amp;user.name=root or any other user in the context
curl -i -X PUT "sandbox.hortonworks.com:50070/webhdfs/v1/user/root/output/stdout?op=RENAME&amp;amp;user.name=root&amp;amp;destination=/user/root/newname"

# read the output of the new file
curl -i -L "http://sandbox.hortonworks.com:50070/webhdfs/v1/user/root/newname?op=OPEN"&lt;/PRE&gt;</description>
    <pubDate>Thu, 23 Feb 2017 00:08:16 GMT</pubDate>
    <dc:creator>aervits</dc:creator>
    <dc:date>2017-02-23T00:08:16Z</dc:date>
  </channel>
</rss>

