cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From S G <>
Subject Using datastax driver, how can I read a non-primitive column as a JSON string?
Date Thu, 23 Mar 2017 17:08:30 GMT

I have several non-primitive columns in my cassandra tables.
Some of them are user-defined-types UDTs.

While querying them through datastax driver, I want to convert such UDTs
into JSON values.
More specifically, I want to get JSON string for the value object below:

            Row row =;

            ColumnDefinitions cds = row.getColumnDefinitions();

            cds.asList().forEach((ColumnDefinitions.Definition cd) -> {

                String name = cd.getName();

                Object value = row.getObject(name);


I have gone through

But I do not want to add a codec for every UDT I have.

Can the driver somehow return me direct JSON without explicit meddling with
codecs and all?



View raw message