【问题标题】:Use pydrill storage_update() to create Apache drill storage使用 pydrill storage_update() 创建 Apache Drill 存储
【发布时间】:2018-05-22 10:57:19
【问题描述】:

我正在尝试使用 pydrill 创建 MySQL apache Drill 存储插件。它正在抛出错误:

RequestError: TransportError(400, 'Unrecognized field "type" (class org.apache.drill.exec.server.rest.PluginConfigWrapper),未标记为可忽略(2 个已知属性:“config”、“name”]) \n 在 [Source: org.glassfish.jersey.message.internal.EntityInputStream@1843f42f; line: 1, column: 138] (通过参考链:org.apache.drill.exec.server.rest.PluginConfigWrapper["type" ])') 这是我的代码:

drill = PyDrill(host='host',port='8047',user='xx')

configu = '{"type": "jdbc","driver": "com.mysql.jdbc.Driver","url": "jdbc:mysql://host:3306","username": "xx","password": "xx",enabled:true}'
drill.storage_update('MySQL1',configu)

非常感谢任何帮助!

【问题讨论】:

    标签: python-3.6 apache-drill pydrill


    【解决方案1】:

    我找到了解决方案。我们需要将存储名称作为参数传递,并在 config 参数中作为 json 'key':'value' 传递。 这是更正后的代码:

    configu={'config': {'driver': 'com.mysql.jdbc.Driver','enabled': True,'password': 'xyz','type': 'jdbc','url': 'jdbc:mysql://host:3306','username': 'xx'},'name':'xxx'}
    
    drill.storage_update('xxx',config=configu)
    

    还有宾果游戏!成功了!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-06-26
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多