我正在尝试使用带有ETL转换的JDBC直接从Oracle提取数据到OrientDB。我有2个表警报,其他是由键列(alert_id)连接的userRead表。我没有成功通过顶点创建边缘,使用源数据成功创建索引。
//alert:
{
"config": {
// "log": "debug",
"parallel": true
},
"extractor" : {
"jdbc": { "driver": "oracle.jdbc.driver.OracleDriver",
"url": "jdbc:oracle:thin:@hostname:port/dbname",
"userName": "schema1",
"userPassword": "password",
"query": "select * from MC_ALERT$" }
},
"transformers" : [
{ "vertex": { "class":"MC_ALERT"} }
],
"loader": {
"orientdb": {
"dbURL": "plocal:/Users/dbadmin/workspace/orientdbEnprise2.1.8/databases/messaging",
"dbType": "graph",
"dbUser": "admin",
"dbPassword": "admin",
"dbAutoCreate": true,
"batchCommit": 1000,
"indexes": [
{
"class": "MC_ALERT",
"fields": [ "alert_uuid:string" ],
"type": "UNIQUE"
}
]
}
}
}
//userRead:
{
"config": {
"parallel": true
},
"extractor" : {
"jdbc": { "driver": "oracle.jdbc.driver.OracleDriver",
"url": "jdbc:oracle:thin:@hostname:port/dbname",
"userName": "schema1",
"userPassword": "password",
"query": "select a.* from MC_ALERT_USER_READ$ a, MC_ALERT$ b where a.alert_id = b.alert_uuid" }
},
"transformers" : [
{ "vertex": { "class":"MC_ALERT_USER_READ"} },
{ "edge": { "class": "HAS_ALERT_READ",
"joinFieldName": "ALERT_ID",
"lookup": "MC_ALERT.ALERT_UUID",
"direction": "in"
}
}
],
"loader": {
"orientdb": {
"dbURL": "plocal:/Users/dbadmin/workspace/orientdbEnprise2.1.8/databases/messaging",
"dbType": "graph",
"dbUser": "admin",
"dbPassword": "admin",
"dbAutoCreate": true,
"batchCommit": 1000,
"classes": [
{"name": "MC_ALERT","extends": "V"},
{"name": "MC_ALERT_USER_READ", "extends": "V"},
{"name": "HAS_ALERT_READ", "extends": "E"}
],
"indexes": [
{
"class": "MC_ALERT_USER_READ",
"fields": [ "client_oid:string","user_oid:string","alert_id:string"],
//"fields": [ "alert_id:string"],
"type": "UNIQUE"
}
]
}
}
}

我需要创建边缘以通过alert_id在alert和userRead之间建立关系。