【问题标题】:How to create a custom connector for Presto and InfluxDB如何为 Presto 和 InfluxDB 创建自定义连接器
【发布时间】:2017-12-07 09:44:29
【问题描述】:

我正在尝试为 Presto 和 InfluxDB 创建一个自定义连接器,以使 Presto 能够在 InfluxDB 上运行 SQL 查询。是否有任何此类连接器可用的示例?

Connectors are the source of all data for queries in Presto. Even if your data source doesn’t have underlying tables backing it, as long as you adapt your data source to the API expected by Presto, you can write queries against this data.

我找到的用于编写连接器的唯一文档是: https://prestodb.io/docs/current/develop/example-http.html

如果有人有其他例子,可以分享一下吗?

【问题讨论】:

    标签: influxdb presto


    【解决方案1】:

    presto 源代码树中有多个连接器。

    当您连接到具有 JDBC 驱动程序的数据源时(可能不是您的情况),扩展 presto-base-jdbc 驱动程序几乎可以满足您的所有需求。例如见https://github.com/trinodb/trino/tree/master/presto-postgresql

    当您连接到未启用 JDBC 的数据源时(或者您需要更多 presto-base-jdbc 可能提供的数据源),您需要实现所有相关的连接器接口。除了 Java 接口和源代码之外,没有很好的文档,但是您可以按照示例进行操作,例如https://github.com/trinodb/trino/tree/master/presto-cassandra, https://github.com/trinodb/trino/tree/master/presto-accumulo

    另一个选择是 Greg Leclercq 建议实施 Thrift 连接器。请参阅他的answer 了解路线。

    【讨论】:

      【解决方案2】:

      如果您更喜欢使用 Java 以外的编程语言编写代码,另一种选择是实现 Thrift 服务并使用 Thrift connector

      【讨论】:

        猜你喜欢
        • 2017-10-18
        • 1970-01-01
        • 1970-01-01
        • 2017-11-24
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-08-14
        • 1970-01-01
        相关资源
        最近更新 更多