Closed clohfink closed 8 years ago
looks good to me. I liked having the key names, but I agree that it's not really too important (users should know their schema) and I agree with your rationale for simplicity regarding a json2sstable implementation.
would it be possible to get an example output of the compact option?
[
{"partition" : {"key" : ["e","f"]},"rows" : [{"type" : "row","clustering" : ["g","h"],"liveness_info" : {"tstamp" : 1451574763525324},"cells" : [{"name" : "value","value" : "2"}]}]},
{"partition" : {"key" : ["a","b"]},"rows" : [{"type" : "row","clustering" : ["c","d"],"liveness_info" : {"tstamp" : 1451574763506421},"cells" : [{"name" : "value","value" : "1"}]}]}
]
it's not a huge issue, but from the perspective of apps that will use this for streaming it would be best if the beginning [
and ending ]
and the trailing ,
per line were removed. it would mean that each line can be ingested and JSON parsed without having to determine if the line only contains one char and have to rstrip(',')
the row. what do you think?
I would like to keep this as valid json for people who will use normal or incremental parsers (which will still be required when checking for wide partitions or ton of tombstones anyway). We could maybe build a different tool
java -jar sstable-tools.jar dump [sstable]
and come up with different format, a non-hierarchical, all state contained in each object outputted one that just translates the raw binary to something more easily parseable. but I think the "to json" tool should output json. Since doing per line parsing anyway shouldn't be bad to remove a trailing ','.
I think I have an idea that may work for you devdazed. Will take a little so stay tuned
i can live with that, like i said, it's not difficult to strip those things out, was just a very minor annoyance.
Going to go ahead and merge this as there are also some other good changes in here that'd be nice to have on master. We can follow up with another PR for more changes to compact mode or add a dump command, thanks!