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 0DA41200C15 for ; Wed, 8 Feb 2017 10:01:52 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 0C2F5160B5A; Wed, 8 Feb 2017 09:01:52 +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 07C3B160B4E for ; Wed, 8 Feb 2017 10:01:50 +0100 (CET) Received: (qmail 39754 invoked by uid 500); 8 Feb 2017 09:01:50 -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 39743 invoked by uid 99); 8 Feb 2017 09:01:50 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Feb 2017 09:01:50 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id BBE1CC05D7 for ; Wed, 8 Feb 2017 09:01:49 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.999 X-Spam-Level: X-Spam-Status: No, score=-1.999 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id h1BNYDyln01X for ; Wed, 8 Feb 2017 09:01:43 +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 E61BD5F5D3 for ; Wed, 8 Feb 2017 09:01: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 2B699E0156 for ; Wed, 8 Feb 2017 09:01: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 DD5072528B for ; Wed, 8 Feb 2017 09:01:41 +0000 (UTC) Date: Wed, 8 Feb 2017 09:01:41 +0000 (UTC) From: "Benjamin Lerer (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CASSANDRA-13174) Indexing is allowed on Duration type when it should not be MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 08 Feb 2017 09:01:52 -0000 [ https://issues.apache.org/jira/browse/CASSANDRA-13174?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Benjamin Lerer updated CASSANDRA-13174: --------------------------------------- Component/s: CQL > Indexing is allowed on Duration type when it should not be > ---------------------------------------------------------- > > Key: CASSANDRA-13174 > URL: https://issues.apache.org/jira/browse/CASSANDRA-13174 > Project: Cassandra > Issue Type: Bug > Components: CQL > Environment: C* 3.10 > Reporter: Kishan Karunaratne > Assignee: Benjamin Lerer > Fix For: 3.11.x, 4.x > > > Looks like secondary indexing is allowed on duration type columns. Since comparisons are not possible for the duration type, indexing on it also should be invalid. > 1) > {noformat} > CREATE TABLE duration_table (k int PRIMARY KEY, d duration); > INSERT INTO duration_table (k, d) VALUES (0, 1s); > SELECT * from duration_table WHERE d=1s ALLOW FILTERING; > {noformat} > The above throws an error: > {noformat} > WARN [ReadStage-2] 2017-01-31 17:09:57,821 AbstractLocalAwareExecutorService.java:167 - Uncaught exception on thread Thread[ReadStage-2,10,main]: {} > java.lang.RuntimeException: java.lang.UnsupportedOperationException > at org.apache.cassandra.service.StorageProxy$DroppableRunnable.run(StorageProxy.java:2591) ~[main/:na] > at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[na:1.8.0_91] > at org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$FutureTask.run(AbstractLocalAwareExecutorService.java:162) ~[main/:na] > at org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$LocalSessionFutureTask.run(AbstractLocalAwareExecutorService.java:134) [main/:na] > at org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:109) [main/:na] > at java.lang.Thread.run(Thread.java:745) [na:1.8.0_91] > Caused by: java.lang.UnsupportedOperationException: null > at org.apache.cassandra.db.marshal.AbstractType.compareCustom(AbstractType.java:174) ~[main/:na] > at org.apache.cassandra.db.marshal.AbstractType.compare(AbstractType.java:160) ~[main/:na] > at org.apache.cassandra.db.marshal.AbstractType.compareForCQL(AbstractType.java:204) ~[main/:na] > at org.apache.cassandra.cql3.Operator.isSatisfiedBy(Operator.java:201) ~[main/:na] > at org.apache.cassandra.db.filter.RowFilter$SimpleExpression.isSatisfiedBy(RowFilter.java:719) ~[main/:na] > at org.apache.cassandra.db.filter.RowFilter$CQLFilter$1IsSatisfiedFilter.applyToRow(RowFilter.java:324) ~[main/:na] > at org.apache.cassandra.db.transform.BaseRows.applyOne(BaseRows.java:120) ~[main/:na] > at org.apache.cassandra.db.transform.BaseRows.add(BaseRows.java:110) ~[main/:na] > at org.apache.cassandra.db.transform.UnfilteredRows.add(UnfilteredRows.java:44) ~[main/:na] > at org.apache.cassandra.db.transform.Transformation.add(Transformation.java:174) ~[main/:na] > at org.apache.cassandra.db.transform.Transformation.apply(Transformation.java:140) ~[main/:na] > at org.apache.cassandra.db.filter.RowFilter$CQLFilter$1IsSatisfiedFilter.applyToPartition(RowFilter.java:307) ~[main/:na] > at org.apache.cassandra.db.filter.RowFilter$CQLFilter$1IsSatisfiedFilter.applyToPartition(RowFilter.java:292) ~[main/:na] > at org.apache.cassandra.db.transform.BasePartitions.hasNext(BasePartitions.java:96) ~[main/:na] > at org.apache.cassandra.db.partitions.UnfilteredPartitionIterators$Serializer.serialize(UnfilteredPartitionIterators.java:310) ~[main/:na] > at org.apache.cassandra.db.ReadResponse$LocalDataResponse.build(ReadResponse.java:145) ~[main/:na] > at org.apache.cassandra.db.ReadResponse$LocalDataResponse.(ReadResponse.java:138) ~[main/:na] > at org.apache.cassandra.db.ReadResponse$LocalDataResponse.(ReadResponse.java:134) ~[main/:na] > at org.apache.cassandra.db.ReadResponse.createDataResponse(ReadResponse.java:76) ~[main/:na] > at org.apache.cassandra.db.ReadCommand.createResponse(ReadCommand.java:333) ~[main/:na] > at org.apache.cassandra.service.StorageProxy$LocalReadRunnable.runMayThrow(StorageProxy.java:1884) ~[main/:na] > at org.apache.cassandra.service.StorageProxy$DroppableRunnable.run(StorageProxy.java:2587) ~[main/:na] > ... 5 common frames omitted > {noformat} > 2) > Similarly, if an index is created on the duration column: > {noformat} > CREATE INDEX d_index ON simplex.duration_table (d); > SELECT * from duration_table WHERE d=1s; > {noformat} > results in: > {noformat} > WARN [ReadStage-2] 2017-01-31 17:12:00,623 AbstractLocalAwareExecutorService.java:167 - Uncaught exception on thread Thread[ReadStage-2,10,main]: {} > java.lang.RuntimeException: org.apache.cassandra.index.IndexNotAvailableException: The secondary index 'd_index' is not yet available > at org.apache.cassandra.service.StorageProxy$DroppableRunnable.run(StorageProxy.java:2591) ~[main/:na] > at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[na:1.8.0_91] > at org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$FutureTask.run(AbstractLocalAwareExecutorService.java:162) ~[main/:na] > at org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$LocalSessionFutureTask.run(AbstractLocalAwareExecutorService.java:134) [main/:na] > at org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:109) [main/:na] > at java.lang.Thread.run(Thread.java:745) [na:1.8.0_91] > Caused by: org.apache.cassandra.index.IndexNotAvailableException: The secondary index 'd_index' is not yet available > at org.apache.cassandra.db.ReadCommand.executeLocally(ReadCommand.java:400) ~[main/:na] > at org.apache.cassandra.service.StorageProxy$LocalReadRunnable.runMayThrow(StorageProxy.java:1882) ~[main/:na] > at org.apache.cassandra.service.StorageProxy$DroppableRunnable.run(StorageProxy.java:2587) ~[main/:na] > ... 5 common frames omitted > {noformat} > 3) > Finally, no further updates can be made to the table once the index has been created. Attempting to modify or insert a new row with a non-null value for "d" results in an error: > {noformat} > ERROR [MutationStage-2] 2017-01-31 17:13:33,106 StorageProxy.java:1422 - Failed to apply mutation locally : {} > java.lang.RuntimeException: null for ks: simplex, table: duration_table.d_index for ks: simplex, table: duration_table > at org.apache.cassandra.db.ColumnFamilyStore.apply(ColumnFamilyStore.java:1334) ~[main/:na] > at org.apache.cassandra.db.Keyspace.applyInternal(Keyspace.java:618) ~[main/:na] > at org.apache.cassandra.db.Keyspace.apply(Keyspace.java:462) ~[main/:na] > at org.apache.cassandra.db.Mutation.apply(Mutation.java:227) ~[main/:na] > at org.apache.cassandra.db.Mutation.apply(Mutation.java:232) ~[main/:na] > at org.apache.cassandra.db.Mutation.apply(Mutation.java:241) ~[main/:na] > at org.apache.cassandra.service.StorageProxy$8.runMayThrow(StorageProxy.java:1416) ~[main/:na] > at org.apache.cassandra.service.StorageProxy$LocalMutationRunnable.run(StorageProxy.java:2640) [main/:na] > at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_91] > at org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$FutureTask.run(AbstractLocalAwareExecutorService.java:162) [main/:na] > at org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$LocalSessionFutureTask.run(AbstractLocalAwareExecutorService.java:134) [main/:na] > at org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:109) [main/:na] > at java.lang.Thread.run(Thread.java:745) [na:1.8.0_91] > Caused by: java.lang.RuntimeException: null for ks: simplex, table: duration_table.d_index > at org.apache.cassandra.db.ColumnFamilyStore.apply(ColumnFamilyStore.java:1334) ~[main/:na] > at org.apache.cassandra.index.internal.CassandraIndex.insert(CassandraIndex.java:531) ~[main/:na] > at org.apache.cassandra.index.internal.CassandraIndex.access$100(CassandraIndex.java:72) ~[main/:na] > at org.apache.cassandra.index.internal.CassandraIndex$1.indexCell(CassandraIndex.java:444) ~[main/:na] > at org.apache.cassandra.index.internal.CassandraIndex$1.insertRow(CassandraIndex.java:388) ~[main/:na] > at org.apache.cassandra.index.SecondaryIndexManager$WriteTimeTransaction.onInserted(SecondaryIndexManager.java:914) ~[main/:na] > at org.apache.cassandra.db.partitions.AtomicBTreePartition$RowUpdater.apply(AtomicBTreePartition.java:333) ~[main/:na] > at org.apache.cassandra.db.partitions.AtomicBTreePartition$RowUpdater.apply(AtomicBTreePartition.java:295) ~[main/:na] > at org.apache.cassandra.utils.btree.BTree.buildInternal(BTree.java:139) ~[main/:na] > at org.apache.cassandra.utils.btree.BTree.build(BTree.java:121) ~[main/:na] > at org.apache.cassandra.utils.btree.BTree.update(BTree.java:178) ~[main/:na] > at org.apache.cassandra.db.partitions.AtomicBTreePartition.addAllWithSizeDelta(AtomicBTreePartition.java:156) ~[main/:na] > at org.apache.cassandra.db.Memtable.put(Memtable.java:284) ~[main/:na] > at org.apache.cassandra.db.ColumnFamilyStore.apply(ColumnFamilyStore.java:1316) ~[main/:na] > ... 12 common frames omitted > Caused by: java.lang.UnsupportedOperationException: null > at org.apache.cassandra.db.marshal.AbstractType.compareCustom(AbstractType.java:174) ~[main/:na] > at org.apache.cassandra.db.marshal.AbstractType.compare(AbstractType.java:160) ~[main/:na] > at org.apache.cassandra.dht.LocalPartitioner$LocalToken.compareTo(LocalPartitioner.java:156) ~[main/:na] > at org.apache.cassandra.dht.LocalPartitioner$LocalToken.compareTo(LocalPartitioner.java:132) ~[main/:na] > at org.apache.cassandra.db.DecoratedKey.compareTo(DecoratedKey.java:85) ~[main/:na] > at org.apache.cassandra.db.DecoratedKey.compareTo(DecoratedKey.java:39) ~[main/:na] > at java.util.concurrent.ConcurrentSkipListMap.cpr(ConcurrentSkipListMap.java:655) ~[na:1.8.0_91] > at java.util.concurrent.ConcurrentSkipListMap.findPredecessor(ConcurrentSkipListMap.java:682) ~[na:1.8.0_91] > at java.util.concurrent.ConcurrentSkipListMap.doGet(ConcurrentSkipListMap.java:781) ~[na:1.8.0_91] > at java.util.concurrent.ConcurrentSkipListMap.get(ConcurrentSkipListMap.java:1546) ~[na:1.8.0_91] > at org.apache.cassandra.db.Memtable.put(Memtable.java:264) ~[main/:na] > at org.apache.cassandra.db.ColumnFamilyStore.apply(ColumnFamilyStore.java:1316) ~[main/:na] > ... 25 common frames omitted > {noformat} > Similar errors/inconsistencies exist for materialized views. -- This message was sent by Atlassian JIRA (v6.3.15#6346)