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

Change feed fails to delete record with meta PK

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      I am trying to create the following dataset with meta PK and feed in data to it using change-feed localFS adapter

      drop dataverse test if exists;
      create dataverse test;
      use dataverse test;
      
      create type TestType as closed {
          test: string
      }
      create type MetaType as {
      id:int
      }
      
      create dataset TestDS(TestType) with meta(MetaType) primary key meta().id;
      create index TestIdx on TestDS(test);
      drop feed TestFeed if exists;
      create feed TestFeed using adapter
      (
          ("parser"="record-with-metadata"),
          ("reader"="localfs"),
          ("path"="localhost:///ABSOLUTE_PATH/test.adm"),
          //type of the record
          ("type-name"="TestType"),
          //type of the meta record
          ("meta-type-name"="MetaType"),
          //format of the record
          ("record-format"="adm"),
          // format of the meta record
          ("format"="csv"),
          ("delimiter"=","),
          // index of the primary key the record (meta or orig)
          ("key-indexes"="0"),
          // indicates that PK originates from meta
          ("key-indicators"="1"),
      	//index of the record in the meta record
          ("record-index"="1"),
          ("change-feed"="true"),
          // whether CSV header is present in the input
          ("header"="false")
      );
      
      set wait-for-completion-feed "false";
      connect feed TestFeed to dataset TestDS;
      

      Contents of the test.adm:

      1,"{""test"":""test1""}"
      2,"{""test"":""test2""}"
      3,"{""test"":""test3""}"
      3,
      2,"{""test"":""test4""}"
      

      Ingestion is able to update the record with id=2, but fails to delete the third record:

      for $x in dataset TestDS return {"record": $x, "id": meta().id}
      

      Result:

      { "record": { "test": "test1" }, "id": 1 }
      { "record": { "test": "test4" }, "id": 2 }
      { "record": { "test": "test3" }, "id": 3 }
      

        Attachments

          Activity

            People

            • Assignee:
              iabsalyamov Ildar Absalyamov
              Reporter:
              iabsalyamov Ildar Absalyamov
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: