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

Query with SI after add partition based on location on partition table gives incorrect results

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 2.1.1
    • None
    • None

    Description

      Queries to execute:

      • drop table if exists partitionTable;
      • create table partitionTable (id int,name String) partitioned by(email string) stored as carbondata;
      • insert into partitionTable select 1,'blue','abc';
      • CREATE INDEX maintable_si112 on table partitionTable (name) as 'carbondata';
      • alter table partitionTable add partition (email='def') location '$sdkWritePath';
      • select *from partitionTable where name = 'red';   ---> returns empty result
      • select *from partitionTable where ni(name = 'red');
      • alter table partitionTable compact 'major';
      • select *from partitionTable where name = 'red';

      spark-sql> create table partitionTable (id int,name String) partitioned by(email string) STORED AS carbondata;
      Time taken: 1.962 seconds
      spark-sql> CREATE INDEX maintable_si112 on table partitionTable (name) as 'carbondata';
      Time taken: 2.759 seconds
      spark-sql> insert into partitionTable select 1,'huawei','abc';
      0
      Time taken: 5.808 seconds, Fetched 1 row(s)
      spark-sql> alter table partitionTable add partition (email='def') location 'hdfs://hacluster/datastore';
      Time taken: 1.108 seconds
      spark-sql> insert into partitionTable select 1,'huawei','def';
      1
      Time taken: 2.707 seconds, Fetched 1 row(s)
      spark-sql> select *from partitionTable where name='huawei';
      1 huawei abc
      Time taken: 0.75 seconds, Fetched 1 row(s)
      spark-sql> select *from partitionTable where ni(name='huawei');
      1 huawei def
      1 huawei abc
      Time taken: 0.507 seconds, Fetched 2 row(s)
      spark-sql>

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            Shreelekhya SHREELEKHYA GAMPA
            Votes:
            0 Vote for this issue
            Watchers:
            1 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 - 7h
                7h