Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-25223

Select with limit returns no rows on non native table

    XMLWordPrintableJSON

Details

    Description

      Str:

      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) 

       

      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.

      Attachments

        Issue Links

          Activity

            People

              amagyar Attila Magyar
              amagyar Attila Magyar
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h