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

Yong Jiang commented on CASSANDRA-18177:
----------------------------------------

Hi, [~maxwellguo], I have implemented the toJsonString method for 
AbstractCompositeType per your instruction. Since your change is planned for 
5.0 release and not in current trunk yet, so I created new branch 
CASSANDRA-18177-4.1 and merged the fixes from your branch CASSANDRA-17698-4.1. 
So here is commited change for parsing index table for composite partition key. 
Please help review and let me know your comments. If everything looks good, I 
will go ahead make the changes for branches 3.0, 3.11, 4.0 and trunck as well 
to match your changes.

[changes for 4.1 
|https://github.com/yongj/cassandra/commit/042f13a5cc6aa1782c1a68afeb4ab4b940ed7a7e?diff=unified]

I have also tried to created and parse an example table and below is the output 
for your reference:
{code:java}
yongjiang@local:~/Documents/Code/test/cassandra$ ./bin/cqlsh
Connected to Test Cluster at 127.0.0.1:9042
[cqlsh 6.1.0 | Cassandra 4.1.1-SNAPSHOT | CQL spec 3.4.6 | Native protocol v5]
Use HELP for help.
cqlsh> CREATE KEYSPACE k WITH replication = {'class': 'SimpleStrategy', 
'replication_factor': 1};
cqlsh> CREATE TABLE k.t ( k1 int, k2 int, v int, primary key ((k1, k2)));
cqlsh> CREATE INDEX IF NOT EXISTS ON k.t(v);
cqlsh> INSERT INTO k.t (k1, k2, v ) VALUES (1, 2, 3);
cqlsh> exit;
yongjiang@local:~/Documents/Code/test/cassandra$ ./bin/nodetool flush
yongjiang@local:~/Documents/Code/test/cassandra$ ./tools/bin/sstabledump 
./data/data/k/t-bc9f5370b63a11ed9fb76fcfbbea78bb/.t_v_idx/nb-1-big-Data.db 
[
  {
    "table kind" : "INDEX",
    "partition" : {
      "key" : [ "3" ],
      "position" : 0
    },
    "rows" : [
      {
        "type" : "row",
        "position" : 18,
        "clustering" : [ "1", "2" ],
        "liveness_info" : { "tstamp" : "2023-02-27T01:05:04.595860Z" },
        "cells" : [ ]
      }
    ]
  }
] {code}

> Support AbstractCompositeType with toJSONString method
> ------------------------------------------------------
>
>                 Key: CASSANDRA-18177
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-18177
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: Local/SSTable
>            Reporter: maxwellguo
>            Assignee: Yong Jiang
>            Priority: Normal
>             Fix For: 4.x
>
>
> As we know AbstractCompositeType do not support toJSONString method , but 
> some times 
> we do need this.
> See the  discusstion of 
> [CASSANDRA-17698|https://issues.apache.org/jira/browse/CASSANDRA-17698].



--
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