<?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: How do I programmatically query atlas to return a list of hive tables in certain hive databases? in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/How-do-I-programmatically-query-atlas-to-return-a-list-of/m-p/205285#M167258</link>
    <description>&lt;P&gt;That's strange. Would it be possible to attach the log?&lt;/P&gt;&lt;P&gt;I am using data from the sandbox VM and I am able to run the DSL queries just fine.&lt;/P&gt;&lt;P&gt;I will get back to your question on &lt;EM&gt;basic query.&lt;/EM&gt; I need to confirm a few things with someone from my team.&lt;/P&gt;</description>
    <pubDate>Sun, 26 Nov 2017 05:47:17 GMT</pubDate>
    <dc:creator>amestry</dc:creator>
    <dc:date>2017-11-26T05:47:17Z</dc:date>
    <item>
      <title>How do I programmatically query atlas to return a list of hive tables in certain hive databases?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-do-I-programmatically-query-atlas-to-return-a-list-of/m-p/205282#M167255</link>
      <description>&lt;P&gt;I wish to programmatically query atlas to provide a list of hive tables that are in certain hive databases. I only want to see hive tables that are in databases that contain a certain string in their name.  In the hive_table atlas type, the db property is a reference to an entity of type hive_db, so I cannot use a simple where clause.&lt;/P&gt;&lt;P&gt;For example pretend I have many hive databases, some end with '_temp' some end with '_final'.  Each database may have several tables.  I want to generate a list of all hive tables in databases that end with '_final.' I would also like to exclude hive tables that have been deleted.&lt;/P&gt;&lt;P&gt;I have been experimenting with using the /api/atlas/discovery/search/dsl rest endpoint, but I have had no success. &lt;/P&gt;&lt;P&gt;There is documentation for the dsl at &lt;A href="http://atlas.apache.org/Search.html"&gt;http://atlas.apache.org/Search.html&lt;/A&gt;, but this documentation is very esoteric, and I cannot figure out how to use it.&lt;/P&gt;&lt;P&gt;Does anyone have examples of returning lists of entities in atlas bases on properties of referred-to entities?&lt;/P&gt;&lt;P&gt;Is there a more user-friendly or complete source of documentation for the atlas query dsl?&lt;/P&gt;&lt;P&gt;Also note that I do not wish to query the hive metastore directly, I wish to use atlas.&lt;/P&gt;&lt;P&gt;Thank you for any help!&lt;/P&gt;</description>
      <pubDate>Sat, 18 Nov 2017 00:19:12 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-do-I-programmatically-query-atlas-to-return-a-list-of/m-p/205282#M167255</guid>
      <dc:creator>david_miller</dc:creator>
      <dc:date>2017-11-18T00:19:12Z</dc:date>
    </item>
    <item>
      <title>Re: How do I programmatically query atlas to return a list of hive tables in certain hive databases?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-do-I-programmatically-query-atlas-to-return-a-list-of/m-p/205283#M167256</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/15332/davidmiller1.html" nodeid="15332"&gt;@David Miller&lt;/A&gt;&lt;P&gt;DSL query should help you with this. Each &lt;EM&gt;hive_table&lt;/EM&gt; has &lt;EM&gt;hive_db&lt;/EM&gt; name in its property. &lt;/P&gt;&lt;P&gt;This DSL query should help you: &lt;EM&gt;hive_table where (db.name like '*_final' or db.name like '*_temp')&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;About filtering deleted entities in DSL, there isn't a way to do it yet.&lt;/P&gt;&lt;P&gt;We are in process of improving DSL. As for the documentation, I agree, it needs improvement. There is no firm ETA on this yet. Given the current state, my suggestion would be to use basic query as much as possible. &lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Sat, 18 Nov 2017 03:57:46 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-do-I-programmatically-query-atlas-to-return-a-list-of/m-p/205283#M167256</guid>
      <dc:creator>amestry</dc:creator>
      <dc:date>2017-11-18T03:57:46Z</dc:date>
    </item>
    <item>
      <title>Re: How do I programmatically query atlas to return a list of hive tables in certain hive databases?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-do-I-programmatically-query-atlas-to-return-a-list-of/m-p/205284#M167257</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/14489/amestry.html" nodeid="14489"&gt;@Ashutosh Mestry&lt;/A&gt; &lt;/P&gt;&lt;P&gt;Thanks Ashuthosh,&lt;/P&gt;&lt;P&gt;when I run the query: "hive_table where db.name like '*_final'" I get an error in the webui:&lt;/P&gt;&lt;PRE&gt;Gremlin script execution failed: L:{def r=(([]) as Set);def f1={GremlinPipeline x-&amp;gt;x.as('a0').out('__hive_table.db').as('__res') [0..&amp;lt;25].select(['a0', '__res']).fill(r)};f1(g.V().has('__typeName','hive_table'));f1(g.V().has('__superTypeNames','hive_table'));r._().as('__tmp').transform({((Row)it).getColumn('a0')}).as('a0').back('__tmp').transform({((Row)it).getColumn('__res')}).as('__res').filter({it.'Asset.name'.matches('.*_final')}).back('a0') [0..&amp;lt;25].toList()}&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;We are running atlas 0.8.0.2,  perhaps like clauses are unsupported on our version?  I can use an equal sign and successfully retrieve tables in a certain database.&lt;/P&gt;&lt;P&gt;do you know of a way to get the same information with a basic query?&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2017 02:30:32 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-do-I-programmatically-query-atlas-to-return-a-list-of/m-p/205284#M167257</guid>
      <dc:creator>david_miller</dc:creator>
      <dc:date>2017-11-21T02:30:32Z</dc:date>
    </item>
    <item>
      <title>Re: How do I programmatically query atlas to return a list of hive tables in certain hive databases?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-do-I-programmatically-query-atlas-to-return-a-list-of/m-p/205285#M167258</link>
      <description>&lt;P&gt;That's strange. Would it be possible to attach the log?&lt;/P&gt;&lt;P&gt;I am using data from the sandbox VM and I am able to run the DSL queries just fine.&lt;/P&gt;&lt;P&gt;I will get back to your question on &lt;EM&gt;basic query.&lt;/EM&gt; I need to confirm a few things with someone from my team.&lt;/P&gt;</description>
      <pubDate>Sun, 26 Nov 2017 05:47:17 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-do-I-programmatically-query-atlas-to-return-a-list-of/m-p/205285#M167258</guid>
      <dc:creator>amestry</dc:creator>
      <dc:date>2017-11-26T05:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: How do I programmatically query atlas to return a list of hive tables in certain hive databases?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-do-I-programmatically-query-atlas-to-return-a-list-of/m-p/205286#M167259</link>
      <description>&lt;P&gt;I will accept the answer because it seems this might be an issue on my side.  Thank you&lt;/P&gt;&lt;P&gt;I will open up a ticket with hortonworks support if further troubleshooting is needed after I take a look at the logs. thanks again.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Nov 2017 00:27:42 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-do-I-programmatically-query-atlas-to-return-a-list-of/m-p/205286#M167259</guid>
      <dc:creator>david_miller</dc:creator>
      <dc:date>2017-11-28T00:27:42Z</dc:date>
    </item>
  </channel>
</rss>

