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 39D8F200D60 for ; Fri, 1 Dec 2017 22:21:05 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 382D8160C06; Fri, 1 Dec 2017 21:21:05 +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 7F1FB160BF4 for ; Fri, 1 Dec 2017 22:21:04 +0100 (CET) Received: (qmail 61275 invoked by uid 500); 1 Dec 2017 21:21:03 -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 61263 invoked by uid 99); 1 Dec 2017 21:21:03 -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; Fri, 01 Dec 2017 21:21:03 +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 B9F37C226D for ; Fri, 1 Dec 2017 21:21:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.811 X-Spam-Level: X-Spam-Status: No, score=-99.811 tagged_above=-999 required=6.31 tests=[KB_WAM_FROM_NAME_SINGLEWORD=0.2, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 3Ehy5Lm4bqoE for ; Fri, 1 Dec 2017 21:21:02 +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 6B4435F3B8 for ; Fri, 1 Dec 2017 21:21:01 +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 A4091E0CA3 for ; Fri, 1 Dec 2017 21:21:00 +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 598FA255C1 for ; Fri, 1 Dec 2017 21:21:00 +0000 (UTC) Date: Fri, 1 Dec 2017 21:21:00 +0000 (UTC) From: "Paulo Motta (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CASSANDRA-14071) Materialized view on table with TTL issue MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 01 Dec 2017 21:21:05 -0000 [ https://issues.apache.org/jira/browse/CASSANDRA-14071?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Paulo Motta updated CASSANDRA-14071: ------------------------------------ Status: Open (was: Patch Available) > Materialized view on table with TTL issue > ----------------------------------------- > > Key: CASSANDRA-14071 > URL: https://issues.apache.org/jira/browse/CASSANDRA-14071 > Project: Cassandra > Issue Type: Bug > Components: Coordination, Materialized Views > Environment: Cassandra 3 > Reporter: Silviu Butnariu > Assignee: ZhaoYang > Labels: correctness > > Materialized views that cluster by a column that is not part of table's PK and are created from tables that have *default_time_to_live* seems to malfunction. > Having this table > {code:java} > CREATE TABLE sbutnariu.test_bug ( > field1 smallint, > field2 smallint, > date timestamp, > PRIMARY KEY ((field1), field2) > ) WITH default_time_to_live = 1000; > {code} > and the materialized view > {code:java} > CREATE MATERIALIZED VIEW sbutnariu.test_bug_by_date AS SELECT * FROM sbutnariu.test_bug WHERE field1 IS NOT NULL AND field2 IS NOT NULL AND date IS NOT NULL PRIMARY KEY ((field1), date, field2) WITH CLUSTERING ORDER BY (date desc, field2 asc); > {code} > After inserting 3 rows with same PK (should upsert), the materialized view will have 3 rows. > {code:java} > insert into sbutnariu.test_bug(field1, field2, date) values (1, 2, toTimestamp(now())); > insert into sbutnariu.test_bug(field1, field2, date) values (1, 2, toTimestamp(now())); > insert into sbutnariu.test_bug(field1, field2, date) values (1, 2, toTimestamp(now())); > select * from sbutnariu.test_bug; /*1 row*/ > select * from sbutnariu.test_bug_by_date;/*3 rows*/ > {code} > If I remove the ttl and try again, it works as expected: > {code:java} > truncate sbutnariu.test_bug; > alter table sbutnariu.test_bug with default_time_to_live = 0; > select * from sbutnariu.test_bug; /*1 row*/ > select * from sbutnariu.test_bug_by_date;/*1 row*/ > {code} > I've tested on versions 3.0.14 and 3.0.15. The bug was introduced in 3.0.15, as in 3.0.14 it works as expected. -- This message was sent by Atlassian JIRA (v6.4.14#64029) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org For additional commands, e-mail: commits-help@cassandra.apache.org