hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Kramer (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HIVE-178) SELECT without FROM should assume a one-row table with no columns.
Date Tue, 26 Jul 2011 23:39:10 GMT

     [ https://issues.apache.org/jira/browse/HIVE-178?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Adam Kramer updated HIVE-178:
-----------------------------

    Description: 
SELECT 1+1;

should just return '2', but instead hive fails because no table is listed.

SELECT 1+1 FROM (empty table);

should also just return '2', but instead hive "succeeds" because there is "no possible output,"
so it produces no output.

So, currently we have to run 

SELECT 1+1 FROM (silly one-row dummy table);

...which runs a whole mapreduce step to ignore a column of data that is useless anyway. This
is much easier due to local mode, but still, it would be nice to be able to SELECT without
specifying a table and to get one row of output in moments instead of waiting for even a local-mode
job to launch, complete, and return.

Relatedly, an optimization by which Hive can tell that data from a table isn't even USED would
be useful, because it means that the data needn't be queried...the only relevant info from
the table would be the number of rows it has, which is available for free from the metastore.

  was:
SELECT 1+1;

should just return '2', but instead hive fails because no table is listed.

SELECT 1+1 FROM (empty table);

should also just return '2', but instead hive "succeeds" because there is "no possible output,"
so it produces no output. This is the reason I filed under "bug" instead of "improvement:"
If it does not return '2' hive should fail.

So, currently we have to run 

SELECT 1+1 FROM (actual table with data);

...which runs a whole mapreduce step to ignore all of the data in the table before spitting
out '2'. This will be exceptionally frustrating if hadoop makes us wait for mapper(s).

It would be nice to be able to SELECT without specifying a table, and perhaps relatedly, to
be able to edit the above query (which worked) to not need to actually process (actual table
with data) given that no data is being pulled from it (as we see from the SELECT statement,
that table's name or alias does not appear).


        Summary: SELECT without FROM should assume a one-row table with no columns.  (was:
SELECT without FROM; dropping unnecessary table references)

> SELECT without FROM should assume a one-row table with no columns.
> ------------------------------------------------------------------
>
>                 Key: HIVE-178
>                 URL: https://issues.apache.org/jira/browse/HIVE-178
>             Project: Hive
>          Issue Type: Wish
>          Components: Query Processor
>            Reporter: Adam Kramer
>            Priority: Minor
>              Labels: SQL
>
> SELECT 1+1;
> should just return '2', but instead hive fails because no table is listed.
> SELECT 1+1 FROM (empty table);
> should also just return '2', but instead hive "succeeds" because there is "no possible
output," so it produces no output.
> So, currently we have to run 
> SELECT 1+1 FROM (silly one-row dummy table);
> ...which runs a whole mapreduce step to ignore a column of data that is useless anyway.
This is much easier due to local mode, but still, it would be nice to be able to SELECT without
specifying a table and to get one row of output in moments instead of waiting for even a local-mode
job to launch, complete, and return.
> Relatedly, an optimization by which Hive can tell that data from a table isn't even USED
would be useful, because it means that the data needn't be queried...the only relevant info
from the table would be the number of rows it has, which is available for free from the metastore.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message