You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Alexey Zotov (JIRA)" <ji...@apache.org> on 2014/07/09 07:44:05 UTC

[jira] [Updated] (CASSANDRA-7498) sstable2json exports keys in a wrong format

     [ https://issues.apache.org/jira/browse/CASSANDRA-7498?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexey Zotov updated CASSANDRA-7498:
------------------------------------

    Attachment: CASSANDRA-2.1-7498.txt

I have already created a patch before your comment. 

The patch contains required changes for processing keys in sstable export/import utilities. Regarding backward compatibility, I added an ability to ignore the current key validator type to allow users import previously-generated json files for "non-bytes" keys. For that users need to add -Dskip.key.validator=true parameter during import.

> sstable2json exports keys in a wrong format
> -------------------------------------------
>
>                 Key: CASSANDRA-7498
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-7498
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>            Reporter: Alexey Zotov
>            Assignee: Alexey Zotov
>              Labels: tools
>         Attachments: CASSANDRA-2.1-7498.txt
>
>
> I examined code of _SSTableImport_ and _SSTableExport_ classes and found one thing that looks strange to me. Currently processing (encoding/decoding) of columns' names and values is performed based on CF Comparator and Value Validator correspondingly. But row keys are processed using _#bytesToHex_ and _#hexToBytes_ methods despite of there is Key Validator. Such approach works properly for "bytes" keys only. For other types it exports keys in a wrong format (i.e. they are exported in unreadable form).
> In the scope of this ticket we need to consider backward compatibility (import of previously exported sstables). For "bytes" keys it will work as previously since _#bytesToHex_ and _#hexToBytes_ methods are used in internals of _BytesType_ class. For other types we need to allow an ability to import data using "bytes" despite of configured validator.



--
This message was sent by Atlassian JIRA
(v6.2#6252)