<?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 Replace text: how to replace &amp;quot;ORDER BY asc&amp;quot; by &amp;quot;ORDER BY newid() asc&amp;quot; in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Replace-text-how-to-replace-quot-ORDER-BY-asc-quot-by/m-p/204107#M76977</link>
    <description>&lt;A rel="user" href="https://community.cloudera.com/users/1962/aryankunal.html" nodeid="1962" target="_blank"&gt;@Kunal Gaikwad&lt;/A&gt;&lt;P&gt;Use replace text processor with &lt;STRONG&gt;Literal Replace&lt;/STRONG&gt; as Replacement strategy, so that you can &lt;STRONG&gt;search for&lt;/STRONG&gt; &lt;STRONG&gt;&lt;EM&gt;ORDER BY asc&lt;/EM&gt;&lt;/STRONG&gt; in your flowfile content and &lt;STRONG&gt;replace with&lt;/STRONG&gt; &lt;STRONG&gt;&lt;EM&gt;ORDER BY newid() asc&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;U&gt;Replace Text Configs:-&lt;BR /&gt;&lt;/U&gt;&lt;/EM&gt;&lt;/STRONG&gt;Search Value&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;ORDER BY asc&lt;/PRE&gt;
&lt;/DIV&gt;Replacement Value
&lt;DIV&gt;&lt;PRE&gt;ORDER BY newid() asc&lt;/PRE&gt;
&lt;/DIV&gt;Character Set
&lt;DIV&gt;&lt;PRE&gt;UTF-8&lt;/PRE&gt;
&lt;/DIV&gt;Maximum Buffer Size
&lt;DIV&gt;&lt;PRE&gt;1 MB&lt;/PRE&gt;
&lt;/DIV&gt;Replacement Strategy
&lt;DIV&gt;&lt;PRE&gt;Literal Replace&lt;/PRE&gt;
&lt;/DIV&gt;Evaluation Mode
&lt;DIV&gt;&lt;PRE&gt;Entire text&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="67561-replacetext.png" style="width: 1697px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17234i93020E043FAC5DD9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="67561-replacetext.png" alt="67561-replacetext.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Input Flowfile content:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;SELECT * FROM (SELECT TOP 50000 *, ROW_NUMBER() OVER(ORDER BY  asc) rnum FROM ABCD.dbo.DEFG) A WHERE rnum &amp;gt; 0 AND rnum &amp;lt;= 50000&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;OutputFlowfile Content:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;SELECT * FROM (SELECT TOP 50000 *, ROW_NUMBER() OVER(ORDER BY newid() asc) rnum FROM ABCD.dbo.DEFG) A WHERE rnum &amp;gt; 0 AND rnum &amp;lt;= 50000&lt;/PRE&gt;In output flowfile content we have replace &lt;STRONG&gt;ORDER BY  asc&lt;/STRONG&gt; with &lt;STRONG&gt;ORDER BY newid() asc&lt;/STRONG&gt;&lt;P&gt;&lt;STRONG&gt;.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;If the Answer helped to resolve your issue, &lt;STRONG&gt;Click on Accept button below to accept the answer&lt;/STRONG&gt;, That would be great help to Community users to find solution quickly for these kind of issues.&lt;/P&gt;</description>
    <pubDate>Sun, 18 Aug 2019 05:06:46 GMT</pubDate>
    <dc:creator>Shu_ashu</dc:creator>
    <dc:date>2019-08-18T05:06:46Z</dc:date>
    <item>
      <title>NiFi Replace text: how to replace "ORDER BY asc" by "ORDER BY newid() asc"</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Replace-text-how-to-replace-quot-ORDER-BY-asc-quot-by/m-p/204106#M76976</link>
      <description>&lt;P&gt;I am ingesting data from MS SQL Server 2016 to hive using Nifi and the worflow is as follows :&lt;/P&gt;&lt;P&gt;GenerateTableFetch-&amp;gt;ExtractText-&amp;gt;ExecuteSQL-&amp;gt;UpdateAttribute-&amp;gt;ConvertAvroToORC-&amp;gt;PutHDFS-&amp;gt;ReplaceText-&amp;gt;PutHiveQL&lt;/P&gt;&lt;P&gt;but using MS SQL 2012+ database type gives error in GenerateTableFetch. I got solution from this &lt;A href="https://stackoverflow.com/questions/49262675/issue-with-generate-table-fetch-sql-server-2016"&gt;question&lt;/A&gt; on stackoverflow. &lt;/P&gt;&lt;P&gt;My generatetablefetch generates:&lt;/P&gt;&lt;PRE&gt;SELECT * FROM (SELECT TOP 50000 *, ROW_NUMBER() OVER(ORDER BY  asc) rnum FROM ABCD.dbo.DEFG) A WHERE rnum &amp;gt; 0 AND rnum &amp;lt;= 50000&lt;/PRE&gt;&lt;P&gt;How to configure ReplaceText processor so as to replace "ORDER BY asc" by "ORDER BY newid() asc" so that I can input that to my existing workflow to the ExecuteSQL processor?&lt;/P&gt;</description>
      <pubDate>Sun, 08 Apr 2018 19:34:06 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Replace-text-how-to-replace-quot-ORDER-BY-asc-quot-by/m-p/204106#M76976</guid>
      <dc:creator>Kunal.Gaikwad</dc:creator>
      <dc:date>2018-04-08T19:34:06Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi Replace text: how to replace "ORDER BY asc" by "ORDER BY newid() asc"</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Replace-text-how-to-replace-quot-ORDER-BY-asc-quot-by/m-p/204107#M76977</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/1962/aryankunal.html" nodeid="1962" target="_blank"&gt;@Kunal Gaikwad&lt;/A&gt;&lt;P&gt;Use replace text processor with &lt;STRONG&gt;Literal Replace&lt;/STRONG&gt; as Replacement strategy, so that you can &lt;STRONG&gt;search for&lt;/STRONG&gt; &lt;STRONG&gt;&lt;EM&gt;ORDER BY asc&lt;/EM&gt;&lt;/STRONG&gt; in your flowfile content and &lt;STRONG&gt;replace with&lt;/STRONG&gt; &lt;STRONG&gt;&lt;EM&gt;ORDER BY newid() asc&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;U&gt;Replace Text Configs:-&lt;BR /&gt;&lt;/U&gt;&lt;/EM&gt;&lt;/STRONG&gt;Search Value&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;ORDER BY asc&lt;/PRE&gt;
&lt;/DIV&gt;Replacement Value
&lt;DIV&gt;&lt;PRE&gt;ORDER BY newid() asc&lt;/PRE&gt;
&lt;/DIV&gt;Character Set
&lt;DIV&gt;&lt;PRE&gt;UTF-8&lt;/PRE&gt;
&lt;/DIV&gt;Maximum Buffer Size
&lt;DIV&gt;&lt;PRE&gt;1 MB&lt;/PRE&gt;
&lt;/DIV&gt;Replacement Strategy
&lt;DIV&gt;&lt;PRE&gt;Literal Replace&lt;/PRE&gt;
&lt;/DIV&gt;Evaluation Mode
&lt;DIV&gt;&lt;PRE&gt;Entire text&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="67561-replacetext.png" style="width: 1697px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17234i93020E043FAC5DD9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="67561-replacetext.png" alt="67561-replacetext.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Input Flowfile content:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;SELECT * FROM (SELECT TOP 50000 *, ROW_NUMBER() OVER(ORDER BY  asc) rnum FROM ABCD.dbo.DEFG) A WHERE rnum &amp;gt; 0 AND rnum &amp;lt;= 50000&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;OutputFlowfile Content:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;SELECT * FROM (SELECT TOP 50000 *, ROW_NUMBER() OVER(ORDER BY newid() asc) rnum FROM ABCD.dbo.DEFG) A WHERE rnum &amp;gt; 0 AND rnum &amp;lt;= 50000&lt;/PRE&gt;In output flowfile content we have replace &lt;STRONG&gt;ORDER BY  asc&lt;/STRONG&gt; with &lt;STRONG&gt;ORDER BY newid() asc&lt;/STRONG&gt;&lt;P&gt;&lt;STRONG&gt;.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;If the Answer helped to resolve your issue, &lt;STRONG&gt;Click on Accept button below to accept the answer&lt;/STRONG&gt;, That would be great help to Community users to find solution quickly for these kind of issues.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 05:06:46 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Replace-text-how-to-replace-quot-ORDER-BY-asc-quot-by/m-p/204107#M76977</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2019-08-18T05:06:46Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi Replace text: how to replace "ORDER BY asc" by "ORDER BY newid() asc"</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Replace-text-how-to-replace-quot-ORDER-BY-asc-quot-by/m-p/204108#M76978</link>
      <description>&lt;P&gt;Hello &lt;A rel="user" href="https://community.cloudera.com/users/18929/yaswanthmuppireddy.html" nodeid="18929"&gt;@Shu&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;I am wondering how can use the same technique but to replace order by clause with nothing. I would like to not use order by at all.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2018 22:58:46 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Replace-text-how-to-replace-quot-ORDER-BY-asc-quot-by/m-p/204108#M76978</guid>
      <dc:creator>prachisharma432</dc:creator>
      <dc:date>2018-10-04T22:58:46Z</dc:date>
    </item>
  </channel>
</rss>

