API for getting data type(as CassDataType) of a table columns.

15 views
Skip to first unread message

Ya Jin

unread,
Jul 22, 2015, 4:05:50 PM7/22/15
to DataStax C++ Driver for Apache Cassandra User Mailing List
e.g.
CREATE TABLE example (
id timeuuid PRIMARY KEY,
address frozen<address>
)

Address is a UDT.

Is there a way that I get the data types of the columns in the table: example?

I will appreciate your help!

Thanks,

Yang

Ya Jin

unread,
Jul 22, 2015, 4:19:19 PM7/22/15
to DataStax C++ Driver for Apache Cassandra User Mailing List, jybi...@gmail.com
Find a way:
const char* query = "SELECT * FROM udt";
statement = cass_statement_new(query, 0);
future = cass_session_execute(session, statement);
cass_future_wait(future);
result = cass_future_get_result(future);
CassDataType* dataType = cass_result_column_data_type(result, 1);
Reply all
Reply to author
Forward
0 new messages