<?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 How can i generate some report with the queries that has been executed on impala? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-i-generate-some-report-with-the-queries-that-has/m-p/46048#M42963</link>
    <description>&lt;P&gt;&lt;BR /&gt;Hi ,&lt;/P&gt;&lt;P&gt;How can i generate some report with the queries that has been executed on impala?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On Cloudera Manager, Impala---queries--export we can see only one day, and on the web page CM drops the following message:&lt;/P&gt;&lt;P&gt;"More queries match your filter than can be displayed. Try narrowing your search filter or decreasing the time range over which you are searching"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically , i need some file like csv, with the users and queries executed on impala from one month ago (or more)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your support&lt;/P&gt;&lt;P&gt;Esteban&lt;/P&gt;</description>
    <pubDate>Fri, 16 Sep 2022 10:43:39 GMT</pubDate>
    <dc:creator>egonzalpe</dc:creator>
    <dc:date>2022-09-16T10:43:39Z</dc:date>
    <item>
      <title>How can i generate some report with the queries that has been executed on impala?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-i-generate-some-report-with-the-queries-that-has/m-p/46048#M42963</link>
      <description>&lt;P&gt;&lt;BR /&gt;Hi ,&lt;/P&gt;&lt;P&gt;How can i generate some report with the queries that has been executed on impala?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On Cloudera Manager, Impala---queries--export we can see only one day, and on the web page CM drops the following message:&lt;/P&gt;&lt;P&gt;"More queries match your filter than can be displayed. Try narrowing your search filter or decreasing the time range over which you are searching"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically , i need some file like csv, with the users and queries executed on impala from one month ago (or more)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your support&lt;/P&gt;&lt;P&gt;Esteban&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 10:43:39 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-i-generate-some-report-with-the-queries-that-has/m-p/46048#M42963</guid>
      <dc:creator>egonzalpe</dc:creator>
      <dc:date>2022-09-16T10:43:39Z</dc:date>
    </item>
    <item>
      <title>Re: How can i generate some report with the queries that has been executed on impala?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-i-generate-some-report-with-the-queries-that-has/m-p/47112#M42964</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;SPAN&gt;Esteban,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My problem was that I couldn't get more than 100 records for export due to the CM webpage limitation with the same message you showed: &lt;SPAN&gt;"More queries match your filter than can be displayed. Try narrowing your search filter or decreasing the time range over which you are searching"&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is an answer I got from Cloudera how to get more rows and for a bigger period using API.&lt;/P&gt;&lt;P&gt;The way I managed with it after having the output is a bit customized but pretty quick for me as I'm an Oracle admin. I created an external table in Oracle some database with the output file and then just took out the sql text from there or any other info I needed.&lt;/P&gt;&lt;P&gt;Here is the answer from Cloudera:&lt;/P&gt;&lt;P&gt;&amp;lt;&amp;lt;&lt;BR /&gt;Here is a little bit instruction on extracting Impala out of CM:&lt;/P&gt;&lt;P&gt;1. click support dropdown in top right&lt;BR /&gt;2. click api documentation&lt;BR /&gt;3. find the endpoint "impalaQueries" click this link&lt;/P&gt;&lt;P&gt;Use the endpoint address it specifics in the docs, add the filter information to the URL and set the limit parameter to a value greater than 100 (the default).&lt;/P&gt;&lt;P&gt;If it takes a very long time to dump this data you can also page through it using the 'offset' parameter, or you could use 'from' and 'to' with a small sliding window to grab for the time period you're interested in.&lt;/P&gt;&lt;P&gt;You can use the URL that CM directs you to when doing your export and simple add a "&amp;amp;limit=200" to the end of it to get more than 100&lt;BR /&gt;&amp;gt;&amp;gt;&lt;/P&gt;&lt;P&gt;It worked for me using:&lt;/P&gt;&lt;P&gt;...api/v7/clusters/cluster/services/impala/impalaQueries?from=2016-11-07T18%3A50%3A21.758Z&amp;amp;to=2016-11-07T19%3A20%3A21.758Z&amp;amp;limit=200&amp;amp;filter=&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;## Parsing the output using Oracle external table:&lt;BR /&gt;##################################################&lt;BR /&gt;drop table admin_task.impala;&lt;/P&gt;&lt;P&gt;create table admin_task.impala&lt;BR /&gt;(&lt;BR /&gt;column_text varchar2(4000)&lt;BR /&gt;)&lt;BR /&gt;organization external&lt;BR /&gt;(&lt;BR /&gt;type oracle_loader&lt;BR /&gt;default directory data_pump_dir&lt;BR /&gt;access parameters (&lt;BR /&gt;records delimited by newline&lt;BR /&gt;fields terminated by '#'&lt;BR /&gt;missing field values are null&lt;BR /&gt;)&lt;BR /&gt;location ('impala.txt')&lt;BR /&gt;);&lt;/P&gt;&lt;P&gt;alter table admin_task.impala reject limit unlimited;&lt;/P&gt;&lt;P&gt;create table admin_task.impala_text&lt;BR /&gt;(text varchar2(4000));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;create or replace procedure admin_task.generate_impala_sql as&lt;/P&gt;&lt;P&gt;cursor c is&lt;BR /&gt;select * from admin_task.impala;&lt;/P&gt;&lt;P&gt;v_count1 number(10);&lt;BR /&gt;v_count2 number(10);&lt;BR /&gt;v_query varchar2(4000);&lt;/P&gt;&lt;P&gt;begin&lt;BR /&gt;for r in c loop&lt;BR /&gt;if r.column_text like '%"statement"%' then&lt;BR /&gt;v_count1 := instr(upper(r.column_text),'SELECT', 1, 1);&lt;BR /&gt;v_count2 := instr(r.column_text,'",', 1, 1) - v_count1;&lt;BR /&gt;v_query := substr(r.column_text, v_count1, v_count2) || ';' || chr(13) || chr(10);&lt;BR /&gt;insert into admin_task.impala_text values(v_query);&lt;BR /&gt;dbms_output.put_line(r.column_text || ' / ' || v_count1 || ' / ' || v_count2 || ' / ' || v_query);&lt;BR /&gt;-- dbms_output.put_line(v_query);&lt;BR /&gt;end if;&lt;BR /&gt;end loop;&lt;BR /&gt;commit;&lt;BR /&gt;end;&lt;BR /&gt;/&lt;/P&gt;&lt;P&gt;show errors procedure admin_task.generate_impala_sql;&lt;/P&gt;&lt;P&gt;set serveroutput on&lt;BR /&gt;set serveroutput on size 5000000&lt;BR /&gt;set line 10000&lt;BR /&gt;exec admin_task.generate_impala_sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;nicusan&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2016 19:41:10 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-i-generate-some-report-with-the-queries-that-has/m-p/47112#M42964</guid>
      <dc:creator>nicusan</dc:creator>
      <dc:date>2016-11-07T19:41:10Z</dc:date>
    </item>
  </channel>
</rss>

