[
https://issues.apache.org/jira/browse/CASSANDRA-20827?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18014030#comment-18014030
]
guo Maxwell edited comment on CASSANDRA-20827 at 8/15/25 3:24 AM:
------------------------------------------------------------------
-what about introduce a function collection2json , so all the others tables can
also convert collection data to json is they need , not only for
system_views.settings? -
{code:java}
(0 rows)
cqlsh> select name, collection2json(value) from system_views.settings where
name='seed_provider.parameters' ;
name | value
--------------------------+------------------------
seed_provider.parameters | {"seeds": "127.0.0.1:7000"}
{code}
or we can also support :
{code:java}
(0 rows)
cqlsh> select collection2json(*) from system_views.settings where
name='seed_provider.parameters' ;
name | value
--------------------------+------------------------
seed_provider.parameters | {"seeds": "127.0.0.1:7000"}
{code}
-which will convert all the collection data type's column to json . -
WDYT ? [~mrktsm][~paulo][~dcapwell]
UPDATE :
after reading the code of SettingsTable, I think my suggestion is not very
suitable for this issue. May be should open a new jira.
was (Author: maxwellguo):
what about introduce a function collection2json , so all the others tables can
also convert collection data to json is they need , not only for
system_views.settings?
{code:java}
(0 rows)
cqlsh> select name, collection2json(value) from system_views.settings where
name='seed_provider.parameters' ;
name | value
--------------------------+------------------------
seed_provider.parameters | {"seeds": "127.0.0.1:7000"}
{code}
or we can also support :
{code:java}
(0 rows)
cqlsh> select collection2json(*) from system_views.settings where
name='seed_provider.parameters' ;
name | value
--------------------------+------------------------
seed_provider.parameters | {"seeds": "127.0.0.1:7000"}
{code}
which will convert all the collection data type's column to json .
WDYT ? [~mrktsm][~paulo][~dcapwell]
> Represent complex settings as JSON on system_views.settings table
> -----------------------------------------------------------------
>
> Key: CASSANDRA-20827
> URL: https://issues.apache.org/jira/browse/CASSANDRA-20827
> Project: Apache Cassandra
> Issue Type: Improvement
> Components: Local/Config
> Reporter: Paulo Motta
> Assignee: Marko Tsymbaliuk
> Priority: Normal
>
> Complex configuration (maps/sets/lists) are represented as
> Collections.toString() on {{system.settings}} virtual table:
> {code:java}
> cqlsh> select * from system_views.settings where name='seed_provider' ;
> name | value
> ------+-------
> (0 rows)
> cqlsh> select * from system_views.settings where
> name='seed_provider.parameters' ;
> name | value
> --------------------------+------------------------
> seed_provider.parameters | {seeds=127.0.0.1:7000}
> {code}
> While this is fine for human consumption, it's not ideal for programmatic
> access, since it requires custom parsing.
> This ticket is to add ability of representing complex types as JSON on
> {{system.settings}} and potentially making it default in trunk, so the above
> would return:
> {code:java}
> cqlsh> select * from system_views.settings where name='seed_provider' ;
> name | value
> ------+-------
> (0 rows)
> cqlsh> select * from system_views.settings where
> name='seed_provider.parameters' ;
> name | value
> --------------------------+------------------------
> seed_provider.parameters | {"seeds": "127.0.0.1:7000"}{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]