Issue Inserting Nested User Defined Types

31 views
Skip to first unread message

Ryan Whitfield

unread,
Aug 4, 2015, 5:31:32 PM8/4/15
to DataStax C++ Driver for Apache Cassandra User Mailing List
I have a relatively complex data structure that I would like to store in a column, and I have made a number of nested user defined types, but I cannot figure out how to properly insert them.

For a more simple example I tried to insert rows with the following data structure:
parent {
name text,
nested frozen<nest>
}
frozen {
val1 int,
val2 int
}

My query looks like this:
INSERT INTO wt.test_table (key, val) VALUES (?,?)
When I try to bind the parent type to val, I get CASS_ERROR_LIB_INVALID_VALUE_TYPE. The query runs to completion, but val is null. Any guidance?

example.cpp

Michael Penick

unread,
Aug 5, 2015, 3:27:45 PM8/5/15
to cpp-dri...@lists.datastax.com
Thanks for bringing this to our attention. It's a bug in the driver. It'll be fixed in the next release. As a stop gap, you can use "varchar" instead of "text" (it's just an alias for "varchar") for string fields in UDTs.


To unsubscribe from this group and stop receiving emails from it, send an email to cpp-driver-us...@lists.datastax.com.

Reply all
Reply to author
Forward
0 new messages