You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@asterixdb.apache.org by "Xikui Wang (JIRA)" <ji...@apache.org> on 2018/08/07 06:30:00 UTC

[jira] [Created] (ASTERIXDB-2436) AsterixIntroduceGroupByCombinerRule causes infinite loop in optimization

Xikui Wang created ASTERIXDB-2436:
-------------------------------------

             Summary: AsterixIntroduceGroupByCombinerRule causes infinite loop in optimization
                 Key: ASTERIXDB-2436
                 URL: https://issues.apache.org/jira/browse/ASTERIXDB-2436
             Project: Apache AsterixDB
          Issue Type: Bug
            Reporter: Xikui Wang


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.

{code}
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);
{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)