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 2E887D3AA for ; Tue, 18 Sep 2012 17:58:08 +0000 (UTC) Received: (qmail 21819 invoked by uid 500); 18 Sep 2012 17:58:08 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 21764 invoked by uid 500); 18 Sep 2012 17:58:08 -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 21755 invoked by uid 99); 18 Sep 2012 17:58:07 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Sep 2012 17:58:07 +0000 Date: Wed, 19 Sep 2012 04:58:07 +1100 (NCT) From: "paul cannon (JIRA)" To: commits@cassandra.apache.org Message-ID: <2111776063.93359.1347991087977.JavaMail.jiratomcat@arcas> In-Reply-To: <1886138383.19025.1346368507597.JavaMail.jiratomcat@arcas> Subject: [jira] [Commented] (CASSANDRA-4594) COPY TO and COPY FROM don't default to consistent ordering of columns 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-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13457999#comment-13457999 ] paul cannon commented on CASSANDRA-4594: ---------------------------------------- Aleksey: you must be missing the patch for this ticket. It includes a change to the cql_protect_name function to encode unicode names in utf8 when necessary. Using {{str}} won't work when there are non-ascii characters and the default encoding is not utf8. > COPY TO and COPY FROM don't default to consistent ordering of columns > --------------------------------------------------------------------- > > Key: CASSANDRA-4594 > URL: https://issues.apache.org/jira/browse/CASSANDRA-4594 > Project: Cassandra > Issue Type: Bug > Environment: Happens in CQLSH 2, may or may not happen in CQLSH 3 > Reporter: Tyler Patterson > Assignee: paul cannon > Priority: Minor > Labels: cqlsh > Fix For: 1.1.6 > > Attachments: lazy-fix.txt > > > Here is the input: > {code} > CREATE KEYSPACE test WITH strategy_class = 'SimpleStrategy' AND strategy_options:replication_factor = 1; > USE test; > > CREATE TABLE airplanes ( > name text PRIMARY KEY, > manufacturer ascii, > year int, > mach float > ); > > INSERT INTO airplanes (name, manufacturer, year, mach) VALUES ('P38-Lightning', 'Lockheed', 1937, '.7'); > > COPY airplanes TO 'temp.cfg' WITH HEADER=true; > > TRUNCATE airplanes; > > COPY airplanes FROM 'temp.cfg' WITH HEADER=true; > > SELECT * FROM airplanes; > {code} > Here is what happens when executed. Note how it tried to import the float into the int column: > {code} > cqlsh:test> DROP KEYSPACE test; > cqlsh:test> CREATE KEYSPACE test WITH strategy_class = 'SimpleStrategy' AND strategy_options:replication_factor = 1; > cqlsh:test> USE test; > cqlsh:test> > cqlsh:test> CREATE TABLE airplanes ( > ... name text PRIMARY KEY, > ... manufacturer ascii, > ... year int, > ... mach float > ... ); > cqlsh:test> > cqlsh:test> INSERT INTO airplanes (name, manufacturer, year, mach) VALUES ('P38-Lightning', 'Lockheed', 1937, '.7'); > cqlsh:test> > cqlsh:test> COPY airplanes TO 'temp.cfg' WITH HEADER=true; > 1 rows exported in 0.003 seconds. > cqlsh:test> TRUNCATE airplanes; > cqlsh:test> > cqlsh:test> COPY airplanes FROM 'temp.cfg' WITH HEADER=true; > Bad Request: unable to make int from '0.7' > Aborting import at record #0 (line 1). Previously-inserted values still present. > 0 rows imported in 0.002 seconds. > {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira