<?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: NiFi SelectHiveQL in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/NiFi-SelectHiveQL/m-p/300314#M220142</link>
    <description>&lt;P&gt;Hi....yes you can use selecthiveql to run multiple hiveql statements. I would suggest putting the sql statements in a file / files and use list file and putfile processors before selecthiveql....Data is stored in flowfile content so you do not need to have a variable or anything. Finally you can use PutDatabaseRecord to write it to sql db.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ideal flow with no transformations :&amp;nbsp;&lt;BR /&gt;ListFile-&amp;gt;FetchFIle-&amp;gt;SelectHiveql-&amp;gt;putdatabaserecord&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
    <pubDate>Thu, 23 Jul 2020 09:30:58 GMT</pubDate>
    <dc:creator>SagarKanani</dc:creator>
    <dc:date>2020-07-23T09:30:58Z</dc:date>
    <item>
      <title>NiFi SelectHiveQL</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-SelectHiveQL/m-p/300061#M220017</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working on a project where I need to run multiple HiveQL statements in a sequence, then store the output for each of those HiveQL statement in a variable and then inserting those output variables in a SQL Database - using NiFi processors.&lt;/P&gt;&lt;P&gt;Also Can I use SelectHiveQL processor for running multiple Hive Queries in a sequence?&lt;/P&gt;&lt;P&gt;Ideally what should be the NiFi Flow for the above work?&lt;/P&gt;&lt;P&gt;Please let me know as early as possible.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jul 2020 01:15:12 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-SelectHiveQL/m-p/300061#M220017</guid>
      <dc:creator>EagerBeaver</dc:creator>
      <dc:date>2020-07-21T01:15:12Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi SelectHiveQL</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-SelectHiveQL/m-p/300314#M220142</link>
      <description>&lt;P&gt;Hi....yes you can use selecthiveql to run multiple hiveql statements. I would suggest putting the sql statements in a file / files and use list file and putfile processors before selecthiveql....Data is stored in flowfile content so you do not need to have a variable or anything. Finally you can use PutDatabaseRecord to write it to sql db.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ideal flow with no transformations :&amp;nbsp;&lt;BR /&gt;ListFile-&amp;gt;FetchFIle-&amp;gt;SelectHiveql-&amp;gt;putdatabaserecord&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2020 09:30:58 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-SelectHiveQL/m-p/300314#M220142</guid>
      <dc:creator>SagarKanani</dc:creator>
      <dc:date>2020-07-23T09:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi SelectHiveQL</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-SelectHiveQL/m-p/300341#M220167</link>
      <description>&lt;P&gt;Thank You Sagar for your inputs!&lt;BR /&gt;I am thinking on the following lines regarding the NiFi Flow:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;&lt;STRONG&gt;GetFile&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt; &lt;STRONG&gt;(To fetch input file from a specific directory) &amp;gt;&amp;gt;&lt;/STRONG&gt; &lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;PutHDFS&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt; &lt;STRONG&gt;(Write Input File data to HDFS) &amp;gt;&amp;gt;&lt;/STRONG&gt; &lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;PutHiveQL&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt; &lt;STRONG&gt;(Through "LOAD PATH INFILE..." load the data into Hive) &amp;gt;&amp;gt;&lt;/STRONG&gt;&lt;FONT color="#FF0000"&gt; &lt;EM&gt;&lt;STRONG&gt;SelectHiveQL&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt; &lt;STRONG&gt;(Execute the Semicolon delimited Hive QL's as Input &amp;amp; output in Avro format) &amp;gt;&amp;gt;&lt;/STRONG&gt;&amp;nbsp; &lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;ConvertAvroToJson&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt; &lt;STRONG&gt;(Direct Mapping from Avro field to JSON) &amp;gt;&amp;gt;&lt;/STRONG&gt; &lt;FONT color="#FF0000"&gt;&lt;EM&gt;&lt;STRONG&gt;SplitJson&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt; &lt;STRONG&gt;(Splits a JSON File into multiple separate&amp;nbsp;FlowFiles) &amp;gt;&amp;gt;&lt;/STRONG&gt; &lt;FONT color="#FF0000"&gt;&lt;EM&gt;&lt;STRONG&gt;EvaluateJSONPath&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt; &lt;STRONG&gt;(Evaluate JSON Path expressions against content of a FlowFile &amp;amp; to assign the results to FlowFile attributes) &amp;gt;&amp;gt;&lt;/STRONG&gt; &lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;ConvertJSONToSQL&lt;/FONT&gt;&lt;/STRONG&gt; &lt;/EM&gt;&lt;STRONG&gt;(Converts a JSON Formatted FlowFile into INSERT SQL Statement) &amp;gt;&amp;gt;&lt;/STRONG&gt; &lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;PutSQL&lt;/FONT&gt; &lt;/STRONG&gt;&lt;/EM&gt;&lt;STRONG&gt;(Execute the SQL INSERT statement to actually insert the data into the Destination SQL Database)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Please can you validate if the above flow will work ?&lt;/P&gt;&lt;P&gt;Also I have a another question as follows:&lt;/P&gt;&lt;P&gt;If I select multiple column values from a Hive Table in a HiveQL (e.g. "Select name, age, grade from student table" ) and retriving say 10 records for this query and further I want to insert these records / values into destination SQL Database table then what should the flow look like?&lt;/P&gt;&lt;P&gt;Can I use the flow I described above to solve this requirement.&lt;/P&gt;&lt;P&gt;Kindly share your thoughts / inputs.&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards in advance !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2020 17:01:51 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-SelectHiveQL/m-p/300341#M220167</guid>
      <dc:creator>EagerBeaver</dc:creator>
      <dc:date>2020-07-23T17:01:51Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi SelectHiveQL</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-SelectHiveQL/m-p/300371#M220178</link>
      <description>&lt;P&gt;You can use the flow you have in mind. But, i would suggest some optimization for your flow here:&amp;nbsp;&lt;BR /&gt;PutHDFS &amp;amp; PutHiveQL -&amp;gt; I suggest you create an external table on HDFS so you can skip the puthiveql&lt;BR /&gt;&lt;BR /&gt;Rest of your flow is to make SQL statements -&amp;gt; As i suggested before, you can look at PutDatabaseRecord since it has a recordreader(in your case AvroReader) and you can mention what type of sql query needs to be generated. This will help you with all the conversions and make the flow much much faster.&lt;BR /&gt;&lt;BR /&gt;The process to retrieve selection columns you can still use the same flow, just change the query you retrieve from getfile.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jul 2020 07:32:41 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-SelectHiveQL/m-p/300371#M220178</guid>
      <dc:creator>SagarKanani</dc:creator>
      <dc:date>2020-07-24T07:32:41Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi SelectHiveQL</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-SelectHiveQL/m-p/300497#M220263</link>
      <description>&lt;P&gt;Hi Sagar,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot again for your inputs. From performance optimization perspective your ideas worked perfectly. PutDatabaseRecord worked like a charm ! The solution is working now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank You.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jul 2020 16:50:00 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-SelectHiveQL/m-p/300497#M220263</guid>
      <dc:creator>EagerBeaver</dc:creator>
      <dc:date>2020-07-28T16:50:00Z</dc:date>
    </item>
  </channel>
</rss>

