Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started

 

question

- avatar image
- asked Erick Ramirez commented

Connecting to DSE via presto-server-348 is throwing SchemaParser error, "UnresolvedUserTypeException: Cannot resolve user type system_distributed.duration"

error message in presto logs:

ERROR Query-20210727_112444_00031_y5ycf-441 com.datastax.driver.core.SchemaParser Error parsing schema from Cassandra system tables: the schema in Cluster#getMetadata() will appear incomplete or stale
com.datastax.driver.core.exceptions.UnresolvedUserTypeException: Cannot resolve user type system_distributed.duration
 at com.datastax.driver.core.DataTypeCqlNameParser.parse(DataTypeCqlNameParser.java:147)
 at com.datastax.driver.core.UserType.build(UserType.java:79)
 at com.datastax.driver.core.SchemaParser.buildUserTypes(SchemaParser.java:196)
 at com.datastax.driver.core.SchemaParser.buildKeyspaces(SchemaParser.java:127)
 at com.datastax.driver.core.SchemaParser.refresh(SchemaParser.java:64)
 at com.datastax.driver.core.ControlConnection.refreshSchema(ControlConnection.java:337)
 at com.datastax.driver.core.ControlConnection.tryConnect(ControlConnection.java:277)
 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.connectAsync(Cluster.java:305)
 at com.datastax.driver.core.Cluster.connect(Cluster.java:247)
 at com.datastax.driver.core.DelegatingCluster.connect(DelegatingCluster.java:71)
 at com.google.common.base.Suppliers$NonSerializableMemoizingSupplier.get(Suppliers.java:167)
 at io.prestosql.plugin.cassandra.CassandraSession.executeWithSession(CassandraSession.java:538)
 at io.prestosql.plugin.cassandra.CassandraSession.getCaseSensitiveSchemaNames(CassandraSession.java:160)
 at io.prestosql.plugin.cassandra.CassandraMetadata.listSchemaNames(CassandraMetadata.java:93)
 at io.prestosql.spi.connector.ConnectorMetadata.schemaExists(ConnectorMetadata.java:56)
 at io.prestosql.metadata.MetadataManager.lambda$schemaExists$0(MetadataManager.java:303)
 at java.base/java.util.stream.MatchOps$1MatchSink.accept(MatchOps.java:90)
 at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
 at java.base/java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958)
 at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:127)
 at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:502)
 at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:488)
 at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
 at java.base/java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:230)
 at java.base/java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:196)
 at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
 at java.base/java.util.stream.ReferencePipeline.anyMatch(ReferencePipeline.java:528)
 at io.prestosql.metadata.MetadataManager.schemaExists(MetadataManager.java:303)
 at io.prestosql.sql.rewrite.ShowQueriesRewrite$Visitor.visitShowTables(ShowQueriesRewrite.java:207)
 at io.prestosql.sql.rewrite.ShowQueriesRewrite$Visitor.visitShowTables(ShowQueriesRewrite.java:168)
 at io.prestosql.sql.tree.ShowTables.accept(ShowTables.java:72)
 at io.prestosql.sql.tree.AstVisitor.process(AstVisitor.java:27)
 at io.prestosql.sql.rewrite.ShowQueriesRewrite.rewrite(ShowQueriesRewrite.java:165)
 at io.prestosql.sql.rewrite.StatementRewrite.rewrite(StatementRewrite.java:61)
 at io.prestosql.sql.analyzer.Analyzer.analyze(Analyzer.java:88)
 at io.prestosql.sql.analyzer.Analyzer.analyze(Analyzer.java:83)
 at io.prestosql.execution.SqlQueryExecution.analyze(SqlQueryExecution.java:263)
 at io.prestosql.execution.SqlQueryExecution.<init>(SqlQueryExecution.java:186)
 at io.prestosql.execution.SqlQueryExecution$SqlQueryExecutionFactory.createQueryExecution(SqlQueryExecution.java:768)
 at io.prestosql.dispatcher.LocalDispatchQueryFactory.lambda$createDispatchQuery$0(LocalDispatchQueryFactory.java:129)
 at io.prestosql.$gen.Presto_348____20210727_112343_2.call(Unknown Source)
 at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125)
 at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:69)
 at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78)
 at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
 at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
 at java.base/java.lang.Thread.run(Thread.java:829)

No error in cassandra logs

Error while checking presto-dse (cassandra) through python even though hunt_demo db exists in dse cassandra:

prestodb.exceptions.PrestoUserError: PrestoUserError(type=USER_ERROR, name=SCHEMA_NOT_FOUND, message="line 1:1: Schema 'hunt_demo' does not exist", query_id=20210802_114749_14361_y5ycf)

However, direct connection to dse (cassandra) is working fine and this same presto is able to connect to apache cassandra.

presto
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered Erick Ramirez commented

CASSANDRA-11873 added duration type in Cassandra 3.10 and support was added to the Java driver in version 3.2 (JAVA-1347).

Java driver 3.2 was released all the way back in March 2017 so it appears that your installation is still using a very old version of the driver.

Note that the error is only reported in the driver logs so you will not see it reported in the Cassandra logs.

You will need to upgrade to a newer version of the driver to resolve the issue. Cheers!

2 comments Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

I checked jars in presto, It is using prestosql cassandra jar and I'm using it's latest version from https://mvnrepository.com/artifact/io.trino.cassandra/cassandra-driver/3.1.4-3.. I couldn't find java driver anywhere in presto directory.

0 Likes 0 ·

As you've stated, Presto is using Java driver 3.1.4 which is from February 2017. You'll need to contact Presto support and get them to upgrade to a newer version of the Cassandra Java driver. Cheers!

0 Likes 0 ·