OrientDB ETL结果不在图数据库中

时间:2017-04-25 18:15:01

标签: orientdb orientdb-etl

我已创建此配置文件:

{ 
    "config": { "log": "debug" }, 
    "extractor": { 
        "jdbc": {
            "driver":"com.ibm.db2.jcc.DB2Driver",
            "url":"jdbc:db2://DB2TVIPA:447/DB2TVIPA",
            "userName": "lidt9bl", 
            "userPassword": "Wam52017", 
            "query": "select * from DB2TST5.COMVTC" } }, 
    "transformers": [ 
{log: {prefix: "MySQL -> "}},
{"field": {"fieldName":"text", "value": "Medical Vendor Type Code"} }, 
{"field": {"fieldName":"code","expression": "COMVTC_C"} }, 
{"field": {"fieldName":"COMVTC_C", "operation" :"remove"} }, 
{"field": {"fieldName":"display", "expression" : "COMVTC_NM"} }, 
{"field": {"fieldName":"COMVTC_NM", "operation" : "remove"} }, 
{"field": {"fieldName":"status", "expression" :"COMVTC_STUS_C"} }, 
{"field": {"fieldName":"COMVTC_STUS_C", "operation" :"remove"} }, 
{"field": {"fieldName":"effectiveDate","expression" : "COMVTC_EFF_DT"} }, 
{"field": {"fieldName":"COMVTC_EFF_DT","operation" : "remove"} }, 
{"field": {"fieldName":"terminationDate", "expression" : "COMVTC_TRM_DT"} }, 
{"field": {"fieldName":"COMVTC_TRM_DT", "operation" : "remove"} }, 
{"field": {"fieldName":"createTS","expression" : "COMVTC_REC_MTN_TS"} }, 
{"field": {"fieldName":"COMVTC_REC_MTN_TS", "operation" : "remove"} }, 
{"field": {"fieldName":"userID", "expression" : "COMVTC_REC_MTN_ID"} }, 
{"field": {"fieldName":"COMVTC_REC_MTN_ID", "operation" : "remove"} }, 
{"field": {"fieldName":"system", "value": "1"} }, 
{"field": {"fieldName":"version", "value": "1"} }, 
{"field": {"fieldName":"userSelected", "value": false} }, 
{"vertex":{"class": "codeableConcept"} } ],
"loader": {
        "orientdb": {
            "dbURL": "plocal:localhost/p01/app/gdb/orientdb-community-2.2.17/databases/CorporateProviderData",
            "dbUser": "admin",
            "dbPassword": "admin",
            "dbAutoDropIfExists": false,
            "dbAutoCreate": false,
            "tx": false,
            "wal": true,
            "batchCommit": 2,
            "dbType": "graph",
            "dbAutoCreateProperties": true,
            "classes":[{"name":"codeableConcept", "extends": "coding"},{"name":"coding", "extends": "V"}]
             } } }

类codeableConcept已经存在且没有记录。 select表读取一个包含两行的小表:

COMVTC_C COMVTC_STUS_C COMVTC_EFF_DT    COMVTC_TRM_DT   COMVTC_NM                 COMVTC_REC_MTN_TS             COMVTC_REC_MTN_ID
--------        -------------             -------------                   -------------            --------------------------------------------------   --------------------------  -----------------
AS                A                     1937-01-01                       NULL           Administrative Service                              2007-01-15 02:06:29.396586  XXXXXX 
MS                A                     1937-01-01                       NULL           Medical Service                                     2007-01-15 02:06:29.416709  XXXXXX 

我正在更改列名以匹配以下内容:

create class coding extends V;
create property coding.system string;
create property coding.version string;
create property coding.code string;
create property coding.display string;
create property coding.userSelected Boolean;
ALTER PROPERTY coding.system MANDATORY true;
ALTER PROPERTY coding.version MANDATORY true;
ALTER PROPERTY coding.code MANDATORY true;
CREATE INDEX Index_CodeSet_key ON coding (system,version,code) UNIQUE;

create class codeableConcept extends coding;
create property codeableConcept.text string;

以下是日志的结尾:

[3:field] DEBUG Transformer output: {COMVTC_C:null,COMVTC_STUS_C:null,COMVTC_EFF_DT:null,COMVTC_TRM_DT:null,COMVTC_NM:null,COMVTC_REC_MTN_TS:null,COMVTC_REC_MTN_ID:null,text:Medical Vendor Type Code,code:MS,display:Medical Service                                   ,status:A,effectiveDate:1937-01-01,terminationDate:null,createTS:2007-01-15 02:06:29.416709,userID:APOLIDB ,system:1,version:1,userSelected:false}

[3:vertex] DEBUG Transformer input: {COMVTC_C:null,COMVTC_STUS_C:null,COMVTC_EFF_DT:null,COMVTC_TRM_DT:null,COMVTC_NM:null,COMVTC_REC_MTN_TS:null,COMVTC_REC_MTN_ID:null,text:Medical Vendor Type Code,code:MS,display:Medical Service                                   ,status:A,effectiveDate:1937-01-01,terminationDate:null,createTS:2007-01-15 02:06:29.416709,userID:APOLIDB ,system:1,version:1,userSelected:false}

[3:vertex] DEBUG Transformer output: v(codeableConcept)[#22:8]

[orientdb] INFO committing

Pipeline worker done without errors:: true
all items extracted
END ETL PROCESSOR
+ extracted 5 records (0 records/sec) - 5 records -> loaded 2 vertices (0 vertices/sec) Total time: 195ms [0 warnings, 0 errors]

它说它创建了codeableConcept RID#22:8,但它不存在。

orientdb {db=CorporateProviderData}> info class codeableConcept

CLASS 'codeableConcept'

Records..............: 0
Super classes........: [coding]
Default cluster......: codeableconcept (id=25)
Supported clusters...: codeableconcept(25), codeableconcept_1(26), codeableconcept_2(27), codeableconcept_3(28)
Cluster selection....: round-robin
Oversize.............: 0.0

任何想法?

1 个答案:

答案 0 :(得分:0)

我找到了解决方案。它花了另一组眼睛,但它在dbURL内。

“dbURL”:“plocal:localhost / p01 / app / gdb / orientdb-community-2.2.17 / databases / CorporateProviderData”

由于使用了“localhost”,我没有意识到它在另一个目录中创建了一个新数据库。一旦我删除它,它工作。