From user-return-59461-archive-asf-public=cust-asf.ponee.io@cassandra.apache.org Thu Jan 18 11:19:24 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id 74F9C180654 for ; Thu, 18 Jan 2018 11:19:24 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 65095160C36; Thu, 18 Jan 2018 10:19:24 +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 84ADE160C2B for ; Thu, 18 Jan 2018 11:19:23 +0100 (CET) Received: (qmail 16057 invoked by uid 500); 18 Jan 2018 10:19:19 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 16035 invoked by uid 99); 18 Jan 2018 10:19:19 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Jan 2018 10:19:19 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 138441808C2 for ; Thu, 18 Jan 2018 10:19:19 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.879 X-Spam-Level: * X-Spam-Status: No, score=1.879 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id e34sGUvK8sCr for ; Thu, 18 Jan 2018 10:19:18 +0000 (UTC) Received: from mail-oi0-f66.google.com (mail-oi0-f66.google.com [209.85.218.66]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id E87DE5F243 for ; Thu, 18 Jan 2018 10:19:17 +0000 (UTC) Received: by mail-oi0-f66.google.com with SMTP id e144so15334626oib.4 for ; Thu, 18 Jan 2018 02:19:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=yXbGQpTumXinCfD0aNmaCqO8+tDW7Ml6gOvpojTt/s0=; b=AfsdDc/ejmdhKCQ2HJq3LtzKOEKBRgHqXUauftVWH67uzXNI3QP92nijm4uTYALBSS fw6Iwp4XnnjJSIqRd/u7TL5fyA9LSf4n1E7lCWsddOXyL5711u9VZ2GzmXg3MqhClmFT 2X8S+Qaxf61nghPuN+/wEs/E7o+L0wu3u3CQ9EX59n6v8VMoyJUgK9rY+NGBmcQYItru wW9n7b8pOnMuJcJ8jUoZk5RLz13Pnb4OamIOdXyXHSeHxgQZSgaVgc1cwwgQMGQg5/nq RfdxldVemIfiyIhQicUglgzvwPwwaH5CAaf8+34G8Gusnh9qgrACFzG30dzXPfHWXwLE uVMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=yXbGQpTumXinCfD0aNmaCqO8+tDW7Ml6gOvpojTt/s0=; b=CbvohxbrzKFGsHCm4D1IAZOoAUUR/Rwqo5X7Yki6kMdEqmd/phsK3pwZZrIFEQ6f4N XfASIXG0IpzWQY5j+ij0P7LauuiXKlAV/wOm2DOLJjDUp1kfgNUptLuACJ+GfkaKweLN MXPvzqE+ikindo8F1zgvuPg6grN919dsxWCgLgbOc33fWznfARI6rjX7kIy3kfEZ8soD gKLl2dxP2hW+pZ8cVrxyGwNZrxWvSeCnrVsWdzjFblk4gmwVRdz6pMPAEKVFbz8MU0Tz d5o/3y6F6DfIY8id5T1mB5edTWMKYIzV0JPY289QnJ4vHhOW0EZNkqexj8fkPc1Gm5IV j0uA== X-Gm-Message-State: AKwxytefZmh+kn5H2Ecd1A4m1r21ra9Oc7cEWI8xoDNwIjnKVTSIeoQk NUZO1v6CFzwsMxIvudE6CclZdZ1O2fa5sv7dKXi6dw== X-Google-Smtp-Source: ACJfBouS2Nu1m8iTsFoxcDtYmdsjCVL0wd22tvIfXDxqhNhOu3UWWOWszNoGexVQycGUo1IcXDOSPDepHFK2oEfoqfE= X-Received: by 10.202.244.131 with SMTP id s125mr2822370oih.327.1516270757143; Thu, 18 Jan 2018 02:19:17 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.6.39 with HTTP; Thu, 18 Jan 2018 02:18:56 -0800 (PST) In-Reply-To: References: From: Nicolas Guyomar Date: Thu, 18 Jan 2018 11:18:56 +0100 Message-ID: Subject: Re: Alter composite column To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary="001a1134e590dce90d05630a4bbb" --001a1134e590dce90d05630a4bbb Content-Type: text/plain; charset="UTF-8" Hi Joel, You cannot alter a table primary key. You can however alter your existing table to only add column4 using cqlsh and cql, even if this table as created back with C* 1.X for instance On 18 January 2018 at 11:14, Joel Samuelsson wrote: > So to rephrase that in CQL terms I have a table like this: > > CREATE TABLE events ( > key text, > column1 int, > column2 int, > column3 text, > value text, > PRIMARY KEY(key, column1, column2, column3) > ) WITH COMPACT STORAGE > > and I'd like to change it to: > CREATE TABLE events ( > key text, > column1 int, > column2 int, > column3 text, > column4 text, > value text, > PRIMARY KEY(key, column1, column2, column3, column4) > ) WITH COMPACT STORAGE > > Is this possible? > Best regards, > Joel > > 2018-01-12 16:53 GMT+01:00 Joel Samuelsson : > >> Hi, >> >> I have an older system (C* 2.1) using Thrift tables on which I want to >> alter a column composite. Right now it looks like (int, int, string) but I >> want it to be (int, int, string, string). Is it possible to do this on a >> live cluster without deleting the old data? Can you point me to some >> documentation about this? I can't seem to find it any more. >> >> Best regards, >> Joel >> > > --001a1134e590dce90d05630a4bbb Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Joel,

You cannot alter a table prima= ry key.

You can however alter your existing table = to only add column4 using cqlsh and cql, even if this table as created back= with C* 1.X for instance

On 18 January 2018 at 11:14, Joel Samuelsson <samuelsson.joel@gmail.com> wrote:
So to rephrase that in CQL terms I have a table li= ke this:

CREATE TABLE events (
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 key text,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 column1 i= nt,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 column2 int,
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 column3 text,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 value text,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 PRIMARY KEY(key, column1, column2, colum= n3)
) WITH COMPACT STORAGE

and I&#= 39;d like to change it to:
CREATE TABLE events (
= =C2=A0 =C2=A0 =C2=A0 =C2=A0 key text,
=C2=A0 =C2=A0 =C2=A0 =C2=A0= column1 int,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 column2 int,
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 column3 text,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 column4 text,=C2=A0 =C2=A0 =C2=A0 =C2=A0 value text,
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 PRIMARY KEY(key, column1, column2, column3, column4)
) WIT= H COMPACT STORAGE

Is this possible?
Best regards,
Joel

2018-01-12 16:53 GMT+01:00 = Joel Samuelsson <samuelsson.joel@gmail.com>:
Hi,

I have a= n older system (C* 2.1) using Thrift tables on which I want to alter a colu= mn composite. Right now it looks like (int, int, string) but I want it to b= e (int, int, string, string). Is it possible to do this on a live cluster w= ithout deleting the old data? Can you point me to some documentation about = this? I can't seem to find it any more.

Best r= egards,
Joel


--001a1134e590dce90d05630a4bbb--