why i get Table not found 'dual'

2012-10-18 Thread fellowtree
hi all:
 some one said hive support sql like  select if(1=2,100,200) from dual; 
however i always get Table not found 'dual' . my hive is 0.9.0 and what is the 
reason?




fellowtree

Re: why i get Table not found 'dual'

2012-10-18 Thread MiaoMiao
Do you even have a table name 'dual' or not?

On Thu, Oct 18, 2012 at 2:24 PM, fellowtree fellowt...@163.com wrote:
 hi all:
  some one said hive support sql like  select if(1=2,100,200) from dual;
 however i always get Table not found 'dual' . my hive is 0.9.0 and what is
 the reason?

 
 fellowtree


Re: why i get Table not found 'dual'

2012-10-18 Thread Kaufman Ng
The 'dual' table is a feature in Oracle only I believe.

There's an open Jira for this.  You can try Edward Capriolo's project
(described in the jira) which allows you to use dual.
https://issues.apache.org/jira/browse/HIVE-1558

On Thu, Oct 18, 2012 at 2:29 AM, MiaoMiao liy...@gmail.com wrote:
 Do you even have a table name 'dual' or not?

 On Thu, Oct 18, 2012 at 2:24 PM, fellowtree fellowt...@163.com wrote:
 hi all:
  some one said hive support sql like  select if(1=2,100,200) from dual;
 however i always get Table not found 'dual' . my hive is 0.9.0 and what is
 the reason?

 
 fellowtree


Re: why I get Table not found 'dual'

2012-10-18 Thread Edward Capriolo
That way works but if someone accidentally adds a second row or
deletes the first row dual stops working right.

This was why I wrote dual input format. It always works right
regardless if the table has data.

Edward

On Thu, Oct 18, 2012 at 12:09 PM, Sunderlin, Mark
mark.sunder...@teamaol.com wrote:
 I creates a single column, single row table called 'dual'


 1.  Create a text file on HDFS, call it a.txt with just the letter 'a' 
 (or any single character in it)
 2.  Create the single column table, dual: 'create table dual (x, string);'
 3.  Load the text file into dual: load data local inpath '... /a.txt' 
 overwrite into table dual;  (replace '...' with the path to the HDFS 
 directory you created a.txt in)
 4.  Enjoy using it just like you do in Oracle: select 
 parse_url('http://autos.aol.com/gallery/best-trucks-fuel-economy/', 'HOST') 
 from dual

 A quick AOL search and I see this guy did pretty much the same:

 http://bigdatadw.blogspot.com/2012/02/dual-table-in-hive.html

 ---
 Mark E. Sunderlin
 Solutions Architect |AOL Core Data Technologies
 P: 703-265-6935 |C: 540-327-6222 | AIM: MESunderlin
 22000 AOL Way | Dulles, VA | 20166

 -Original Message-
 From: Kaufman Ng [mailto:kauf...@cloudera.com]
 Sent: Thursday, October 18, 2012 9:45 AM
 To: user@hive.apache.org
 Cc: fellowtree
 Subject: Re: why i get Table not found 'dual'

 The 'dual' table is a feature in Oracle only I believe.

 There's an open Jira for this.  You can try Edward Capriolo's project 
 (described in the jira) which allows you to use dual.
 https://issues.apache.org/jira/browse/HIVE-1558

 On Thu, Oct 18, 2012 at 2:29 AM, MiaoMiao liy...@gmail.com wrote:
 Do you even have a table name 'dual' or not?

 On Thu, Oct 18, 2012 at 2:24 PM, fellowtree fellowt...@163.com wrote:
 hi all:
  some one said hive support sql like  select if(1=2,100,200) from
 dual; however i always get Table not found 'dual' . my hive is 0.9.0
 and what is the reason?

 
 fellowtree


RE: why I get Table not found 'dual'

2012-10-18 Thread Sunderlin, Mark
Ed's solution is clearly superior(!), if, your admin team will install it.  In 
some cases, your admin may not wish to do so.  In such cases, the below 
'self-service' method will work. :-)
---
Mark E. Sunderlin
Solutions Architect |AOL Core Data Technologies
P: 703-265-6935 |C: 540-327-6222 | AIM: MESunderlin
22000 AOL Way | Dulles, VA | 20166


-Original Message-
From: Edward Capriolo [mailto:edlinuxg...@gmail.com] 
Sent: Thursday, October 18, 2012 12:13 PM
To: user@hive.apache.org
Subject: Re: why I get Table not found 'dual'

That way works but if someone accidentally adds a second row or deletes the 
first row dual stops working right.

This was why I wrote dual input format. It always works right regardless if the 
table has data.

Edward

On Thu, Oct 18, 2012 at 12:09 PM, Sunderlin, Mark mark.sunder...@teamaol.com 
wrote:
 I creates a single column, single row table called 'dual'


 1.  Create a text file on HDFS, call it a.txt with just the letter 'a' 
 (or any single character in it)
 2.  Create the single column table, dual: 'create table dual (x, string);'
 3.  Load the text file into dual: load data local inpath '... /a.txt' 
 overwrite into table dual;  (replace '...' with the path to the HDFS 
 directory you created a.txt in)
 4.  Enjoy using it just like you do in Oracle: select 
 parse_url('http://autos.aol.com/gallery/best-trucks-fuel-economy/', 'HOST') 
 from dual

 A quick AOL search and I see this guy did pretty much the same:

 http://bigdatadw.blogspot.com/2012/02/dual-table-in-hive.html

 ---
 Mark E. Sunderlin
 Solutions Architect |AOL Core Data Technologies
 P: 703-265-6935 |C: 540-327-6222 | AIM: MESunderlin
 22000 AOL Way | Dulles, VA | 20166

 -Original Message-
 From: Kaufman Ng [mailto:kauf...@cloudera.com]
 Sent: Thursday, October 18, 2012 9:45 AM
 To: user@hive.apache.org
 Cc: fellowtree
 Subject: Re: why i get Table not found 'dual'

 The 'dual' table is a feature in Oracle only I believe.

 There's an open Jira for this.  You can try Edward Capriolo's project 
 (described in the jira) which allows you to use dual.
 https://issues.apache.org/jira/browse/HIVE-1558

 On Thu, Oct 18, 2012 at 2:29 AM, MiaoMiao liy...@gmail.com wrote:
 Do you even have a table name 'dual' or not?

 On Thu, Oct 18, 2012 at 2:24 PM, fellowtree fellowt...@163.com wrote:
 hi all:
  some one said hive support sql like  select if(1=2,100,200) 
 from dual; however i always get Table not found 'dual' . my hive is 
 0.9.0 and what is the reason?

 
 fellowtree