<?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: Webhdfs REST API - Search for a filename or directory in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Webhdfs-REST-API-Search-for-a-filename-or-directory/m-p/200007#M62432</link>
    <description>&lt;P&gt;I have updated my question with an example. Please let me know if you still can't understand my question.&lt;/P&gt;</description>
    <pubDate>Thu, 08 Jun 2017 01:03:52 GMT</pubDate>
    <dc:creator>vsubramanian</dc:creator>
    <dc:date>2017-06-08T01:03:52Z</dc:date>
    <item>
      <title>Webhdfs REST API - Search for a filename or directory</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Webhdfs-REST-API-Search-for-a-filename-or-directory/m-p/200004#M62429</link>
      <description>&lt;P&gt;How do I search for a filename or directory name recursively in a given path in WebHDFS?&lt;/P&gt;&lt;P&gt;For example: If I search for "hive" from the root directory "/", I expect a response with directory names or file names matching "hive" under "/" such as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;/hdp/apps/2.6.0.1-89/hive
/hdp/apps/2.6.0.1-89/hive/hive.tar.gz&lt;/PRE&gt;</description>
      <pubDate>Wed, 07 Jun 2017 05:12:23 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Webhdfs-REST-API-Search-for-a-filename-or-directory/m-p/200004#M62429</guid>
      <dc:creator>vsubramanian</dc:creator>
      <dc:date>2017-06-07T05:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: Webhdfs REST API - Search for a filename or directory</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Webhdfs-REST-API-Search-for-a-filename-or-directory/m-p/200005#M62430</link>
      <description>&lt;P&gt;Can you describe this question more clear?I can't understand this.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2017 15:48:44 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Webhdfs-REST-API-Search-for-a-filename-or-directory/m-p/200005#M62430</guid>
      <dc:creator>it_duanxiong</dc:creator>
      <dc:date>2017-06-07T15:48:44Z</dc:date>
    </item>
    <item>
      <title>Re: Webhdfs REST API - Search for a filename or directory</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Webhdfs-REST-API-Search-for-a-filename-or-directory/m-p/200006#M62431</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/11659/vsubramanian.html" nodeid="11659"&gt;@vsubramanian&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Did you try the&lt;STRONG&gt; "recursive=true"&lt;/STRONG&gt; option as following:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Example:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;curl -X GET "http://erie1.example.com:50070/webhdfs/v1/user/admin?op=LISTSTATUS&amp;amp;recursive=true" &lt;/PRE&gt;&lt;P&gt;It will search recursively the "/user/admin" and will list all the files/directories details. Then we can use "grep" to find the particular File or Directory from the output JSON response.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2017 16:02:43 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Webhdfs-REST-API-Search-for-a-filename-or-directory/m-p/200006#M62431</guid>
      <dc:creator>jsensharma</dc:creator>
      <dc:date>2017-06-07T16:02:43Z</dc:date>
    </item>
    <item>
      <title>Re: Webhdfs REST API - Search for a filename or directory</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Webhdfs-REST-API-Search-for-a-filename-or-directory/m-p/200007#M62432</link>
      <description>&lt;P&gt;I have updated my question with an example. Please let me know if you still can't understand my question.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2017 01:03:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Webhdfs-REST-API-Search-for-a-filename-or-directory/m-p/200007#M62432</guid>
      <dc:creator>vsubramanian</dc:creator>
      <dc:date>2017-06-08T01:03:52Z</dc:date>
    </item>
    <item>
      <title>Re: Webhdfs REST API - Search for a filename or directory</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Webhdfs-REST-API-Search-for-a-filename-or-directory/m-p/200008#M62433</link>
      <description>&lt;P&gt;Hi &lt;A rel="user" href="https://community.cloudera.com/users/3418/jsensharma.html" nodeid="3418"&gt;@Jay SenSharma&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;I tried the "recursive=true" parameter, but it doesn't give any different response. It is identical with the response from API without "recursive=true" and my question was to find a file or directory within a given directory. I have updated my question to give you more clarity. Hope it helps. Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2017 01:06:15 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Webhdfs-REST-API-Search-for-a-filename-or-directory/m-p/200008#M62433</guid>
      <dc:creator>vsubramanian</dc:creator>
      <dc:date>2017-06-08T01:06:15Z</dc:date>
    </item>
    <item>
      <title>Re: Webhdfs REST API - Search for a filename or directory</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Webhdfs-REST-API-Search-for-a-filename-or-directory/m-p/200009#M62434</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/11659/vsubramanian.html" nodeid="11659"&gt;@vsubramanian&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;I'm afraid this is currently not possible. The only WebHDFS REST api that implements "recursive" query parameter is delete. So if you use recursive with delete, that would work. The ListStatus API &lt;A target="_blank" href="https://github.com/hortonworks/hadoop/blob/HDP-2.6.0.4/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/fs/http/client/HttpFSFileSystem.java#L678"&gt;here&lt;/A&gt; has not implemented any recursive logic.&lt;/P&gt;&lt;P&gt;For your use-case, you'll manually need to call curl with op=LISTSTATUS multiple times for each directory after parsing the output. Similar to what "ls -R" &lt;A target="_blank" href="https://github.com/hortonworks/hadoop/blob/HDP-2.6.0.4/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/Command.java#L370"&gt;Shell command&lt;/A&gt; does currently. &lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2017 05:37:09 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Webhdfs-REST-API-Search-for-a-filename-or-directory/m-p/200009#M62434</guid>
      <dc:creator>VR46</dc:creator>
      <dc:date>2017-06-08T05:37:09Z</dc:date>
    </item>
  </channel>
</rss>

