Presto <> YugaByte connector (Cassandra Version issue)

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 ?

YugaByte supports Cassandra Query Language v3.

This link has a table with Cassandra compatibility, the image is uploaded below for convenience. YugaByte supports the equivalent of the last row (3.x).

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

cc @rpang @mihnea

Hi

We have raise the query with presto to get the information of cassandra client version.
Presto cassandra connector
Will get back to you once received answer.

Thanks

@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.]

1 Like

@rajesh.sarda:

We have created [ycql] add support for system.size_estimates system table in YugaByte YCQL · Issue #296 · yugabyte/yugabyte-db · GitHub to track this issue. Thanks for reporting the same.

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 & not seeing all rows when using Presto against YugaByte using Cassandra connector · Issue #312 · yugabyte/yugabyte-db · GitHub).

The 1.0.3.0 version of YugaByte (now available for download) 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)

Hi Kannan

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

Regards

1 Like