<?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: impala alternative to oracle dual table in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/impala-alternative-to-oracle-dual-table/m-p/23227#M4259</link>
    <description>&lt;P&gt;"dual" is a keyword in oracle sql.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It represents a fake table from which you can select whatever you want.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is extremely useful for a lot of etl&amp;nbsp;tasks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example if you need to generate a list of one hundred numbers you can do something like this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SELECT ROWNUM rn FROM dual CONNECT BY 1=1 AND ROWNUM &amp;lt; 1001&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(rownum is another special keyword in oracle to have an id of the row)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another example is this&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;select 1 id, 'a' desc from dual union select 2 id, 'b' desc from dual&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;creating on the fly a simple table with 2 rows&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1,'a'&lt;/P&gt;&lt;P&gt;2,'b'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and so on.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This on the fly generated table data can then be used and joined with other table and so on.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At the moment with impala i've create a real table to do the job inserting all the needed data&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Beleive me that this fake table became very handy in a lot of situations&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;bye&lt;/P&gt;</description>
    <pubDate>Thu, 01 Jan 2015 10:52:08 GMT</pubDate>
    <dc:creator>steghe</dc:creator>
    <dc:date>2015-01-01T10:52:08Z</dc:date>
    <item>
      <title>impala alternative to oracle dual table</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/impala-alternative-to-oracle-dual-table/m-p/23063#M4257</link>
      <description>&lt;P&gt;In oracle it is possibile to use a statement like this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;select something from dual&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;where dual is a special table on which you could select any field you like to&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is a special purpose table that it is often used&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any alternative in impala?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At the moment what i need to do is a simple&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;select 1 as type from dual&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 09:16:28 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/impala-alternative-to-oracle-dual-table/m-p/23063#M4257</guid>
      <dc:creator>steghe</dc:creator>
      <dc:date>2022-09-16T09:16:28Z</dc:date>
    </item>
    <item>
      <title>Re: impala alternative to oracle dual table</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/impala-alternative-to-oracle-dual-table/m-p/23151#M4258</link>
      <description>&lt;P&gt;I'm not sure I follow your question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What exactly is "dual"? Can you provide more information?&lt;/P&gt;</description>
      <pubDate>Mon, 29 Dec 2014 21:26:41 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/impala-alternative-to-oracle-dual-table/m-p/23151#M4258</guid>
      <dc:creator>alex.behm</dc:creator>
      <dc:date>2014-12-29T21:26:41Z</dc:date>
    </item>
    <item>
      <title>Re: impala alternative to oracle dual table</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/impala-alternative-to-oracle-dual-table/m-p/23227#M4259</link>
      <description>&lt;P&gt;"dual" is a keyword in oracle sql.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It represents a fake table from which you can select whatever you want.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is extremely useful for a lot of etl&amp;nbsp;tasks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example if you need to generate a list of one hundred numbers you can do something like this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SELECT ROWNUM rn FROM dual CONNECT BY 1=1 AND ROWNUM &amp;lt; 1001&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(rownum is another special keyword in oracle to have an id of the row)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another example is this&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;select 1 id, 'a' desc from dual union select 2 id, 'b' desc from dual&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;creating on the fly a simple table with 2 rows&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1,'a'&lt;/P&gt;&lt;P&gt;2,'b'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and so on.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This on the fly generated table data can then be used and joined with other table and so on.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At the moment with impala i've create a real table to do the job inserting all the needed data&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Beleive me that this fake table became very handy in a lot of situations&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;bye&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jan 2015 10:52:08 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/impala-alternative-to-oracle-dual-table/m-p/23227#M4259</guid>
      <dc:creator>steghe</dc:creator>
      <dc:date>2015-01-01T10:52:08Z</dc:date>
    </item>
    <item>
      <title>Re: impala alternative to oracle dual table</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/impala-alternative-to-oracle-dual-table/m-p/23284#M4260</link>
      <description>&lt;P&gt;Impala allows you to select&amp;nbsp;without a table, e.g.:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;select 1 id, 'a' d UNION select 2 id, 'b' d;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;('desc' is a keyword in Impala's SQL dialect). So 'dual' is not necessary for these kinds of on-the-fly table patterns.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Henry&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Jan 2015 23:30:04 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/impala-alternative-to-oracle-dual-table/m-p/23284#M4260</guid>
      <dc:creator>HenryR</dc:creator>
      <dc:date>2015-01-04T23:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: impala alternative to oracle dual table</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/impala-alternative-to-oracle-dual-table/m-p/36424#M4261</link>
      <description>What will be equivalent of below Oracle Query in Impala.&lt;BR /&gt;&lt;BR /&gt;select 1 id, 'a' d from dual where not exists (select 1 from employee where empid &amp;gt; 20000)</description>
      <pubDate>Wed, 20 Jan 2016 17:51:05 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/impala-alternative-to-oracle-dual-table/m-p/36424#M4261</guid>
      <dc:creator>manubatham20</dc:creator>
      <dc:date>2016-01-20T17:51:05Z</dc:date>
    </item>
    <item>
      <title>Re: impala alternative to oracle dual table</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/impala-alternative-to-oracle-dual-table/m-p/36430#M4262</link>
      <description>&lt;P&gt;You can create a 1-row dummy table like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;select 1 id, 'a' d from (select 1) dual where 1 = 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You also have to rewrite the query to avoid an uncorrelated not exists. You can do something like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;select 1 id, 'a' d from (select 1) dual where (select count(*) from employee where empid &amp;gt; 20000) = 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Computing the count might be expensive so you could add a limit like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;select 1 id, 'a' d from (select 1) dual where (select count(*) from (select id from employee where empid &amp;gt; 20000 limit 1) emp) = 0&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2016 19:50:38 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/impala-alternative-to-oracle-dual-table/m-p/36430#M4262</guid>
      <dc:creator>Tim Armstrong</dc:creator>
      <dc:date>2016-01-20T19:50:38Z</dc:date>
    </item>
  </channel>
</rss>

