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 BADAD115D2 for ; Tue, 23 Sep 2014 08:53:34 +0000 (UTC) Received: (qmail 29149 invoked by uid 500); 23 Sep 2014 08:53:34 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 29113 invoked by uid 500); 23 Sep 2014 08:53:34 -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 29095 invoked by uid 99); 23 Sep 2014 08:53:34 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Sep 2014 08:53:34 +0000 Date: Tue, 23 Sep 2014 08:53:34 +0000 (UTC) From: "Benjamin Lerer (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CASSANDRA-6075) The token function should allow column identifiers in the correct order only MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-6075?page=3Dcom.atla= ssian.jira.plugin.system.issuetabpanels:all-tabpanel ] Benjamin Lerer updated CASSANDRA-6075: -------------------------------------- Attachment: CASSANDRA-2.1-6075-PART2.txt CASSANDRA-2.0-6075-PART2.txt Completely forgot the case of the slice with start and end bound(e.g. token= (key) >=3D token(1) and token(key) < token(2)) That is what broke the Pig-Tests. Sorry. Here are the patchs to fix that problem on the 2.0 and 2.1+ branches. I also dicover while trying to add more tests than the current approach to = handle token functions is broken. With the current approach we cannot rejec= t queries like: {{SELECT * FROM %s WHERE token(a, b) > token(?, ?) and token(b) < token(?, = ?)}} or {{SELECT * FROM %s WHERE token(a) > token(?, ?) and token(b) > toke= n(?, ?)}}=20 I will try to find another solution as part of #CASSANDRA-7981 > The token function should allow column identifiers in the correct order o= nly > -------------------------------------------------------------------------= --- > > Key: CASSANDRA-6075 > URL: https://issues.apache.org/jira/browse/CASSANDRA-6075 > Project: Cassandra > Issue Type: Bug > Environment: Cassandra 1.2.9 > Reporter: Micha=C3=ABl Figui=C3=A8re > Assignee: Benjamin Lerer > Priority: Minor > Labels: cql > Fix For: 2.0.11, 2.1.1 > > Attachments: CASSANDRA-2.0-6075-PART2.txt, CASSANDRA-2.1-6075-PAR= T2.txt, CASSANDRA-2.1-6075.txt, CASSANDRA-6075.txt > > > Given the following table: > {code} > CREATE TABLE t1 (a int, b text, PRIMARY KEY ((a, b))); > {code} > The following request returns an error in cqlsh as literal arguments orde= r is incorrect: > {code} > SELECT * FROM t1 WHERE token(a, b) > token('s', 1); > Bad Request: Type error: 's' cannot be passed as argument 0 of function t= oken of type int > {code} > But surprisingly if we provide the column identifier arguments in the wro= ng order no error is returned: > {code} > SELECT * FROM t1 WHERE token(a, b) > token(1, 'a'); // correct order is v= alid > SELECT * FROM t1 WHERE token(b, a) > token(1, 'a'); // incorrect order is= valid as well > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)