Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3BCDC19226 for ; Wed, 13 Apr 2016 06:24:26 +0000 (UTC) Received: (qmail 87927 invoked by uid 500); 13 Apr 2016 06:24:25 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 87889 invoked by uid 500); 13 Apr 2016 06:24:25 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 87875 invoked by uid 99); 13 Apr 2016 06:24:25 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Apr 2016 06:24:25 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 7C2382C1F5C for ; Wed, 13 Apr 2016 06:24:25 +0000 (UTC) Date: Wed, 13 Apr 2016 06:24:25 +0000 (UTC) From: "Alex Petrov (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (CASSANDRA-10624) Support UDT in CQLSSTableWriter MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-10624?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15238694#comment-15238694 ] Alex Petrov edited comment on CASSANDRA-10624 at 4/13/16 6:23 AM: ------------------------------------------------------------------ Thank you for the review! I've addressed all the comments: * I think I've got this {{static}} habit from Clojure :/ static methods for utility class. Also, it's easy to check / make sure you didn't miss any dep on the surrounding class. I should've removed it before commit. * added IDE rule to do it as you say (group imports with {{\*}}). I think the order was alphabetical ({{c.d.driver.\*}} vs {{c.a.cassandra.\*}}) * and removed blank lines (missed those somehow) |*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/]| (it should not influence anything as it's mostly minor changes, although rerunning utests just in case) was (Author: ifesdjeen): Thank you for the review! I've addressed all the comments: * I think I've got this {{static}} habit from Clojure :/ static methods for utility class. Also, it's easy to check / make sure you didn't miss any dep on the surrounding class. I should've removed it before commit. * added IDE rule to do it as you say (group imports with '*'). I think the order was alphabetical ({{c.d.driver.*}} vs {{c.a.cassandra.*}}) * and removed blank lines (missed those somehow) |*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/]| (it should not influence anything as it's mostly minor changes, although rerunning utests just in case) > 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" > + ")"; > 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)