orientdb - 导入csv上的错误 - 管理员凭据

时间:2016-08-03 12:36:15

标签: orientdb

我使用orientdb 2.2.4 / 2.2.5 / 2.2.6通过oetl导入和边缘。在所有版本中,错误都是相同的。如果我使用版本2.1,则不会发生错误。

我的json文件是

    {
    "config": {
      "log": "info",
              "parallel": false
    },
    "source": {
      "file": {
        "path": "/opt/orientdb/csvs_1milhao/metodo03/a10a.csv"
      }
    },
    "extractor": {
      "row": {
      }
    },
    "transformers": [{
      "csv": {
        "separator": ",",
        "columnsOnFirstLine": true,
        "columns": ["psq_id_from:integer",
        "pro_id_to:integer",
        "ordem:integer"]
      }
    },
    {
      "command": {
        "command": "create edge PUBLICOU from (SELECT FROM index:Pesquisador.psq_id WHERE key = ${input.psq_id_from}) to   (SELECT FROM index:Producao.pro_id where key = ${input.pro_id_to})",
        "output": "edge"
      }
    }],
    "loader": {
      "orientdb": {
        "dbURL": "remote:localhost/dbUmMilhaoM03", 
        "dbUser": "admin",
        "dbPassword": "admin",
        "dbURL": "remote:localhost/dbUmMilhaoM03", 
        "dbType": "graph",
        "standardElementConstraints": false,
        "batchCommit": 1000,
        "classes": [{
            "name": "PUBLICOU",
            "extends": "E"
        }]
      }
    }
}

当我执行oetl命令时,结果是:

        root@teste:/opt/orientdb_226/bin# ./oetl.sh /opt/orientdb_226/scripts_orientdb/Db1Milhao/metodo03/a10a_psq_publicou_pro.json >> log_m03
Exception in thread "main" com.orientechnologies.orient.core.exception.OConfigurationException: Error on creating ETL processor
    at com.orientechnologies.orient.etl.OETLProcessor.parse(OETLProcessor.java:225)
    at com.orientechnologies.orient.etl.OETLProcessor.parse(OETLProcessor.java:176)
    at com.orientechnologies.orient.etl.OETLProcessor.parseConfigAndParameters(OETLProcessor.java:144)
    at com.orientechnologies.orient.etl.OETLProcessor.main(OETLProcessor.java:108)
Caused by: com.orientechnologies.orient.etl.loader.OLoaderException: unable to manage remote db without server admin credentials
    at com.orientechnologies.orient.etl.loader.OOrientDBLoader.manageRemoteDatabase(OOrientDBLoader.java:447)
    at com.orientechnologies.orient.etl.loader.OOrientDBLoader.configure(OOrientDBLoader.java:391)
    at com.orientechnologies.orient.etl.OETLProcessor.configureComponent(OETLProcessor.java:448)
    at com.orientechnologies.orient.etl.OETLProcessor.configureLoader(OETLProcessor.java:262)
    at com.orientechnologies.orient.etl.OETLProcessor.parse(OETLProcessor.java:209)
    ... 3 more

当我使用OrientDb 2.1执行时,结果为:

Exception in thread "main" com.orientechnologies.orient.etl.OETLProcessHaltedException: com.orientechnologies.orient.core.exception.OCommandExecutionException: Source vertex '#-1:-1' not exists

但索引存在

 Name   Type    Class   Properties  Engine  Actions
Atuacao.atu_id  UNIQUE  Atuacao     [atu_id]    SBTREE  
dictionary  DICTIONARY      [undefined]     SBTREE  
Instituicao.ins_id  UNIQUE  Instituicao     [ins_id]    SBTREE  
ORole.name  UNIQUE  ORole   [name]  SBTREE  
OUser.name  UNIQUE  OUser   [name]  SBTREE  
Pais.pai_id     UNIQUE  Pais    [pai_id]    SBTREE  
Pesquisador.psq_id  UNIQUE  Pesquisador     [psq_id]    SBTREE  
Producao.pro_id     UNIQUE  Producao    [pro_id]    SBTREE  
Publicacao.pub_id   UNIQUE  Publicacao  [pub_id]    SBTREE  
TipoPublicacao.tpu_id   UNIQUE  TipoPublicacao  [tpu_id]    SBTREE 

这是一个Orientdb错误吗?

1 个答案:

答案 0 :(得分:0)

尝试这个作为你的命令:

"command": "create edge PUBLICOU from (SELECT expand(rid) FROM index:Pesquisador.psq_id WHERE key = ${input.psq_id_from}) to   (SELECT expand(rid) FROM index:Producao.pro_id where key = ${input.pro_id_to})"

这应该有效,因为当您从索引中选择与结果记录关联的rid时,属于rid属性。

甚至更好您可以直接从课程中选择而不是索引:

create edge PUBLICOU from (SELECT FROM Pesquisador WHERE psq_id = ${input.psq_id_from}) to   (SELECT FROM Producao where pro_id = ${input.pro_id_to})

以这种方式使用索引。

example

伊万