Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-16005

sstableloader cannot parse schema of tables with CQL duration type

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Normal
    • Resolution: Unresolved
    • Fix Version/s: 3.11.x
    • Component/s: Tool/bulk load
    • Labels:
      None
    • Bug Category:
      Correctness - Recoverable Corruption / Loss
    • Severity:
      Normal
    • Complexity:
      Normal
    • Discovered By:
      User Report
    • Platform:
      All
    • Impacts:
      None

      Description

      Symptom

      A user reported issues bulk loading data with sstableloader on C* 3.11 for a table with columns of type duration:

      ERROR 17:38:10,726 Error parsing schema for table datakeyspace.retrylog: Cluster.getMetadata().getKeyspace("datakeyspace").getTable("retrylog") will be missing or incomplete
      com.datastax.driver.core.exceptions.UnresolvedUserTypeException: Cannot resolve user type datakeyspace.duration
              at com.datastax.driver.core.DataTypeCqlNameParser.parse(DataTypeCqlNameParser.java:147) ~[cassandra-driver-core-3.0.1-shaded.jar:na]
              at com.datastax.driver.core.TableMetadata.build(TableMetadata.java:188) ~[cassandra-driver-core-3.0.1-shaded.jar:na]
              at com.datastax.driver.core.SchemaParser.buildTables(SchemaParser.java:176) [cassandra-driver-core-3.0.1-shaded.jar:na]
              at com.datastax.driver.core.SchemaParser.buildKeyspaces(SchemaParser.java:128) [cassandra-driver-core-3.0.1-shaded.jar:na]
              at com.datastax.driver.core.SchemaParser.refresh(SchemaParser.java:64) [cassandra-driver-core-3.0.1-shaded.jar:na]
              at com.datastax.driver.core.ControlConnection.refreshSchema(ControlConnection.java:343) [cassandra-driver-core-3.0.1-shaded.jar:na]
              at com.datastax.driver.core.ControlConnection.tryConnect(ControlConnection.java:273) [cassandra-driver-core-3.0.1-shaded.jar:na]
              at com.datastax.driver.core.ControlConnection.reconnectInternal(ControlConnection.java:201) [cassandra-driver-core-3.0.1-shaded.jar:na]
              at com.datastax.driver.core.ControlConnection.connect(ControlConnection.java:79) [cassandra-driver-core-3.0.1-shaded.jar:na]
              at com.datastax.driver.core.Cluster$Manager.init(Cluster.java:1424) [cassandra-driver-core-3.0.1-shaded.jar:na]
              at com.datastax.driver.core.Cluster.init(Cluster.java:163) [cassandra-driver-core-3.0.1-shaded.jar:na]
              at com.datastax.driver.core.Cluster.connectAsync(Cluster.java:334) [cassandra-driver-core-3.0.1-shaded.jar:na]
              at com.datastax.driver.core.Cluster.connectAsync(Cluster.java:309) [cassandra-driver-core-3.0.1-shaded.jar:na]
              at com.datastax.driver.core.Cluster.connect(Cluster.java:251) [cassandra-driver-core-3.0.1-shaded.jar:na]
              at org.apache.cassandra.utils.NativeSSTableLoaderClient.init(NativeSSTableLoaderClient.java:73) [apache-cassandra-3.11.3.jar:3.11.3]
      

      Cause

      Support for duration type was added to Java driver 3.2.0 (JAVA-1347). The shaded driver included in Cassandra 3.11 is old and does support the duration type:

      lib/cassandra-driver-core-3.0.1-shaded.jar
      

      Workaround

      Step 1 - Download a newer version of the Java driver from Maven in the same 3.x family. For example:
      https://mvnrepository.com/artifact/com.datastax.cassandra/cassandra-driver-core/3.10.0

      Step 2 - Swap out the old JAR with cassandra-driver-core-3.10.0-shaded.jar.

      Step 3 - Re-run sstableloader.

      Solution

      I recommend we update the Java driver version in the next patch release of C* 3.11.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              flightc Erick Ramirez
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: