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 428C7200BAF for ; Mon, 31 Oct 2016 07:27:00 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 412B2160B06; Mon, 31 Oct 2016 06:27:00 +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 87FEA160AF0 for ; Mon, 31 Oct 2016 07:26:59 +0100 (CET) Received: (qmail 11149 invoked by uid 500); 31 Oct 2016 06:26:58 -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 11137 invoked by uid 99); 31 Oct 2016 06:26:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 31 Oct 2016 06:26:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 577EB2C14F9 for ; Mon, 31 Oct 2016 06:26:58 +0000 (UTC) Date: Mon, 31 Oct 2016 06:26:58 +0000 (UTC) From: "Stefania (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CASSANDRA-12863) cqlsh COPY FROM cannot parse timestamp in partition key if table contains a counter value MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 31 Oct 2016 06:27:00 -0000 [ https://issues.apache.org/jira/browse/CASSANDRA-12863?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15621403#comment-15621403 ] Stefania commented on CASSANDRA-12863: -------------------------------------- The new test is [here|https://github.com/riptano/cassandra-dtest/pull/1375]. > cqlsh COPY FROM cannot parse timestamp in partition key if table contains a counter value > ----------------------------------------------------------------------------------------- > > Key: CASSANDRA-12863 > URL: https://issues.apache.org/jira/browse/CASSANDRA-12863 > Project: Cassandra > Issue Type: Bug > Components: Tools > Reporter: Stefania > Assignee: Stefania > Fix For: 2.2.x, 3.0.x, 3.x > > > This sample table: > {code} > CREATE TABLE test (columnname text, day timestamp, israndom boolean, columnvalue text, counter counter, PRIMARY KEY ((columnname, day, israndom), columnvalue)); > {code} > with this sample data: > {code} > origins|2016-10-01 00:00:00+0000|False|ACTUAL|6 > origins|2016-10-01 00:00:00+0000|False|ADGMOB|4 > origins|2016-10-01 00:00:00+0000|False|ANONPM|4 > origins|2016-10-01 00:00:00+0000|False|CSRT2L|76 > origins|2016-10-01 00:00:00+0000|False|DIAGOP|18 > origins|2016-10-01 00:00:00+0000|False|E-SOFT|17 > origins|2016-10-01 00:00:00+0000|False|E-TASK|10 > {code} > when imported with > {code} > COPY ks.test FROM 'test.csv' WITH DELIMITER = '|'; > {code} > will generate a parse error: > {code} > Failed to import 7 rows: ParseError - can't interpret u"'2016-10-01 00:00:00+0000'" as a date with this format: %Y-%m-%d %H:%M:%S%z, given up without retries > {code} > The problem is that when a counter value is present, we don't use prepared statements and so we typically don't convert values unless they are part of the partition key. We also add quotes for certain types, such as timestamps. The problem is that we do not remove such quotes before parsing the partition key values, therefore ending up with a parse error. -- This message was sent by Atlassian JIRA (v6.3.4#6332)