[ 
https://issues.apache.org/jira/browse/CASSANDRA-20161?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17922757#comment-17922757
 ] 

Stefan Miklosovic commented on CASSANDRA-20161:
-----------------------------------------------

I was trying to "break this" and I succeeded:
{noformat}
select * from system_views.primary_ids where keyspace_name = 
'system_cluster_metadata' and table_name = 'distributed_metadata_log' and key = 
'1';
NoHostAvailable: ('Unable to complete the operation against any hosts', {<Host: 
127.0.0.1:9042 datacenter1>: <Error from server: code=0000 [Server error] 
message="java.lang.UnsupportedOperationException: If you are using a splitting 
partitioner, getMaximumToken has to be implemented">})
 {noformat}
On server side:
{noformat}
ERROR [Native-Transport-Requests-1] 2025-01-31 16:25:02,339 
QueryMessage.java:130 - Unexpected error during query
java.lang.UnsupportedOperationException: If you are using a splitting 
partitioner, getMaximumToken has to be implemented
    at 
org.apache.cassandra.dht.IPartitioner.getMaximumToken(IPartitioner.java:74)
    at 
org.apache.cassandra.db.virtual.PrimaryIdTable.getBounds(PrimaryIdTable.java:283)
    at 
org.apache.cassandra.db.virtual.PrimaryIdTable.select(PrimaryIdTable.java:165)
    at 
org.apache.cassandra.db.SinglePartitionReadCommand$VirtualTableSinglePartitionReadCommand.executeLocally(SinglePartitionReadCommand.java:1398)
    at 
org.apache.cassandra.db.AbstractReadQuery.executeInternal(AbstractReadQuery.java:65)
    at org.apache.cassandra.db.ReadCommand.executeInternal(ReadCommand.java:97)
    at 
org.apache.cassandra.db.SinglePartitionReadCommand$VirtualTableSinglePartitionReadCommand.execute(SinglePartitionReadCommand.java:1391)
    at 
org.apache.cassandra.service.pager.AbstractQueryPager.fetchPage(AbstractQueryPager.java:76)
    at 
org.apache.cassandra.service.pager.SinglePartitionPager.fetchPage(SinglePartitionPager.java:32)
    at 
org.apache.cassandra.cql3.statements.SelectStatement$Pager$NormalPager.fetchPage(SelectStatement.java:493)
    at 
org.apache.cassandra.cql3.statements.SelectStatement.execute(SelectStatement.java:550)
    at 
org.apache.cassandra.cql3.statements.SelectStatement.execute(SelectStatement.java:354)
    at 
org.apache.cassandra.cql3.statements.SelectStatement.execute(SelectStatement.java:110)
    at 
org.apache.cassandra.cql3.QueryProcessor.processStatement(QueryProcessor.java:286)
    at org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:379)
    at org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:366)
    at 
org.apache.cassandra.transport.messages.QueryMessage.execute(QueryMessage.java:117)
 {noformat}
It is because getMaximumToken is implemented only for Murmur, Random and 
OrderPreserving partitioners. For ByteOrderedPartitioner, LocalPartitioner and 
ReversedLongLocalPartitioner, this is not overloaded.

I think that the fix would consist of making sure that "getMaximumToken" is 
supported. That means that partitioner is "splittable".

I suggest we add a method "supportsSplitting()" returning boolean if 
IPartitioner supports this.

> Virtual table to query partition keys in a table
> ------------------------------------------------
>
>                 Key: CASSANDRA-20161
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-20161
>             Project: Apache Cassandra
>          Issue Type: New Feature
>          Components: Feature/Virtual Tables
>            Reporter: Chris Lohfink
>            Assignee: Chris Lohfink
>            Priority: Low
>
> Introduce a new virtual table, {{{}PrimaryIdTable{}}}, to allow users to 
> query partition keys and related metadata for a specific table within a 
> keyspace. This feature provides insights into SSTable-level details, such as 
> token values, size estimates, and SSTable counts, without requiring expensive 
> disk-based operations.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to