使用 pydrill storage_update() 创建 Apache drill 存储

Use pydrill storage_update() to create Apache drill storage

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

RequestError: TransportError(400, 'Unrecognized field "type" (class org.apache.drill.exec.server.rest.PluginConfigWrapper), not marked as ignorable (2 known properties: "config", "name"])\n at [Source: org.glassfish.jersey.message.internal.EntityInputStream@1843f42f; line: 1, column: 138] (through reference chain: org.apache.drill.exec.server.rest.PluginConfigWrapper["type"])') Here is my code:

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)

非常感谢任何帮助!

我找到了解决办法。我们需要将存储名称作为参数传递,并作为配置参数中的 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)

还有宾果游戏!成功了!