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 5A5CA200C3F for ; Wed, 22 Mar 2017 12:23:57 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 58CED160B86; Wed, 22 Mar 2017 11:23:57 +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 783C9160B83 for ; Wed, 22 Mar 2017 12:23:56 +0100 (CET) Received: (qmail 31277 invoked by uid 500); 22 Mar 2017 11:23:52 -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 31140 invoked by uid 99); 22 Mar 2017 11:23:52 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Mar 2017 11:23:52 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 7B07A1A00B7 for ; Wed, 22 Mar 2017 11:23:52 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -98.549 X-Spam-Level: X-Spam-Status: No, score=-98.549 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_NEUTRAL=0.652, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 3km8B_b8uckR for ; Wed, 22 Mar 2017 11:23:51 +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 8B2455FB3F for ; Wed, 22 Mar 2017 11:23:50 +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 D5036E045B for ; Wed, 22 Mar 2017 11:23:41 +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 8EF4624D33 for ; Wed, 22 Mar 2017 11:23:41 +0000 (UTC) Date: Wed, 22 Mar 2017 11:23:41 +0000 (UTC) From: "Nicolae N (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CASSANDRA-13364) Cqlsh COPY fails importing Map>, ParseError unhashable type list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 22 Mar 2017 11:23:57 -0000 [ https://issues.apache.org/jira/browse/CASSANDRA-13364?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Nicolae N updated CASSANDRA-13364: ---------------------------------- Description: {code} CREATE TABLE table1 ( col1 int PRIMARY KEY, col2map map>> ); insert into table1 (col1, col2map) values (1, {'key': ['value1']}); cqlsh:ks> copy table1 to 'table1.csv'; ... table1.csv file content: 1,{'key': ['value1']} cqlsh:ks> copy table1 from 'table1.csv'; ... Failed to import 1 rows: ParseError - Failed to parse {'key': ['value1']} : unhashable type: 'list', given up without retries Failed to process 1 rows; failed rows written to kv_table1.err Processed: 1 rows; Rate: 2 rows/s; Avg. rate: 2 rows/s 1 rows imported from 1 files in 0.420 seconds (0 skipped). {code} But it works fine for Map>. {code} CREATE TABLE table2 ( col1 int PRIMARY KEY, col2map map>> ); insert into table2 (col1, col2map) values (1, {'key': {'value1'}}); cqlsh:ks> copy table2 to 'table2.csv'; table2.csv file content: 1,{'key': {'value1'}} cqlsh:ks> copy table2 from 'table2.csv'; Processed: 1 rows; Rate: 2 rows/s; Avg. rate: 2 rows/s 1 rows imported from 1 files in 0.417 seconds (0 skipped). {code} The exception seems to arrive in _convert_map_ function in _ImportConversion_ class inside _copyutil.py_. was: {code} CREATE TABLE table1 ( col1 int PRIMARY KEY, col2map map>> ); insert into table1 (col1, col2map) values (1, {'key': ['value1']}); cqlsh:ks> copy table1 to 'table1.csv'; ... {code} table1.csv file content: {code}1,{'key': ['value1']}{code} {code} cqlsh:ks> copy table1 from 'table1.csv'; ... Failed to import 1 rows: ParseError - Failed to parse {'key': ['value1']} : unhashable type: 'list', given up without retries Failed to process 1 rows; failed rows written to kv_table1.err Processed: 1 rows; Rate: 2 rows/s; Avg. rate: 2 rows/s 1 rows imported from 1 files in 0.420 seconds (0 skipped). {code} But it works fine for Map>. {code} CREATE TABLE table2 ( col1 int PRIMARY KEY, col2map map>> ); insert into table2 (col1, col2map) values (1, {'key': {'value1'}}); cqlsh:ks> copy table2 to 'table2.csv'; table2.csv file content: 1,{'key': {'value1'}} cqlsh:ks> copy table2 from 'table2.csv'; Processed: 1 rows; Rate: 2 rows/s; Avg. rate: 2 rows/s 1 rows imported from 1 files in 0.417 seconds (0 skipped). {code} The exception seems to arrive in _convert_map_ function in _ImportConversion_ class inside _copyutil.py_. > Cqlsh COPY fails importing Map>, ParseError unhashable type list > ------------------------------------------------------------------------------------ > > Key: CASSANDRA-13364 > URL: https://issues.apache.org/jira/browse/CASSANDRA-13364 > Project: Cassandra > Issue Type: Bug > Reporter: Nicolae N > Labels: cqlsh > Fix For: 3.11.x > > > {code} > CREATE TABLE table1 ( > col1 int PRIMARY KEY, > col2map map>> > ); > insert into table1 (col1, col2map) values (1, {'key': ['value1']}); > cqlsh:ks> copy table1 to 'table1.csv'; > ... > table1.csv file content: > 1,{'key': ['value1']} > cqlsh:ks> copy table1 from 'table1.csv'; > ... > Failed to import 1 rows: ParseError - Failed to parse {'key': ['value1']} : unhashable type: 'list', given up without retries > Failed to process 1 rows; failed rows written to kv_table1.err > Processed: 1 rows; Rate: 2 rows/s; Avg. rate: 2 rows/s > 1 rows imported from 1 files in 0.420 seconds (0 skipped). > {code} > But it works fine for Map>. > {code} > CREATE TABLE table2 ( > col1 int PRIMARY KEY, > col2map map>> > ); > insert into table2 (col1, col2map) values (1, {'key': {'value1'}}); > cqlsh:ks> copy table2 to 'table2.csv'; > table2.csv file content: > 1,{'key': {'value1'}} > cqlsh:ks> copy table2 from 'table2.csv'; > Processed: 1 rows; Rate: 2 rows/s; Avg. rate: 2 rows/s > 1 rows imported from 1 files in 0.417 seconds (0 skipped). > {code} > The exception seems to arrive in _convert_map_ function in _ImportConversion_ class inside _copyutil.py_. -- This message was sent by Atlassian JIRA (v6.3.15#6346)