<?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 Can I write a script to perform a phoenix query and write the output to a file? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Can-I-write-a-script-to-perform-a-phoenix-query-and-write/m-p/148109#M32469</link>
    <description>&lt;P&gt;I know how to accomplish this with Java, but I'm wondering if there is a simpler way using some sort of CLI client and piping.&lt;/P&gt;&lt;P&gt;I just want to run a set query, and write the results to a text file.&lt;/P&gt;&lt;P&gt;And I want to be able to execute this from a shell script.&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;</description>
    <pubDate>Tue, 21 Jun 2016 00:20:12 GMT</pubDate>
    <dc:creator>zack_riesland</dc:creator>
    <dc:date>2016-06-21T00:20:12Z</dc:date>
    <item>
      <title>Can I write a script to perform a phoenix query and write the output to a file?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Can-I-write-a-script-to-perform-a-phoenix-query-and-write/m-p/148109#M32469</link>
      <description>&lt;P&gt;I know how to accomplish this with Java, but I'm wondering if there is a simpler way using some sort of CLI client and piping.&lt;/P&gt;&lt;P&gt;I just want to run a set query, and write the results to a text file.&lt;/P&gt;&lt;P&gt;And I want to be able to execute this from a shell script.&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jun 2016 00:20:12 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Can-I-write-a-script-to-perform-a-phoenix-query-and-write/m-p/148109#M32469</guid>
      <dc:creator>zack_riesland</dc:creator>
      <dc:date>2016-06-21T00:20:12Z</dc:date>
    </item>
    <item>
      <title>Re: Can I write a script to perform a phoenix query and write the output to a file?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Can-I-write-a-script-to-perform-a-phoenix-query-and-write/m-p/148110#M32470</link>
      <description>&lt;P&gt;bash&amp;gt; cat /path/to/my_script.sql &lt;/P&gt;&lt;P&gt;!outputformat csv&lt;/P&gt;&lt;P&gt;select count(*) from system.catalog&lt;/P&gt;&lt;P&gt;/usr/hdp/current/phoenix-client/bin/sqlline.py zk_host:2181:/hbase-unsecure /path/to/my_script.sql &amp;gt; out.txt&lt;/P&gt;&lt;P&gt;bash&amp;gt; cat out.txt&lt;/P&gt;&lt;P&gt;83/83 (100%) Done&lt;/P&gt;&lt;P&gt;'COUNT(1)'&lt;/P&gt;&lt;P&gt;'87'&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jun 2016 00:33:22 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Can-I-write-a-script-to-perform-a-phoenix-query-and-write/m-p/148110#M32470</guid>
      <dc:creator>rgelhausen</dc:creator>
      <dc:date>2016-06-21T00:33:22Z</dc:date>
    </item>
    <item>
      <title>Re: Can I write a script to perform a phoenix query and write the output to a file?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Can-I-write-a-script-to-perform-a-phoenix-query-and-write/m-p/148111#M32471</link>
      <description>&lt;P&gt;Perfect! Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jun 2016 01:10:35 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Can-I-write-a-script-to-perform-a-phoenix-query-and-write/m-p/148111#M32471</guid>
      <dc:creator>zack_riesland</dc:creator>
      <dc:date>2016-06-21T01:10:35Z</dc:date>
    </item>
    <item>
      <title>Re: Can I write a script to perform a phoenix query and write the output to a file?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Can-I-write-a-script-to-perform-a-phoenix-query-and-write/m-p/148112#M32472</link>
      <description>&lt;P&gt;In your example, do you know how I would filter everything but the count?&lt;/P&gt;&lt;P&gt;So instead of &lt;/P&gt;&lt;P style="margin-left: 20px;"&gt;83/83 (100%) Done&lt;/P&gt;&lt;P style="margin-left: 20px;"&gt;'COUNT(1)'&lt;/P&gt;&lt;P style="margin-left: 20px;"&gt;'87'&lt;/P&gt;&lt;P&gt;I would only print&lt;/P&gt;&lt;P style="margin-left: 20px;"&gt;87&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jun 2016 01:32:46 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Can-I-write-a-script-to-perform-a-phoenix-query-and-write/m-p/148112#M32472</guid>
      <dc:creator>zack_riesland</dc:creator>
      <dc:date>2016-06-21T01:32:46Z</dc:date>
    </item>
    <item>
      <title>Re: Can I write a script to perform a phoenix query and write the output to a file?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Can-I-write-a-script-to-perform-a-phoenix-query-and-write/m-p/148113#M32473</link>
      <description>&lt;P&gt;Unfortunately I don't. I suggest an inverted grep on the file like: grep -v '(100%) Done' out.txt&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jun 2016 01:57:59 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Can-I-write-a-script-to-perform-a-phoenix-query-and-write/m-p/148113#M32473</guid>
      <dc:creator>rgelhausen</dc:creator>
      <dc:date>2016-06-21T01:57:59Z</dc:date>
    </item>
    <item>
      <title>Re: Can I write a script to perform a phoenix query and write the output to a file?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Can-I-write-a-script-to-perform-a-phoenix-query-and-write/m-p/148114#M32474</link>
      <description>&lt;P&gt;Can we check if below job failed.&lt;/P&gt;&lt;P&gt;/usr/hdp/current/phoenix-client/bin/&lt;A href="http://sqlline.py/"&gt;sqlline.py&lt;/A&gt; zk_host:2181:/hbase-unsecure /path/to/my_script.sql &amp;gt; out.txt&lt;/P&gt;&lt;P&gt;Even though it fails I am getting $? as zero. Is there any way to check the same.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Oct 2017 15:10:36 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Can-I-write-a-script-to-perform-a-phoenix-query-and-write/m-p/148114#M32474</guid>
      <dc:creator>sunilsahub4u</dc:creator>
      <dc:date>2017-10-16T15:10:36Z</dc:date>
    </item>
  </channel>
</rss>

