quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.87k stars 2.71k forks source link

Add JDBC extension for Presto #11320

Open debae opened 4 years ago

debae commented 4 years ago

Describe the extension

Presto is a distributed SQL query engine designed to query large data sets distributed over one or more heterogeneous data sources. It can be accessed from Java using the JDBC driver.

https://prestosql.io/docs/current/installation/jdbc.html

Interested in this extension, please +1 via the emoji/reaction feature of GitHub (top right).

Configuration suggestion

Most of the parameters can be configured in the jdbc url, but a reference can be found here : https://prestosql.io/docs/current/installation/jdbc.html#parameter-reference

Additional context I tried already to use it in native mode without extension, and the error we get is :

Caused by: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: No instances of sun.security.provider.NativePRNG are allowed in the image heap as this class should be initialized at image runtime. To see how this object got instantiated use -H:+TraceClassInitialization.
Detailed message:
Trace: Object was reached by
        reading field java.security.SecureRandom.secureRandomSpi of
                constant java.security.SecureRandom@6e81615a reached by
        reading field sun.security.ssl.SSLContextImpl.secureRandom of
                constant sun.security.ssl.SSLContextImpl$TLSContext@6815b5c2 reached by
        reading field sun.security.ssl.SSLSocketFactoryImpl.context of
                constant sun.security.ssl.SSLSocketFactoryImpl@2f496dd8 reached by
        reading field io.prestosql.jdbc.$internal.okhttp3.OkHttpClient.sslSocketFactory of
                constant io.prestosql.jdbc.$internal.okhttp3.OkHttpClient@286ee9ba reached by
        reading field io.prestosql.jdbc.PrestoDriver.httpClient of
                constant io.prestosql.jdbc.PrestoDriver@7a84b949 reached by
        reading field java.sql.DriverInfo.driver of
                constant java.sql.DriverInfo@7a84b949 reached by
        indexing into array
                constant java.lang.Object[]@45370db2 reached by
        reading field java.util.concurrent.CopyOnWriteArrayList.array of
                constant java.util.concurrent.CopyOnWriteArrayList@7a84b968 reached by
        scanning method java.sql.DriverManager.getDriver(DriverManager.java:277)
Call path from entry point to java.sql.DriverManager.getDriver(String):
        at java.sql.DriverManager.getDriver(DriverManager.java:269)
        at io.agroal.pool.ConnectionFactory.newDriver(ConnectionFactory.java:104)
Sanne commented 4 years ago

There's also a PR to support it in Hibernate ORM: