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

Error when insert into empty table with ACID

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Duplicate
    • 0.14.0
    • 0.14.0
    • None
    • None

    Description

      Steps to show the bug :
      1. create table

      create table encaissement_1b_64m like encaissement_1b;
      

      2. check table

      desc encaissement_1b_64m;
      dfs -ls hdfs://nc-h04/user/hive/warehouse/casino.db/encaissement_1b_64m;
      

      everything is ok:

      0: jdbc:hive2://nc-h04:10000/casino> desc encaissement_1b_64m;                                                                                                              +------------+------------+----------+--+
      |  col_name  | data_type  | comment  |
      +------------+------------+----------+--+
      | id         | int        |          |
      | idmagasin  | int        |          |
      | zibzin     | string     |          |
      | cheque     | int        |          |
      | montant    | double     |          |
      | date       | timestamp  |          |
      | col_6      | string     |          |
      | col_7      | string     |          |
      | col_8      | string     |          |
      +------------+------------+----------+--+
      9 rows selected (0.158 seconds)
      0: jdbc:hive2://nc-h04:10000/casino> dfs -ls hdfs://nc-h04/user/hive/warehouse/casino.db/encaissement_1b_64m/;
      +-------------+--+
      | DFS Output  |
      +-------------+--+
      +-------------+--+
      No rows selected (0.01 seconds)
      
      

      3. Insert values into the new table

      insert into table encaissement_1b_64m VALUES (1, 1, '800000000909000000000000', 1, 12.5, '12/05/2014', '','','');
      

      4. Check

      0: jdbc:hive2://nc-h04:10000/casino> select id from encaissement_1b_64m;
      +-----+--+
      | id  |
      +-----+--+
      +-----+--+
      No rows selected (0.091 seconds)
      

      There are already a pb. I don't see the inserted row.

      5. When I'm checking HDFS directory, I see delta_0000421_0000421 folder

      0: jdbc:hive2://nc-h04:10000/casino> dfs -ls hdfs://nc-h04/user/hive/warehouse/casino.db/encaissement_1b_64m/;
      +-----------------------------------------------------------------------------------------------------------------------------------------------------+--+
      |                                                                     DFS Output                                                                      |
      +-----------------------------------------------------------------------------------------------------------------------------------------------------+--+
      | Found 1 items                                                                                                                                       |
      | drwxr-xr-x   - hduser supergroup          0 2014-09-23 12:17 hdfs://nc-h04/user/hive/warehouse/casino.db/encaissement_1b_64m/delta_0000421_0000421  |
      +-----------------------------------------------------------------------------------------------------------------------------------------------------+--+
      2 rows selected (0.014 seconds)
      

      6. Doing a major compaction solves the bug

      0: jdbc:hive2://nc-h04:10000/casino> alter table encaissement_1b_64m compact 'major';
      No rows affected (0.046 seconds)
      0: jdbc:hive2://nc-h04:10000/casino> dfs -ls hdfs://nc-h04/user/hive/warehouse/casino.db/encaissement_1b_64m/;
      +--------------------------------------------------------------------------------------------------------------------------------------------+--+
      |                                                                 DFS Output                                                                 |
      +--------------------------------------------------------------------------------------------------------------------------------------------+--+
      | Found 1 items                                                                                                                              |
      | drwxr-xr-x   - hduser supergroup          0 2014-09-23 12:21 hdfs://nc-h04/user/hive/warehouse/casino.db/encaissement_1b_64m/base_0000421  |
      +--------------------------------------------------------------------------------------------------------------------------------------------+--+
      2 rows selected (0.02 seconds)
      

      Attachments

        1. a_beeline_insert.txt
          43 kB
          Damien Carol
        2. a_hiveserver2_insert.txt
          176 kB
          Damien Carol
        3. b_beeline_insert.txt
          10 kB
          Damien Carol
        4. b_hiveserver2_insert.txt
          51 kB
          Damien Carol
        5. c_beeline.txt
          45 kB
          Damien Carol
        6. c_hiveserver2.txt
          139 kB
          Damien Carol

        Issue Links

          Activity

            People

              damien.carol Damien Carol
              damien.carol Damien Carol
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: