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

Cassandra adapter is broken by Guava change

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Resolved
    • Affects Version/s: 1.12.0
    • Fix Version/s: 1.12.0
    • Component/s: cassandra
    • Labels:
      None

      Description

      The Cassandra driver appears to be incompatible with Guava 20. Works fine when downgrading to Guava 18. Stack trace of the exception produced when trying to connect via sqlline below:

      java.lang.NoSuchMethodError: com.google.common.util.concurrent.Futures.transform(Lcom/google/common/util/concurrent/ListenableFuture;Lcom/google/common/util/concurrent/AsyncFunction;Ljava/util/concurrent/Executor;)Lcom/google/common/util/concurrent/ListenableFuture;
              at com.datastax.driver.core.Connection.initAsync(Connection.java:182)
              at com.datastax.driver.core.Connection$Factory.open(Connection.java:796)
              at com.datastax.driver.core.ControlConnection.tryConnect(ControlConnection.java:253)
              at com.datastax.driver.core.ControlConnection.reconnectInternal(ControlConnection.java:201)
              at com.datastax.driver.core.ControlConnection.connect(ControlConnection.java:79)
              at com.datastax.driver.core.Cluster$Manager.init(Cluster.java:1483)
              at com.datastax.driver.core.Cluster.init(Cluster.java:159)
              at com.datastax.driver.core.Cluster.connectAsync(Cluster.java:330)
              at com.datastax.driver.core.Cluster.connect(Cluster.java:280)
              at org.apache.calcite.adapter.cassandra.CassandraSchema.<init>(CassandraSchema.java:109)
              at org.apache.calcite.adapter.cassandra.CassandraSchemaFactory.create(CassandraSchemaFactory.java:40)
              at org.apache.calcite.model.ModelHandler.visit(ModelHandler.java:215)
              at org.apache.calcite.model.JsonCustomSchema.accept(JsonCustomSchema.java:45)
              at org.apache.calcite.model.ModelHandler.visit(ModelHandler.java:143)
              at org.apache.calcite.model.ModelHandler.<init>(ModelHandler.java:85)
              at org.apache.calcite.jdbc.Driver$1.onConnectionInit(Driver.java:104)
              at org.apache.calcite.avatica.UnregisteredDriver.connect(UnregisteredDriver.java:145)
              at sqlline.DatabaseConnection.connect(DatabaseConnection.java:157)
              at sqlline.DatabaseConnection.getConnection(DatabaseConnection.java:203)
              at sqlline.Commands.connect(Commands.java:1064)
              at sqlline.Commands.connect(Commands.java:996)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
              at sqlline.ReflectiveCommandHandler.execute(ReflectiveCommandHandler.java:38)
              at sqlline.SqlLine.dispatch(SqlLine.java:809)
              at sqlline.SqlLine.begin(SqlLine.java:686)
              at sqlline.SqlLine.start(SqlLine.java:398)
              at sqlline.SqlLine.main(SqlLine.java:291)
      

        Activity

        Hide
        julianhyde Julian Hyde added a comment -

        Resolved in release 1.12.0 (2017-03-24).

        Show
        julianhyde Julian Hyde added a comment - Resolved in release 1.12.0 (2017-03-24).
        Hide
        michaelmior Michael Mior added a comment -

        Pushed 1e405d63e which changes the Guava version to 19.0. Verified that all tests pass. Cassandra integration tests still fail due to an unrelated issue with some changes to the planner output. Will fix shortly.

        Show
        michaelmior Michael Mior added a comment - Pushed 1e405d63e which changes the Guava version to 19.0. Verified that all tests pass. Cassandra integration tests still fail due to an unrelated issue with some changes to the planner output. Will fix shortly.
        Hide
        julianhyde Julian Hyde added a comment -

        Let's go with Guava 19.0.

        We can still state that we support Guava versions 14.0.1 - 21.0. JDK 1.7 requires Guava 20.0 or lower; the Cassandra driver requires Guava 19.0 or lower.

        And of course we can revisit when we upgrade our Cassandra driver.

        Show
        julianhyde Julian Hyde added a comment - Let's go with Guava 19.0. We can still state that we support Guava versions 14.0.1 - 21.0. JDK 1.7 requires Guava 20.0 or lower; the Cassandra driver requires Guava 19.0 or lower. And of course we can revisit when we upgrade our Cassandra driver.
        Hide
        michaelmior Michael Mior added a comment -

        Good news is that the next release of the Cassandra driver will provide Guava 20.0 compatibility. See their JIRA and the associated pull request. We could just include a warning in the release notes that anyone using Cassandra will have to explicitly rely on Guava 19.0 and then hopefully have this fixed in the next Calcite release if the Cassandra driver is updated by then.

        Show
        michaelmior Michael Mior added a comment - Good news is that the next release of the Cassandra driver will provide Guava 20.0 compatibility. See their JIRA and the associated pull request . We could just include a warning in the release notes that anyone using Cassandra will have to explicitly rely on Guava 19.0 and then hopefully have this fixed in the next Calcite release if the Cassandra driver is updated by then.
        Hide
        michaelmior Michael Mior added a comment - - edited

        Bad news. The Cassandra driver appears to depend on Guava 16.0.1. It works with 18.0, but not with 20.0. This is due to Futures.transform being renamed to Futures.transformAsync with the old name finally dropped in 20.0. Easiest solution would be to upgrade to 19.0 instead of 20.0 for the time being. (Assuming this doesn't cause any issues with the rest of Calcite.)

        Show
        michaelmior Michael Mior added a comment - - edited Bad news. The Cassandra driver appears to depend on Guava 16.0.1. It works with 18.0, but not with 20.0. This is due to Futures.transform being renamed to Futures.transformAsync with the old name finally dropped in 20.0. Easiest solution would be to upgrade to 19.0 instead of 20.0 for the time being. (Assuming this doesn't cause any issues with the rest of Calcite.)

          People

          • Assignee:
            michaelmior Michael Mior
            Reporter:
            michaelmior Michael Mior
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development