Uploaded image for project: 'Apache HAWQ'
  1. Apache HAWQ
  2. HAWQ-1132

HAWQ should throw error when we insert data in a hash table and the virtual segment number is 1

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Core, Planner, Query Execution
    • Labels:
      None

      Description

      If we set virtual segment number is 1, and create a hash table (default hash number is 6), we will just get a warning message in a no partition table when we insert a tuple. And we can even not get any message in a partition table. When we select from this table, HAWQ throws error.

      No partition table:

      postgres=# set enforce_virtual_segment_number = 1;
      SET
      postgres=# create table t(id int) DISTRIBUTED BY (id);
      CREATE TABLE
      postgres=# insert into t values(1);
      WARNING:  skipping "t" --- error returned: file count 1 in catalog is not in proportion to the bucket number 6 of hash table with oid=2966724, some data may be lost, if you still want to continue the query by considering the table as random, set GUC allow_file_count_bucket_num_mismatch to on and try again.
      INFO:  ANALYZE completed. Success: 0, Failure: 1 (t)
      INSERT 0 1
      postgres=# select * from t;
      ERROR:  file count 1 in catalog is not in proportion to the bucket number 6 of hash table with oid=2966724, some data may be lost, if you still want to continue the query by considering the table as random, set GUC allow_file_count_bucket_num_mismatch to on and try again. (cdbdatalocality.c:3801)
      postgres=#
      

      Partition table:

      postgres=# set enforce_virtual_segment_number = 1;
      SET
      postgres=# CREATE TABLE t (id int, rank int, year int, gender char(1), count int ) DISTRIBUTED BY (id)     PARTITION BY LIST (gender) ( PARTITION girls VALUES ('F'), PARTITION boys VALUES ('M'), DEFAULT PARTITION other );
      NOTICE:  CREATE TABLE will create partition "t_1_prt_girls" for table "t"
      NOTICE:  CREATE TABLE will create partition "t_1_prt_boys" for table "t"
      NOTICE:  CREATE TABLE will create partition "t_1_prt_other" for table "t"
      CREATE TABLE
      postgres=# insert into t values(51, 1, 1, 'F', 1);
      INSERT 0 1
      postgres=# select * from t;
      ERROR:  file count 1 in catalog is not in proportion to the bucket number 6 of hash table with oid=2966703, some data may be lost, if you still want to continue the query by considering the table as random, set GUC allow_file_count_bucket_num_mismatch to on and try again. (cdbdatalocality.c:3801)
      postgres=#
      

        Attachments

          Activity

            People

            • Assignee:
              lei_chang Lei Chang
              Reporter:
              wcl14 Chunling Wang
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: