Uploaded image for project: 'Apache AsterixDB'
  1. Apache AsterixDB
  2. ASTERIXDB-2436

AsterixIntroduceGroupByCombinerRule causes infinite loop in optimization

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 0.9.4
    • 0.9.4.2
    • None
    • None

    Description

      It's because the rule tries to modify the plan. If the rule failed, the rule restores the backed up copy. This will change the Operators in the plan which doesn't match the DoNotApply list which will further cause the rule to be applied multiple times.

      drop  dataverse test if exists;
      create  dataverse test;
      use test;
      
      create type TweetType as open {
        id : int64,
        created_at : datetime
      };
      
      create type StoredTweetType as open {
        tid : uuid
      };
      
      drop dataset ReligiousBuildingDataset if exists;
      drop type ReligiousBuildingType if exists;
      create type ReligiousBuildingType as open {
          religiousBuildingId : string,
          religionName : string,
          buildingLocation : point,
          registeredBeliever: int
      };
      create dataset ReligiousBuildingDataset(ReligiousBuildingType) primary key religiousBuildingId;
      
      drop dataset AttackEventsDataset if exists;
      drop type AttackEventsType if exists;
      create type AttackEventsType as open {
          attackRecordId: string,
          attackDatetime: datetime,
          attackLocation: point,
          relatedReligion: string
      };
      create dataset AttackEventsDataset(AttackEventsType) primary key attackRecordId;
      
      
      create function annotateTweet(x) {
          LET nearby_religious_building = (select r.religionName as Religion from ReligiousBuildingDataset r
          where spatial_intersect(create_point(x.latitude, x.longitude), create_circle(r.buildingLocation, 3.0))),
          nearby_religious_attack = (select Religion, count(a.attackRecordId) as AttackNum
             from AttackEventsDataset a, nearby_religious_building r2
             where x.created_at  < a.attackDatetime + duration("P2M")
             and x.created_at  > a.attackDatetime
             and r2.religionName = a.relatedReligion
             group by r2.religionName as Religion)
          select x.*, nearby_religious_attack
      };
      
      create dataset targetDataset(StoredTweetType) primary key tid autogenerated;
      create dataset tweetDataset(TweetType) primary key id;
      
      use test;
      insert into targetDataset (select annotateTweet(x) from tweetDataset x);
      

      Attachments

        Activity

          People

            dlychagin-cb Dmitry Lychagin
            idleft Xikui Wang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: