Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-4855

SQLFeatureNotSupported with avatica-remote and MariaDB

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.27.0, avatica-1.19.0
    • None
    • avatica
    • None

    Description

      I'm currently experimenting with a Calcite/Avatica-Remote Javaapplicatioin and MariaDB server. 

      When connecting directly to the MariaDB (without Calcite) "jdbc:mariadb://localhost..." my PreparedStatement prepares and executes just fine, the same holds true when using only Calcite "jdbc:calcite:schemaType=JDBC;schema.jdbcUrl=jdbc:mariadb://localhost..."

      But as soon as I start the standalone Avatica server (same MariaDB server, same MariaDB JDBC driver version) and connect through it "jdbc:avatica:remote:url=..." I get the following exception on my clientapplication when preparing my PreparedStatement:

       org.apache.calcite.avatica.AvaticaSqlException: Error -1 (00000) : while preparing SQL: SELECT id FROM ent WHERE col = ?
      	at org.apache.calcite.avatica.Helper.createException(Helper.java:54)
      	at org.apache.calcite.avatica.Helper.createException(Helper.java:41)
      	at org.apache.calcite.avatica.AvaticaConnection.prepareStatement(AvaticaConnection.java:358)
      	at org.apache.calcite.avatica.AvaticaConnection.prepareStatement(AvaticaConnection.java:175)
      

      I started debugging the avatica server and found the cause:

      java.sql.SQLFeatureNotSupportedException: Getting parameter type metadata are not supported
      	at org.mariadb.jdbc.internal.util.exceptions.ExceptionFactory.createException(ExceptionFactory.java:54)
      	at org.mariadb.jdbc.internal.util.exceptions.ExceptionFactory.notSupported(ExceptionFactory.java:172)
      	at org.mariadb.jdbc.MariaDbParameterMetaData.getParameterType(MariaDbParameterMetaData.java:133)
      	at org.apache.calcite.avatica.jdbc.JdbcMeta.parameters(JdbcMeta.java:277)
      	at org.apache.calcite.avatica.jdbc.JdbcMeta.signature(JdbcMeta.java:288)
      	at org.apache.calcite.avatica.jdbc.JdbcMeta.prepare(JdbcMeta.java:721)
      	at org.apache.calcite.avatica.remote.LocalService.apply(LocalService.java:201)
      

      It looks like MariaDB does not support getParameterType(int param): https://jira.mariadb.org/browse/CONJ-568 and https://jira.mariadb.org/browse/MDEV-15031.

      Is there a way to prevent avatica-server from calling this method?

      Attachments

        Activity

          People

            Unassigned Unassigned
            elexx Alexander Falb
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: