You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Attila Magyar (Jira)" <ji...@apache.org> on 2021/06/09 09:51:00 UTC

[jira] [Created] (HIVE-25223) Select with limit returns no rows on non native table

Attila Magyar created HIVE-25223:
------------------------------------

             Summary: Select with limit returns no rows on non native table
                 Key: HIVE-25223
                 URL: https://issues.apache.org/jira/browse/HIVE-25223
             Project: Hive
          Issue Type: Bug
            Reporter: Attila Magyar
            Assignee: Attila Magyar
             Fix For: 4.0.0


Str:
{code:java}
CREATE EXTERNAL TABLE hht (key string, value int) 
STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
WITH SERDEPROPERTIES ("hbase.columns.mapping" = ":key,cf1:val")
TBLPROPERTIES ("hbase.table.name" = "hht", "hbase.mapred.output.outputtable" = "hht");

insert into hht select uuid(), cast((rand() * 1000000) as int);

insert into hht select uuid(), cast((rand() * 1000000) as int) from hht;
insert into hht select uuid(), cast((rand() * 1000000) as int) from hht;
insert into hht select uuid(), cast((rand() * 1000000) as int) from hht;
insert into hht select uuid(), cast((rand() * 1000000) as int) from hht;
insert into hht select uuid(), cast((rand() * 1000000) as int) from hht;
insert into hht select uuid(), cast((rand() * 1000000) as int) from hht;

 set hive.fetch.task.conversion=none;
 select * from hht limit 10;

+----------+------------+
| hht.key  | hht.value  |
+----------+------------+
+----------+------------+
No rows selected (5.22 seconds) {code}
 

This is caused by GlobalLimitOptimizer. The table directory is always empty with a non native table since the data is not managed by hive (but hbase in this case).

The optimizer scans the directory and sets the file list to an empty list.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)