[
https://issues.apache.org/jira/browse/CASSANDRA-20161?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17922762#comment-17922762
]
Stefan Miklosovic commented on CASSANDRA-20161:
-----------------------------------------------
Another problem is that I am not sure how to select on keys which are strings.
Check this:
{noformat}
cassandra@cqlsh> DESCRIBE ks.tb2;
CREATE TABLE ks.tb2 (id text PRIMARY KEY) ...
cassandra@cqlsh> select * from ks.tb2;
id
----------
a
O'Reilly(2 rows)
cassandra@cqlsh> select * from system_views.primary_ids where keyspace_name =
'ks' and table_name = 'tb2' and key = 'a';
SyntaxException: Failed parsing CQL term: [a] reason: SyntaxException line 0:-1
no viable alternative at input '<EOF>'
cassandra@cqlsh> select * from system_views.primary_ids where keyspace_name =
'ks' and table_name = 'tb2' and key = 'O''Reilly';
SyntaxException: Failed parsing CQL term: [O'Reilly] reason: SyntaxException
line 1:8 mismatched character '<EOF>' expecting '''
{noformat}
Huh? it works when key is int:
{noformat}
cassandra@cqlsh> DESCRIBE ks.tb;
CREATE TABLE ks.tb (
id int PRIMARY KEY,
val text
) ..
cassandra@cqlsh> select * from ks.tb;
id | val
----+-----
1 | a
(1 rows)
cassandra@cqlsh> select * from system_views.primary_ids where keyspace_name =
'ks' and table_name = 'tb' and key = '1';
keyspace_name | table_name | token_value | key | size_estimate |
sstables
---------------+------------+----------------------+-----+---------------+----------
ks | tb | -4069959284402364209 | 1 | 15 |
1(1 rows)
{noformat}
> 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
> Time Spent: 10m
> Remaining Estimate: 0h
>
> 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]