cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Petrov (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-10624) Support UDT in CQLSSTableWriter
Date Tue, 05 Apr 2016 08:59:25 GMT


Alex Petrov commented on CASSANDRA-10624:

I've added support for UDTs in CQLSStableWriter. The main problem here was to make a syntax
that would allow user to create user defined types without needing to touch {{ByteBuffer}}
directly, which is now done through the mechanisms similar to {{UDFs}}.

In order to get a {{UDT

It's probably also worth mentioning, as
there's a comment since Dec 2014 in {{UDHelper}}, although the issue itself is closed with

> Support UDT in CQLSSTableWriter
> -------------------------------
>                 Key: CASSANDRA-10624
>                 URL:
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: CQL
>            Reporter: Sylvain Lebresne
>            Assignee: Alex Petrov
>             Fix For: 3.x
> As far as I can tell, there is not way to use a UDT with {{CQLSSTableWriter}} since there
is no way to declare it and thus {{CQLSSTableWriter.Builder}} knows of no UDT when parsing
the {{CREATE TABLE}} statement passed.
> In terms of API, I think the simplest would be to allow to pass types to the builder
in the same way we pass the table definition. So something like:
> {noformat}
> String type = "CREATE TYPE myKs.vertex (x int, y int, z int)";
> String schema = "CREATE TABLE myKs.myTable ("
>               + "  k int PRIMARY KEY,"
>               + "  s set<vertex>"
>               + ")";
> String insert = ...;
> CQLSSTableWriter writer = CQLSSTableWriter.builder()
>                                           .inDirectory("path/to/directory")
>                                           .withType(type)
>                                           .forTable(schema)
>                                           .using(insert).build();
> {noformat}
> I'll note that implementation wise, this might be a bit simpler after the changes of
CASSANDRA-10365 (as it makes it easy to passe specific types during the preparation of the
create statement).

This message was sent by Atlassian JIRA

View raw message