Presto JDBC Call statements

506 views Asked by At

Is it possible to execute CALL system.sync_partition_metadata('dummy','dummy','FULL') using JDBC as Presto JDBC driver does not support CallableStatements?

1

There are 1 answers

1
Piotr Findeisen On

Presto JDBC driver does not support io.prestosql.jdbc.PrestoConnection#prepareCall methods (please file an issue), but you can use Statement for this:

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");
    }
}

(BTW you can get always get more help with Presto on Trino (formerly Presto SQL) community slack)