Uploaded image for project: 'CarbonData'
  1. CarbonData
  2. CARBONDATA-4031

Query result is incorrect after Delete and Insert overwrite

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 2.0.0
    • 2.1.1
    • data-query
    • None

    Description

      There is a table with two partitions. User deletes some records on one of partitions and then inserts overwrite the other partition. Deleted records on the previous partition comes back.

      1.  CREATE TABLE s_x034_carbon (guid STRING, sales_guid STRING) PARTITIONED BY (dt STRING) STORED AS carbondata;

      2. load data local inpath '/home/lizi/Workspace/carbondata_test_workspace/data/s_x034_carbon-07.csv' into table s_x034_carbon;
      load data local inpath '/home/lizi/Workspace/carbondata_test_workspace/data/s_x034_carbon-08.csv' into table s_x034_carbon;

      3. select count(1), dt from s_x034_carbon group by dt;

      4. select * from s_x034_carbon where dt=20200907 limit 5;

      5. delete from s_x034_carbon where dt= 20200907 and guid='595E1862D81A09D0E1008000AC1E0124';

      delete from s_x034_carbon where dt= 20200907 and guid='005056AF06441EDA89ABF853E435A6BD';

      6. select count(1), dt from s_x034_carbon group by dt;

      7. insert overwrite table s_x034_carbon partition (dt=20200908)
      select a.guid as guid, a.sales_guid as sales_guid from s_x034_carbon a
      where dt = 20200907;

      8. select count(1), dt from s_x034_carbon group by dt;

       

      Attachments

        1. s_x034_carbon-08.csv
          5.64 MB
          Kejian Li
        2. s_x034_carbon-07.csv
          5.64 MB
          Kejian Li

        Activity

          People

            Unassigned Unassigned
            lizi666 Kejian Li
            Votes:
            0 Vote for this issue
            Watchers:
            2 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 - 6h
                6h