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 8C40F200C3C for ; Mon, 3 Apr 2017 16:39:45 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 8ADAA160B8F; Mon, 3 Apr 2017 14:39:45 +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 D9E18160B76 for ; Mon, 3 Apr 2017 16:39:44 +0200 (CEST) Received: (qmail 31724 invoked by uid 500); 3 Apr 2017 14:39:44 -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 31713 invoked by uid 99); 3 Apr 2017 14:39:44 -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; Mon, 03 Apr 2017 14:39:44 +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 AA60CC6653 for ; Mon, 3 Apr 2017 14:39:43 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id EZRp-MmqNyeO for ; Mon, 3 Apr 2017 14:39:43 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id E74AC5F642 for ; Mon, 3 Apr 2017 14:39:42 +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 56B2AE0012 for ; Mon, 3 Apr 2017 14:39:42 +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 BA18621DCB for ; Mon, 3 Apr 2017 14:39:41 +0000 (UTC) Date: Mon, 3 Apr 2017 14:39:41 +0000 (UTC) From: "Alex Petrov (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CASSANDRA-13197) +=/-= shortcut syntax bugs/inconsistencies MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 03 Apr 2017 14:39:45 -0000 [ https://issues.apache.org/jira/browse/CASSANDRA-13197?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Alex Petrov updated CASSANDRA-13197: ------------------------------------ Status: Ready to Commit (was: Patch Available) > +=/-= shortcut syntax bugs/inconsistencies > ------------------------------------------ > > Key: CASSANDRA-13197 > URL: https://issues.apache.org/jira/browse/CASSANDRA-13197 > Project: Cassandra > Issue Type: Improvement > Reporter: Kishan Karunaratne > Assignee: Alex Petrov > > CASSANDRA-12232 introduced (+=/-=) shortcuts for counters and collection types. I ran into some bugs/consistencies. > Given the schema: > {noformat} > CREATE TABLE simplex.collection_table (k int PRIMARY KEY, d_l List, d_s Set, d_m Map, d_t Tuple); > {noformat} > 1) Using -= on a list column removes all elements that match the value, instead of the first or last occurrence of it. Is this expected? > {noformat} > Given d_l = [0, 1, 2, 1, 1] > UPDATE collection_table SET d_l -= [1] WHERE k=0; > yields > [0, 2] > {noformat} > 2) I can't seem to remove a map key/value pair: > {noformat} > Given d_m = {0: 0, 1: 1} > UPDATE collection_table SET d_m -= {1:1} WHERE k=0; > yields > Invalid map literal for d_m of type frozen> > {noformat} > However {noformat}UPDATE collection_table SET d_m -= {1} WHERE k=0;{noformat} does work. > 3) Tuples are immutable so it make sense that +=/-= doesn't apply. However the error message could be better, now that other collection types are allowed: > {noformat} > UPDATE collection_table SET d_t += (1) WHERE k=0; > yields > Invalid operation (d_t = d_t + (1)) for non counter column d_t > {noformat} -- This message was sent by Atlassian JIRA (v6.3.15#6346)