Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 97D56200CBF for ; Sat, 24 Jun 2017 07:53:05 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 96476160BF2; Sat, 24 Jun 2017 05:53:05 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id DBD55160BE5 for ; Sat, 24 Jun 2017 07:53:04 +0200 (CEST) Received: (qmail 52253 invoked by uid 500); 24 Jun 2017 05:53:03 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 52242 invoked by uid 99); 24 Jun 2017 05:53:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 24 Jun 2017 05:53:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 357A8C214B for ; Sat, 24 Jun 2017 05:53:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.21 X-Spam-Level: X-Spam-Status: No, score=-99.21 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, URIBL_BLOCKED=0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id xJo7ihuJYeP2 for ; Sat, 24 Jun 2017 05:53:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 29AC05FC3D for ; Sat, 24 Jun 2017 05:53:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 4C9D7E0069 for ; Sat, 24 Jun 2017 05:53:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 0A17421940 for ; Sat, 24 Jun 2017 05:53:00 +0000 (UTC) Date: Sat, 24 Jun 2017 05:53:00 +0000 (UTC) From: "Michael Shuler (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CASSANDRA-13633) Data not loading to keyspace using sstable create via CQLSSTableWriter MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sat, 24 Jun 2017 05:53:05 -0000 [ https://issues.apache.org/jira/browse/CASSANDRA-13633?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Michael Shuler updated CASSANDRA-13633: --------------------------------------- Fix Version/s: (was: 3.10) 3.11.x > Data not loading to keyspace using sstable create via CQLSSTableWriter > ---------------------------------------------------------------------- > > Key: CASSANDRA-13633 > URL: https://issues.apache.org/jira/browse/CASSANDRA-13633 > Project: Cassandra > Issue Type: Bug > Components: Tools > Environment: Linux > Reporter: Arpan Khandelwal > Fix For: 3.11.x > > Attachments: dataloading_result.png > > > Scenario : Need to read CSV, Write SSTable using CQLSSTableWriter and load it to the keyspace. [Explained here|https://stackoverflow.com/questions/44713777/json-cassandra-field-value-parsing-using-antlr4] . That was not working so tried a simple test case available here[https://github.com/apache/cassandra/blob/cassandra-3.11/test/unit/org/apache/cassandra/io/sstable/CQLSSTableWriterTest.java#L378] > Which did not worked either. Following is what i tried. > Created cql_keyspace3 with below table and types. > {code:java} > CREATE TYPE cql_keyspace3.tuple2 (a int, b int); > CREATE TYPE cql_keyspace3.tuple3 (a int, b int, c int) > CREATE TABLE cql_keyspace3.table3 ( k int, v1 list>, v2 frozen, PRIMARY KEY (k)); > {code} > ran code > {code:java} > final String KS = "cql_keyspace3"; > final String TABLE = "table3"; > final String schema = "CREATE TABLE " + KS + "." + TABLE + " (" + " k int," + " v1 list>," > + " v2 frozen," + " PRIMARY KEY (k)" + ")"; > File tempdir = Files.createTempDir(); > File dataDir = new File(tempdir.getAbsolutePath() + File.separator + KS + File.separator + TABLE); > System.out.println(dataDir); > assert dataDir.mkdirs(); > CQLSSTableWriter writer = CQLSSTableWriter.builder().inDirectory(dataDir) > .withType("CREATE TYPE " + KS + ".tuple2 (a int, b int)") > .withType("CREATE TYPE " + KS + ".tuple3 (a int, b int, c int)").forTable(schema) > .using("INSERT INTO " + KS + "." + TABLE + " (k, v1, v2) " + "VALUES (?, ?, ?)").build(); > > > UserType tuple2Type = writer.getUDType("tuple2"); > UserType tuple3Type = writer.getUDType("tuple3"); > for (int i = 0; i < 100; i++) { > writer.addRow(i, > ImmutableList.builder().add(tuple2Type.newValue().setInt("a", i * 10).setInt("b", i * 20)) > .add(tuple2Type.newValue().setInt("a", i * 30).setInt("b", i * 40)).build(), > tuple3Type.newValue().setInt("a", i * 100).setInt("b", i * 200).setInt("c", i * 300)); > } > writer.close(); > {code} > It generated sstable in "/tmp/1498224996687-0/cql_keyspace3" dir > Loaded data using following command > {code:java} > /tmp/1498224996687-0/cql_keyspace3 $ sstableloader -d localhost table3-e6e0fa61581911e78be6a72ebce4c745/ > Established connection to initial hosts > Opening sstables and calculating sections to stream > Streaming relevant part of /tmp/1498224996687-0/cql_keyspace3/table3-e6e0fa61581911e78be6a72ebce4c745/mc-2-big-Data.db to [localhost/127.0.0.1] > progress: [localhost/127.0.0.1]0:1/1 100% total: 100% 1.060KiB/s (avg: 1.060KiB/s) > progress: [localhost/127.0.0.1]0:1/1 100% total: 100% 0.000KiB/s (avg: 0.984KiB/s) > Summary statistics: > Connections per host : 1 > Total files transferred : 1 > Total bytes transferred : 5.572KiB > Total duration : 5668 ms > Average transfer rate : 0.982KiB/s > Peak transfer rate : 1.060KiB/s > {code} > ||k||v1||v2|| > |92|[{a:920,b:1840}, {a:2760,b:3680}]| > find full result in attached snapshot. > Please let me know which version of cassandra I should which can allow me to load reseverd types, collections, UDT from sstable create using CQLSSTableWriter. -- This message was sent by Atlassian JIRA (v6.4.14#64029) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org For additional commands, e-mail: commits-help@cassandra.apache.org