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 2F195200B7D for ; Sat, 10 Sep 2016 20:42:22 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 2DB3B160ABE; Sat, 10 Sep 2016 18:42:22 +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 76229160AA5 for ; Sat, 10 Sep 2016 20:42:21 +0200 (CEST) Received: (qmail 34010 invoked by uid 500); 10 Sep 2016 18:42:20 -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 33997 invoked by uid 99); 10 Sep 2016 18:42:20 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 10 Sep 2016 18:42:20 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 726F92C1B7B for ; Sat, 10 Sep 2016 18:42:20 +0000 (UTC) Date: Sat, 10 Sep 2016 18:42:20 +0000 (UTC) From: "Kuku1 (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (CASSANDRA-12450) CQLSSTableWriter does not allow Update statement MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sat, 10 Sep 2016 18:42:22 -0000 [ https://issues.apache.org/jira/browse/CASSANDRA-12450?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15480229#comment-15480229 ] Kuku1 edited comment on CASSANDRA-12450 at 9/10/16 6:41 PM: ------------------------------------------------------------ The error is different now, but you can see it's trying to use the toolInitialization method Exception in thread "main" java.lang.ExceptionInInitializerError at de.whatever.BulkCassandraImporter.main(BulkCassandraImporter.java:25) Caused by: org.apache.cassandra.exceptions.ConfigurationException: Expecting URI in variable: [cassandra.config]. Found[cassandra.yaml]. Please prefix the file with [file:\\\] for local files and [file:\\\] for remote files. If you are executing this from an external tool, it needs to set Config.setClientMode(true) to avoid loading configuration. at org.apache.cassandra.config.YamlConfigurationLoader.getStorageConfigURL(YamlConfigurationLoader.java:80) at org.apache.cassandra.config.YamlConfigurationLoader.loadConfig(YamlConfigurationLoader.java:100) at org.apache.cassandra.config.DatabaseDescriptor.loadConfig(DatabaseDescriptor.java:251) at org.apache.cassandra.config.DatabaseDescriptor.toolInitialization(DatabaseDescriptor.java:170) at org.apache.cassandra.io.sstable.CQLSSTableWriter.(CQLSSTableWriter.java:101) ... 1 more was (Author: kuku1): The error is different now, but you can see it's trying to use the {code}toolInitialization{code} method Exception in thread "main" java.lang.ExceptionInInitializerError at de.whatever.BulkCassandraImporter.main(BulkCassandraImporter.java:25) Caused by: org.apache.cassandra.exceptions.ConfigurationException: Expecting URI in variable: [cassandra.config]. Found[cassandra.yaml]. Please prefix the file with [file:\\\] for local files and [file:\\\] for remote files. If you are executing this from an external tool, it needs to set Config.setClientMode(true) to avoid loading configuration. at org.apache.cassandra.config.YamlConfigurationLoader.getStorageConfigURL(YamlConfigurationLoader.java:80) at org.apache.cassandra.config.YamlConfigurationLoader.loadConfig(YamlConfigurationLoader.java:100) at org.apache.cassandra.config.DatabaseDescriptor.loadConfig(DatabaseDescriptor.java:251) at org.apache.cassandra.config.DatabaseDescriptor.toolInitialization(DatabaseDescriptor.java:170) at org.apache.cassandra.io.sstable.CQLSSTableWriter.(CQLSSTableWriter.java:101) ... 1 more > CQLSSTableWriter does not allow Update statement > ------------------------------------------------ > > Key: CASSANDRA-12450 > URL: https://issues.apache.org/jira/browse/CASSANDRA-12450 > Project: Cassandra > Issue Type: Bug > Components: Streaming and Messaging > Reporter: Kuku1 > Assignee: Alex Petrov > > CQLSSTableWriter throws Exception when trying to use Update statement. > Has been working fine in previous versions for me. > Code: > {code} > public static void main(String[] args) throws IOException { > final String KS = "test"; > final String TABLE = "data"; > final String schema = "CREATE TABLE " + KS + "." + TABLE > + "(k text, c1 text, c2 text, c3 text, v text, primary key(k, c1,c2,c3))"; > final String query = "UPDATE " + KS + "." + TABLE + " SET v = ? WHERE k = ? and c1 = ? and c2 = ? and c3 = ?"; > File dataDir = new File(...); > CQLSSTableWriter writer = CQLSSTableWriter.builder().inDirectory(dataDir).forTable(schema).using(query).build(); //Exception here (see below) > HashMap row = new HashMap<>(); > row.put("k", "a"); > row.put("c1", "a"); > row.put("c2", "a"); > row.put("c3", "a"); > row.put("v", "v"); > writer.addRow(row); > writer.close(); > } > {code} > Exception: > {code} > 14:51:00.461 [main] INFO o.a.cassandra.cql3.QueryProcessor - Initialized prepar > ed statement caches with 0 MB (native) and 0 MB (Thrift) > Exception in thread "main" java.lang.IllegalArgumentException: Invalid query, mu > st be a INSERT statement but was: class org.apache.cassandra.cql3.statements.Upd > ateStatement$ParsedUpdate > at org.apache.cassandra.io.sstable.CQLSSTableWriter.parseStatement(CQLSS > TableWriter.java:589) > at org.apache.cassandra.io.sstable.CQLSSTableWriter.access$000(CQLSSTabl > eWriter.java:102) > at org.apache.cassandra.io.sstable.CQLSSTableWriter$Builder.using(CQLSST > ableWriter.java:445) > at CassandraJsonImporter.main(Cassand > raJsonImporter.java:66) > {code} > I'm currently testing it with 3.7 version, my POM looks like this: > {code} > > org.apache.cassandra > cassandra-all > 3.7 > > > org.apache.cassandra > cassandra-clientutil > 3.7 > > > com.datastax.cassandra > cassandra-driver-core > 3.0.0 > > {code} > It has been working with 3.0.8 versions in the POM, but that version is somehow not including the UDT support? > I want to use UPDATE instead of INSERT because I need to append data to lists and do not want to overwrite existing data in the lists. -- This message was sent by Atlassian JIRA (v6.3.4#6332)