【问题标题】:Presto JDBC Call statementsPresto JDBC 调用语句
【发布时间】:2021-01-21 07:59:22
【问题描述】:

是否可以使用 JDBC 执行 CALL system.sync_partition_metadata('dummy','dummy','FULL'),因为 Presto JDBC 驱动程序不支持 CallableStatements?

【问题讨论】:

  • 为什么不在他们的论坛上提问呢?在他们的Presto Community 页面上提供了链接。

标签: java jdbc presto presto-jdbc


【解决方案1】:

Presto JDBC 驱动程序不支持 io.prestosql.jdbc.PrestoConnection#prepareCall 方法 (please file an issue),但您可以为此使用 Statement

try (Connection connection = DriverManager.getConnection("jdbc:presto://localhost:8080/hive/default", "presto", "")) {
    try (Statement statement = connection.createStatement()) {
        boolean hasResultSet = statement.execute("CALL system.sync_partition_metadata('default', 'table_name', 'FULL')");
        verify(!hasResultSet, "unexpected resultSet");
    }
}

(顺便说一句,您总是可以在 Trino (formerly Presto SQL) community slack 上获得更多有关 Presto 的帮助)

【讨论】:

  • 谢谢皮奥特。我已经为此提交了一个问题。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-12-06
  • 1970-01-01
  • 2011-08-26
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多