Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Hive have something equivalent to DUAL?

I'd like to run statements like

SELECT date_add('2008-12-31', 1) FROM DUAL

Does Hive (running on Amazon EMR) have something similar?

like image 793
jbreed Avatar asked Mar 20 '12 22:03

jbreed


People also ask

Is there any DUAL table in hive?

In many other databases, the query engine supports select directly from constant values without specifying a table name. In Hive, there is no system table named Dual.

What is dual in Oracle?

It is a table that is automatically created by Oracle Database along with the data dictionary. DUAL is in the schema of the user SYS but is accessible by the name DUAL to all users. It has one column, DUMMY, defined to be VARCHAR2(1), and contains one row with a value X.

What is external table in Hive?

An external table is a table for which Hive does not manage storage. If you delete an external table, only the definition in Hive is deleted. The data remains. An internal table is a table that Hive manages. If you delete an internal table, both the definition in Hive and the data are deleted.


2 Answers

Not yet: https://issues.apache.org/jira/browse/HIVE-1558

like image 32
Jeff Hammerbacher Avatar answered Sep 28 '22 03:09

Jeff Hammerbacher


Best solution is not to mention table name.

select 1+1;

Gives the result 2. But poor Hive need to spawn map reduce to find this!

like image 82
Harikrishnan Ck Avatar answered Sep 28 '22 03:09

Harikrishnan Ck