# Presto \<\> YugaByte connector (Cassandra Version issue)

**URL:** https://forum.yugabyte.com/t/presto-yugabyte-connector-cassandra-version-issue/157
**Category:** General
**Created:** [May 18, 2018, 12:06pm UTC](https://forum.yugabyte.com/t/presto-yugabyte-connector-cassandra-version-issue/157 "2018-05-18T12:06:11Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![rajesh.sarda](https://avatars.discourse-cdn.com/v4/letter/r/8e7dd6/32.png) [@rajesh.sarda](https://forum.yugabyte.com/u/rajesh.sarda)
#### Post date: [May 18, 2018, 12:06pm UTC](https://forum.yugabyte.com/t/presto-yugabyte-connector-cassandra-version-issue/157/1 "2018-05-18T12:06:11Z")

</div>

Hi

We are trying to connect cassandra through presto (version 0.200) & getting following error  
Query 20180518\_115855\_00035\_fjx8t failed: Cassandra versions prior to 2.1.5 are not supported  
com.facebook.presto.spi.PrestoException: Cassandra versions prior to 2.1.5 are not supported

pl. confirm which version of Cassandra installed with YugaDB ?

---

<div class="post-metadata">

### Author: ![karthik](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.yugabyte.com/karthik/32/13_2.png) [@karthik](https://forum.yugabyte.com/u/karthik)
#### Post date: [May 18, 2018, 4:00pm UTC](https://forum.yugabyte.com/t/presto-yugabyte-connector-cassandra-version-issue/157/2 "2018-05-18T16:00:33Z")

</div>

YugaByte supports Cassandra Query Language v3.

[This link](https://docs.datastax.com/en/developer/java-driver/3.5/manual/native_protocol/#compatibility-matrix) has a table with Cassandra compatibility, the image is uploaded below for convenience. YugaByte supports the equivalent of the last row (3.x).

 ![58%20AM](https://canada1.discourse-cdn.com/flex027/uploads/yugabyte/original/1X/a0b6d89d8fd408284134572e1eb02fa0bc74496d.png)

A couple of questions:

- Do you know the version of the Cassandra client that Presto uses?
- What language is the driver in (assuming Java but wanted to clarify).

Additionally (more an FYI), for best performance, you could use the YugaByte native client for Cassandra (no code change necessary, just link to a different binary if you are using Java). The details are here: [Develop applications | YugabyteDB Docs](https://docs.yugabyte.com/latest/develop/client-drivers/java/)

cc @rpang @mihnea

---

<div class="post-metadata">

### Author: ![rajesh.sarda](https://avatars.discourse-cdn.com/v4/letter/r/8e7dd6/32.png) [@rajesh.sarda](https://forum.yugabyte.com/u/rajesh.sarda)
#### Post date: [May 21, 2018, 9:17am UTC](https://forum.yugabyte.com/t/presto-yugabyte-connector-cassandra-version-issue/157/3 "2018-05-21T09:17:24Z")

</div>

Hi

We have raise the query with presto to get the information of cassandra client version.  
[Presto cassandra connector](https://prestodb.io/docs/current/connector/cassandra.html)  
Will get back to you once received answer.

Thanks

---

<div class="post-metadata">

### Author: ![kannan](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.yugabyte.com/kannan/32/18_2.png) [@kannan](https://forum.yugabyte.com/u/kannan)
#### Post date: [May 21, 2018, 3:15pm UTC](https://forum.yugabyte.com/t/presto-yugabyte-connector-cassandra-version-issue/157/4 "2018-05-21T15:15:31Z")

</div>

@rpang, @pritam.damania:

Looking at the presto source, the error message comes from this block:

```
private void checkSizeEstimatesTableExist()
{
 	KeyspaceMetadata keyspaceMetadata = executeWithSession(session -> session.getCluster().getMetadata().getKeyspace(SYSTEM));
    checkState(keyspaceMetadata != null, "system keyspace metadata must not be null");
    TableMetadata table = keyspaceMetadata.getTable(SIZE_ESTIMATES);
    if (table == null) {
        throw new PrestoException(NOT_SUPPORTED, "Cassandra versions prior to 2.1.5 are not supported");
    }
}

```

So the Cassandra Driver version info issue is perhaps misleading, and maybe it is just because we just haven’t implemented the “system.size\_estimates” system table. [This call `keyspaceMetadata.getTable(SIZE_ESTIMATES)` seems to be returning NULL.]

---

<div class="post-metadata">

### Author: ![kannan](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.yugabyte.com/kannan/32/18_2.png) [@kannan](https://forum.yugabyte.com/u/kannan)
#### Post date: [May 22, 2018, 4:27am UTC](https://forum.yugabyte.com/t/presto-yugabyte-connector-cassandra-version-issue/157/5 "2018-05-22T04:27:15Z")

</div>

@rajesh.sarda:

We have created [[ycql] add support for system.size\_estimates system table in YugaByte YCQL · Issue #296 · yugabyte/yugabyte-db · GitHub](https://github.com/YugaByte/yugabyte-db/issues/296) to track this issue. Thanks for reporting the same.

---

<div class="post-metadata">

### Author: ![kannan](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.yugabyte.com/kannan/32/18_2.png) [@kannan](https://forum.yugabyte.com/u/kannan)
#### Post date: [June 2, 2018, 5:48am UTC](https://forum.yugabyte.com/t/presto-yugabyte-connector-cassandra-version-issue/157/6 "2018-06-02T05:48:23Z")

</div>

Hi @rajesh.sarda:

This issue with Presto not being able to talk to YugaByte has been addressed.

There were two enhancements needed on YugaByte side (issue [[ycql] add support for system.size\_estimates system table in YugaByte YCQL · Issue #296 · yugabyte/yugabyte-db · GitHub](https://github.com/YugaByte/yugabyte-db/issues/296) & [not seeing all rows when using Presto against YugaByte using Cassandra connector · Issue #312 · yugabyte/yugabyte-db · GitHub](https://github.com/YugaByte/yugabyte-db/issues/312)).

The 1.0.3.0 version of YugaByte ([now available for download](https://docs.yugabyte.com/latest/quick-start/install/)) can now be queried via Presto.

For example, in YugaByte I created this sample table:

```
create keyspace IF NOT EXISTS app;
use app;

drop table if exists msg;
create table msg (userid int, msgid int, msgtext text, PRIMARY KEY ((userid), msgid));

insert into msg (userid, msgid, msgtext) values (1, 1, 'a');
insert into msg (userid, msgid, msgtext) values (1, 2, 'b');
insert into msg (userid, msgid, msgtext) values (1, 3, 'c');
insert into msg (userid, msgid, msgtext) values (1, 4, 'd');

insert into msg (userid, msgid, msgtext) values (2, 1, 'a');
insert into msg (userid, msgid, msgtext) values (2, 2, 'b');
insert into msg (userid, msgid, msgtext) values (2, 3, 'c');
insert into msg (userid, msgid, msgtext) values (2, 4, 'd');

insert into msg (userid, msgid, msgtext) values (3, 1, 'a');
insert into msg (userid, msgid, msgtext) values (3, 2, 'b');
insert into msg (userid, msgid, msgtext) values (3, 3, 'c');
insert into msg (userid, msgid, msgtext) values (3, 4, 'd');

insert into msg (userid, msgid, msgtext) values (4, 1, 'a');
insert into msg (userid, msgid, msgtext) values (4, 2, 'b');
insert into msg (userid, msgid, msgtext) values (4, 3, 'c');
insert into msg (userid, msgid, msgtext) values (4, 4, 'd');

```

Next, configured Presto to point to YugaByte using the Cassandra connector (by configuring etc/catalog/cassandra,properties of Presto server accordingly).

And then from presto CLI, you can query the tables in YugaByte:

```
$ ./bin/presto --server localhost:8080 --catalog cassandra --schema app

presto:app> select userid, count(msgid) from msg group by userid order by userid asc;
 userid | _col1
--------+-------
      1 | 4
      2 | 4
      3 | 4
      4 | 4
(4 rows)

```

---

<div class="post-metadata">

### Author: ![rajesh.sarda](https://avatars.discourse-cdn.com/v4/letter/r/8e7dd6/32.png) [@rajesh.sarda](https://forum.yugabyte.com/u/rajesh.sarda)
#### Post date: [June 4, 2018, 10:38am UTC](https://forum.yugabyte.com/t/presto-yugabyte-connector-cassandra-version-issue/157/7 "2018-06-04T10:38:22Z")

</div>

Hi Kannan

Thanks for solution, we are able to check same & it’s working fine.

Regards
