You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@asterixdb.apache.org by "Ildar Absalyamov (JIRA)" <ji...@apache.org> on 2016/11/19 21:15:58 UTC

[jira] [Created] (ASTERIXDB-1738) Change feed fails to delete record with meta PK

Ildar Absalyamov created ASTERIXDB-1738:
-------------------------------------------

             Summary: Change feed fails to delete record with meta PK
                 Key: ASTERIXDB-1738
                 URL: https://issues.apache.org/jira/browse/ASTERIXDB-1738
             Project: Apache AsterixDB
          Issue Type: Bug
            Reporter: Ildar Absalyamov


I am trying to create the following dataset with meta PK and feed in data to it using change-feed localFS adapter
{noformat}
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;
{noformat}

Contents of the test.adm:
{noformat}
1,"{""test"":""test1""}"
2,"{""test"":""test2""}"
3,"{""test"":""test3""}"
3,
2,"{""test"":""test4""}"
{noformat}

Ingestion is able to update the record with id=2, but fails to delete the third record:
{noformat}
for $x in dataset TestDS return {"record": $x, "id": meta().id}
{noformat}
Result:
{noformat}
{ "record": { "test": "test1" }, "id": 1 }
{ "record": { "test": "test4" }, "id": 2 }
{ "record": { "test": "test3" }, "id": 3 }
{noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)