[
https://issues.apache.org/jira/browse/CASSANDRA-10624?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15228006#comment-15228006
]
Alex Petrov edited comment on CASSANDRA-10624 at 4/6/16 9:12 PM:
-----------------------------------------------------------------
[~Stefania] thanks a lot for the review and kind words!
I've incorporated your changes and suggestions, and went a step further and
reused `types` straight from {{KeyspaceMetadata}} instead of keeping them
within builder. Also, simplified code in {{getTableMetadata}} (removed
unnecessary casts). I've pushed it again to the same branch (link below).
* {{getTableMetadata}} is now a part of the {{forTable}}, with removed
commend and added check for statement type
* mispositioned curly brackets are fixed by now. Sorry about that: old habit,
forgot to auto-format.
|*branch*|*testall*|*dtest*|
|[trunk|https://github.com/ifesdjeen/cassandra/tree/10624-trunk]|[testall|http://cassci.datastax.com/view/Dev/view/ifesdjeen/job/ifesdjeen-10624-trunk-testall/]|[dtest|http://cassci.datastax.com/view/Dev/view/ifesdjeen/job/ifesdjeen-10624-trunk-dtest/]|
was (Author: ifesdjeen):
[~Stefania] thanks a lot for the review and kind words!
I've incorporated your changes and suggestions, and went a step further and
reused `types` straight from {{KeyspaceMetadata}} instead of keeping them
within builder. Also, simplified code in {{getTableMetadata}} (removed
unnecessary casts). I've pushed it again to the same branch (link below).
* {{getTableMetadata}} is now a part of the {{forTable}}, with removed
commend and added check for statement type
* mispositioned curly brackets are fixed by now. Sorry about that: old habit,
forgot to auto-format.
Sorry about lack of CI for my changes: I've already requested it, it's in
process.
|*branch*|*testall*|*dtest*|
|[trunk|https://github.com/ifesdjeen/cassandra/tree/10624-trunk]|[testall|http://cassci.datastax.com/view/Dev/view/ifesdjeen/job/ifesdjeen-10624-trunk-testall/]|[dtest|http://cassci.datastax.com/view/Dev/view/ifesdjeen/job/ifesdjeen-10624-trunk-dtest/]|
> Support UDT in CQLSSTableWriter
> -------------------------------
>
> Key: CASSANDRA-10624
> URL: https://issues.apache.org/jira/browse/CASSANDRA-10624
> Project: Cassandra
> Issue Type: Improvement
> Components: CQL
> Reporter: Sylvain Lebresne
> Assignee: Alex Petrov
> Fix For: 3.x
>
> Attachments: 0001-Add-support-for-UDTs-to-CQLSStableWriter.patch,
> 0001-Support-UDTs-in-CQLSStableWriterV2.patch
>
>
> 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
(v6.3.4#6332)