ScyllaDB University LIVE, FREE Virtual Training Event | March 21
Register for Free
ScyllaDB Documentation Logo Documentation
  • Deployments
    • Cloud
    • Server
  • Tools
    • ScyllaDB Manager
    • ScyllaDB Monitoring Stack
    • ScyllaDB Operator
  • Drivers
    • CQL Drivers
    • DynamoDB Drivers
    • Supported Driver Versions
  • Resources
    • ScyllaDB University
    • Community Forum
    • Tutorials
Install
Search Ask AI
ScyllaDB Docs ScyllaDB Manual ScyllaDB for Administrators Admin Tools ScyllaDB Types
For AI agents: a documentation index is available at https://docs.scylladb.com/manual/master/llms.txt. A Markdown version of this page is at https://docs.scylladb.com/manual/master/operating-scylla/admin-tools/scylla-types.md.

Caution

You're viewing documentation for an unstable version of ScyllaDB Manual. Switch to the latest stable version.

ScyllaDB Types¶

Introduction¶

This tool allows you to examine raw values obtained from SStables, logs, coredumps, etc., by performing operations on them, such as deserialize, compare, or validate. See Supported Operations for details.

Run scylla types --help for additional information about the tool and the operations.

Usage¶

The command syntax is as follows:

scylla types <operation> [options] <hex_value1> [hex_value2]
  • By default, provide the values in the hex form without a leading 0x prefix. The exception is the serialize operation, which expects values in human-readable form. Some operations accept values in other formats too, see Input Formats.

  • You must specify the type of the provided values. See Specifying the Value Type.

  • The number of provided values depends on the operation. See Supported Operations for details.

  • The scylla types operations come with additional options. See Additional Options for the list of options.

Specifying the Value Type¶

You must specify the type of the value(s) you want to examine by adding the -t [type name] option to the operation. Specify the type by providing either its CQL name (for example, int or map<int, text>) or its Cassandra class name (the prefix can be omitted, for example, you can provide Int32Type instead of org.apache.cassandra.db.marshal.Int32Type). See CQL3 Type Mapping for a mapping of CQL types to Cassandra type class names. CQL names are case-insensitive and can be mixed with Cassandra class names, for example, ReversedType(timeuuid).

Type names and values containing spaces, for example MapType(Int32Type, UTF8Type), have to be quoted on the command line.

If you provide more than one value, all of the values must share the same type. For example:

scylla types deserialize -t Int32Type b34b62d4 00783562

Compounds

A compound is a single value that is composed of multiple values of possibly different types. An example of a compound value is a clustering key or a partition key.

You can use the --prefix-compound, --full-compound or --legacy-composite options to indicate that the provided value is a compound (see Additional Options) for details. These options have more human-friendly aliases, which can be used interchangeably with them: --clustering-key (alias of --prefix-compound), --partition-key (alias of --full-compound) and --legacy-partition-key (alias of --legacy-composite).

Full compounds (partition keys) can be serialized in two formats: ScyllaDB’s in-memory format (--full-compound), which is the format partition keys are printed in, in ScyllaDB’s logs, and the legacy composite format (--legacy-composite), which is the format partition keys are stored in, in SStables. Note that in the legacy composite format, single-component keys are serialized as the value of the component.

When a value is a compound, you can specify a different type for each value making up the compound, respectively (i.e., the order of the types on the command line must be the same as the order in the compound). For example:

scylla types deserialize --prefix-compound -t TimeUUIDType -t Int32Type 0010d00819896f6b11ea00000000001c571b000400000010

Schema file

Instead of specifying the type(s) with -t, you can load the schema of the table the values belong to, from a schema file, with --schema-file. The schema file is expected to contain the CREATE TABLE statement of exactly one table, possibly preceded by CREATE KEYSPACE and CREATE TYPE statements (for the UDTs the table uses). This is the same schema file format accepted by scylla sstable. When loading the type from the schema file, you also have to specify which type of the table the values belong to:

  • --column <name> - The type of the named column. For clustering columns, this is the type the clustering order of the column applies to (ReversedType for descending order).

  • --prefix-compound (--clustering-key) - The clustering key.

  • --full-compound (--partition-key) or --legacy-composite (--legacy-partition-key) - The partition key. When working with partition keys of a table loaded from a schema file, its partitioner is used too (e.g., the CDC partitioner for CDC log tables), so tokenof, shardof and ring-order-compare work correctly even for tables with non-default partitioners.

For example:

scylla types deserialize --schema-file schema.cql --partition-key 0004000000010003616263

Input Formats¶

The format of the provided values can be selected with the -f (or --input-format) option. The supported input formats are:

  • hex - The values are serialized, hex encoded, without a leading 0x prefix. This is the default for all operations, except serialize.

  • text - The values are unserialized, in their human-readable string representation. This is the default for the serialize operation. This saves the need to serialize the values with the serialize operation first, before passing them to another operation.

  • json - The values are unserialized, in their JSON representation, the same format accepted by INSERT JSON. Values of collection and vector types have no string representation, they can only be provided in this format.

Not all operations support all input formats, see Supported Operations. For operations which operate on more than one value, unserialized values are interpreted as follows:

  • compare and ring-order-compare - The first half of the values make up the first compared value, the second half the second one. This allows comparing compounds, which are made up of multiple values.

  • tokenof and shardof - All values make up a single partition key.

Note that boost program options, used to parse the command line, doesn’t support -f=<format>, use -f <format> or --input-format=<format>.

Supported Operations¶

  • serialize - Serializes the value and prints it in a hex encoded form. Input formats: text (default), json. Required arguments: 1 value in human-readable form, or in the case of compounds, 1 value for each component (--full-compound), or for some of the components (--prefix-compound). To avoid problems around special symbols, separate values with -- from the rest of the arguments. Values of collection and vector types (including tuples and UDTs, which have fields of such types) have no string representation, they can only be serialized from their JSON representation (-f json).

  • deserialize - Deserializes and prints the provided value in a human-readable form. Input formats: hex. Required arguments: 1 or more serialized values.

  • compare - Compares two values and prints the result. Input formats: hex (default), text, json. Required arguments: 2 values.

  • ring-order-compare - Compares two partition keys in ring order, the order ScyllaDB orders partitions in, and prints the result, along with the tokens of the keys: partition keys are ordered by their token first and only by the keys themselves on token collision. Input formats: hex (default), text, json. Required arguments: 2 values. Only accepts partition keys (--full-compound/--partition-key or --legacy-composite/--legacy-partition-key).

  • validate - Verifies if the value is valid for the type, according to the requirements of the type. Input formats: hex. Required arguments: 1 or more serialized values.

  • tokenof - Calculates the token of the partition key (i.e. decorates it). Input formats: hex (default), text, json. Required arguments: 1 or more values. Only accepts partition keys (--full-compound/--partition-key or --legacy-composite/--legacy-partition-key).

  • shardof - Calculates the token of the partition key and the shard it belongs to, given the provided shard configuration (--shards and --ignore-msb-bits). In most cases, only --shards has to be provided unless you have a non-standard configuration. Input formats: hex (default), text, json. Required arguments: 1 or more values. Only accepts partition keys (--full-compound/--partition-key or --legacy-composite/--legacy-partition-key).

You can learn more about each operation by invoking its help:

scylla types $OPERATION --help

Additional Options¶

You can run scylla types [operation] --help for additional information on a given operation.

  • -h ( or --help) - Prints the help message.

  • --help-seastar - Prints the help message about the Seastar options.

  • --help-loggers - Prints a list of logger names.

  • -t ( or --type) - Specifies the type of the provided value. See Specifying the Value Type.

  • --schema-file - Path to a schema file, to load the type of the values from, instead of specifying it with -t. See Schema file.

  • --column - The name of the column, which the values belong to. Only usable with --schema-file.

  • --prefix-compound (or --clustering-key) - Indicates that the value is a prefixable compound (e.g., clustering key) composed of multiple values of possibly different types.

  • --full-compound (or --partition-key) - Indicates that the value is a full compound (e.g., partition key) composed of multiple values of possibly different types.

  • --legacy-composite (or --legacy-partition-key) - Indicates that the value is a full compound (e.g., partition key), serialized in the legacy composite format, used in SStables, instead of ScyllaDB’s in-memory format.

  • -f (or --input-format) - The format the values are provided in: hex, text or json. See Input Formats.

  • --shards - The number of shards (only relevant for the shardof operation).

  • --ignore-msb-bits - The number of the most significant bits of the token to ignore, when calculating the shard. Defaults to 12, the default value of the murmur3_partitioner_ignore_msb_bits configuration option (only relevant for the shardof operation).

  • --value arg - Specifies the value to process (if not provided as a positional argument).

Examples¶

  • Serializing a value of type Int32Type:

    scylla types serialize -t Int32Type -- -1286905132
    

    Output:

     b34b62d4
    
  • Serializing a clustering-key (--prefix-compound):

    scylla types serialize --prefix-compound -t TimeUUIDType -t Int32Type -- d0081989-6f6b-11ea-0000-0000001c571b 16
    

    Output:

     0010d00819896f6b11ea00000000001c571b000400000010
    
  • Serializing a clustering-key prefix (--prefix-compound), with only some of the components present:

    scylla types serialize --prefix-compound -t TimeUUIDType -t Int32Type -- d0081989-6f6b-11ea-0000-0000001c571b
    

    Output:

     0010d00819896f6b11ea00000000001c571b
    
  • Serializing a partition-key (--full-compound):

    scylla types serialize --full-compound -t Int32Type -t UTF8Type -- 1 abc
    

    Output:

     0004000000010003616263
    
  • Serializing a partition-key in the legacy composite format, used in SStables (--legacy-composite):

    scylla types serialize --legacy-composite -t Int32Type -t UTF8Type -- 1 abc
    

    Output:

     00040000000100000361626300
    
  • Serializing a value of a collection type, from its JSON representation (-f json):

    scylla types serialize -f json -t 'map<int, text>' -- '{"1": "a"}'
    

    Output:

     0000000100000004000000010000000161
    
  • Deserializing and printing a value of type Int32Type:

    scylla types deserialize -t Int32Type b34b62d4
    

    Output:

    -1286905132
    
  • Validating a value of type Int32Type:

    scylla types validate -t Int32Type b34b62d4
    

    Output:

    b34b62d4: VALID - -1286905132
    
  • Deserializing a value of a collection type, specified with its CQL name:

    scylla types deserialize -t 'map<int, text>' 0000000100000004000000010000000161
    

    Output:

    {1 : a}
    
  • Comparing two values of ReversedType(TimeUUIDType):

    scylla types compare -t 'ReversedType(TimeUUIDType)' b34b62d46a8d11ea0000005000237906 d00819896f6b11ea00000000001c571b
    

    Output:

    b34b62d4-6a8d-11ea-0000-005000237906 > d0081989-6f6b-11ea-0000-0000001c571b
    
  • Comparing two partition keys in ring order. Note that compare would return the opposite result, as it compares the components of the keys, not their tokens:

    scylla types ring-order-compare --partition-key -t Int32Type -t UTF8Type 0004000000010003616263 0004000000020003616263
    

    Output:

    {token: 8771735466527499816, key: (1, abc)} > {token: -3504390351319460166, key: (2, abc)}
    
  • Deserializing and printing a compound value:

    scylla types deserialize --prefix-compound -t TimeUUIDType -t Int32Type 0010d00819896f6b11ea00000000001c571b000400000010
    

    Output:

    (d0081989-6f6b-11ea-0000-0000001c571b, 16)
    
  • Calculating the token of a partition key:

    scylla types tokenof --full-compound -t UTF8Type -t SimpleDateType -t UUIDType 000d66696c655f696e7374616e63650004800049190010c61a3321045941c38e5675255feb0196
    

    Output:

     (file_instance, 2021-03-27, c61a3321-0459-41c3-8e56-75255feb0196): -5043005771368701888
    
  • Calculating the token of a partition key, provided in human-readable form (-f text):

    scylla types tokenof --partition-key -t text -t date -t uuid -f text -- file_instance 2021-03-27 c61a3321-0459-41c3-8e56-75255feb0196
    

    Output:

     (file_instance, 2021-03-27, c61a3321-0459-41c3-8e56-75255feb0196): -5043005771368701888
    
  • Calculating the owner shard of a partition key:

    scylla types shardof --full-compound -t UTF8Type -t SimpleDateType -t UUIDType --shards=7 000d66696c655f696e7374616e63650004800049190010c61a3321045941c38e5675255feb0196
    

    Output:

     (file_instance, 2021-03-27, c61a3321-0459-41c3-8e56-75255feb0196): token: -5043005771368701888, shard: 1
    

Was this page helpful?

PREVIOUS
ScyllaDB SStable Script API
NEXT
SSTableLoader
  • Create an issue
  • Edit this page

On this page

  • ScyllaDB Types
    • Introduction
    • Usage
    • Specifying the Value Type
    • Input Formats
    • Supported Operations
    • Additional Options
    • Examples
ScyllaDB Manual
Search Ask AI
  • master
    • master
    • 2026.4
    • 2026.3
    • 2026.2
    • 2026.1
    • 2025.4
    • 2025.3
    • 2025.2
    • 2025.1
  • Getting Started
    • Install ScyllaDB 2026.3
      • Launch ScyllaDB 2026.3 on AWS
      • Launch ScyllaDB 2026.3 on GCP
      • Launch ScyllaDB 2026.3 on Azure
      • Launch ScyllaDB 2026.3 on Oracle Cloud Infrastructure (OCI)
      • ScyllaDB Web Installer for Linux
      • Install ScyllaDB 2026.3 Linux Packages
      • Run ScyllaDB in Docker
      • Install ScyllaDB Without root Privileges
      • Air-gapped Server Installation
      • ScyllaDB Developer Mode
    • Configure ScyllaDB
    • ScyllaDB Configuration Reference
    • ScyllaDB Requirements
      • System Requirements
      • OS Support
      • Cloud Instance Recommendations
      • ScyllaDB in a Shared Environment
    • Migrate to ScyllaDB
      • Migration Process from Cassandra to ScyllaDB
      • ScyllaDB and Apache Cassandra Compatibility
      • Migration Tools Overview
  • ScyllaDB for Administrators
    • Administration Guide
    • Procedures
      • Cluster Management
      • Backup & Restore
      • Change Configuration
      • Maintenance
      • Best Practices
      • Benchmarking ScyllaDB
      • Migrate from Cassandra to ScyllaDB
    • Security
      • ScyllaDB Security Checklist
      • Enable Authentication
      • Enable and Disable Authentication Without Downtime
      • Creating a Superuser
      • Generate a cqlshrc File
      • Reset Authenticator Password
      • Enable Authorization
      • Grant Authorization CQL Reference
      • Certificate-based Authentication
      • Certificate or Password Authentication
      • Role Based Access Control (RBAC)
      • ScyllaDB Auditing Guide
      • Encryption: Data in Transit Client to Node
      • Encryption: Data in Transit Node to Node
      • Generating a self-signed Certificate Chain Using openssl
      • Configure SaslauthdAuthenticator
      • Encryption at Rest
      • LDAP Authentication
      • LDAP Authorization (Role Management)
      • Software Bill Of Materials (SBOM)
    • Admin Tools
      • Nodetool Reference
      • CQLSh
      • Admin REST API
      • Tracing
      • ScyllaDB SStable
      • ScyllaDB SStable Script API
      • ScyllaDB Types
      • SSTableLoader
      • cassandra-stress
      • ScyllaDB Logs
      • Seastar Perftune
      • Virtual Tables
      • Reading mutation fragments
      • Maintenance socket
      • Maintenance mode
      • Task manager
      • Compression Advisor
    • ScyllaDB Monitoring Stack
    • ScyllaDB Operator
    • ScyllaDB Manager
    • Upgrade Procedures
      • Upgrade Guides
    • System Configuration
      • System Configuration Guide
      • scylla.yaml
      • ScyllaDB Snitches
      • Configuration Parameters
    • Benchmarking ScyllaDB
    • ScyllaDB Diagnostic Tools
  • ScyllaDB for Developers
    • Develop with ScyllaDB
    • Tutorials and Example Projects
    • Learn to Use ScyllaDB
    • ScyllaDB Alternator
    • ScyllaDB Drivers
  • CQL Reference
    • CQLSh: the CQL shell
    • Reserved CQL Keywords and Types (Appendices)
    • Compaction
    • Consistency Levels
    • Consistency Level Calculator
    • Data Definition
    • Data Manipulation
      • SELECT
      • Selecting an excerpt
      • INSERT
      • UPDATE
      • DELETE
      • BATCH
    • Data Types
    • Definitions
    • Global Secondary Indexes
    • Expiring Data with Time to Live (TTL)
    • Functions
    • CQL Guardrails
    • Wasm support for user-defined functions
    • JSON Support
    • Materialized Views
    • DESCRIBE SCHEMA
    • Configuring a Cluster with CQL
    • Service Levels
    • ScyllaDB CQL Extensions
  • Alternator: DynamoDB API in ScyllaDB
    • Getting Started With ScyllaDB Alternator
    • ScyllaDB Alternator for DynamoDB users
    • Alternator-specific APIs
    • Reducing network costs in Alternator
    • Alternator Vector Search
    • Alternator client libraries
  • Features
    • Lightweight Transactions
    • Global Secondary Indexes
    • Local Secondary Indexes
    • Materialized Views
    • Counters
    • Change Data Capture
      • CDC Overview
      • The CDC Log Table
      • Basic operations in CDC
      • CDC Streams
      • CDC Stream Changes
      • Querying CDC Streams
      • Advanced column types
      • Preimages and postimages
      • Data Consistency in CDC
    • Workload Attributes
    • Workload Prioritization
    • Backup and Restore
    • Incremental Repair
    • Automatic Repair
    • Vector Search
    • Full-Text Search
    • Pattern Search
  • ScyllaDB Architecture
    • Data Distribution with Tablets
    • ScyllaDB Ring Architecture
    • ScyllaDB Fault Tolerance
    • Consistency Level Console Demo
    • ScyllaDB Anti-Entropy
      • ScyllaDB Hinted Handoff
      • ScyllaDB Read Repair
      • ScyllaDB Repair
    • SSTable
      • ScyllaDB SSTable - 2.x
      • ScyllaDB SSTable - 3.x
    • Compaction Strategies
    • Raft Consensus Algorithm in ScyllaDB
    • Zero-token Nodes
  • Troubleshooting ScyllaDB
    • Errors and Support
      • Report a ScyllaDB problem
      • Error Messages
      • Change Log Level
    • ScyllaDB Startup
      • Ownership Problems
      • ScyllaDB will not Start
    • Cluster and Node
      • Handling Node Failures
      • Failure to Add, Remove, or Replace a Node
      • Failed Decommission Problem
      • Cluster Timeouts
      • Node Joined With No Data
      • NullPointerException
      • Failed Schema Sync
    • Data Modeling
      • ScyllaDB Large Partitions Table
      • ScyllaDB Large Rows and Cells Table
      • Large Partitions Hunting
      • Failure to Update the Schema
    • Data Storage and SSTables
      • Space Utilization Increasing
      • Disk Space is not Reclaimed
      • SSTable Corruption Problem
      • Pointless Compactions
      • Limiting Compaction
    • CQL
      • Time Range Query Fails
      • COPY FROM Fails
      • CQL Connection Table
    • ScyllaDB Monitor and Manager
      • Manager and Monitoring integration
      • Manager lists healthy nodes as down
    • Installation and Removal
      • Removing ScyllaDB on Ubuntu breaks system packages
  • Knowledge Base
    • Compaction
    • Consistency in ScyllaDB
    • Counting all rows in a table is slow
    • CQL Query Does Not Display Entire Result Set
    • Run ScyllaDB and supporting services as a custom user:group
    • Customizing CPUSET
    • Decoding Stack Traces
    • Snapshots and Disk Utilization
    • Debug your database with Flame Graphs
    • Efficient Tombstone Garbage Collection in ICS
    • How to Change gc_grace_seconds for a Table
    • Gossip in ScyllaDB
    • How does ScyllaDB LWT Differ from Apache Cassandra ?
    • Map CPUs to ScyllaDB Shards
    • ScyllaDB Memory Usage
    • NTP Configuration for ScyllaDB
    • ScyllaDB consistency quiz for administrators
    • Recreate RAID devices
    • How to Safely Increase the Replication Factor
    • Increase ScyllaDB resource limits over systemd
    • ScyllaDB Seed Nodes
    • How to Set up a Swap Space
    • ScyllaDB Snapshots
    • ScyllaDB payload sent duplicated static columns
    • Stopping a local repair
    • How to flush old tombstones from a table
    • Time to Live (TTL) and Compaction
    • ScyllaDB Nodes are Unresponsive
    • Update a Primary Key
    • Using the perf utility with ScyllaDB
    • Configure ScyllaDB Networking with Multiple NIC/IP Combinations
  • Reference
    • AWS Images
    • Azure Images
    • GCP Images
    • OCI Images
    • Configuration Parameters
    • Glossary
    • Limits
    • API Reference
      • Authorization Cache
      • Cache Service
      • Column Family
      • Commit Log
      • Compaction Manager
      • Endpoint Snitch Info
      • Error Injection
      • Failure Detector
      • Gossiper
      • Hinted Handoff
      • LSA
      • Messaging Service
      • Raft
      • Storage Proxy
      • Storage Service
      • Stream Manager
      • System
      • Task Manager Test
      • Task Manager
      • Tasks
    • Metrics
  • ScyllaDB FAQ
  • 2024.2 and earlier documentation
Docs Tutorials University Contact Us About Us
© 2026, ScyllaDB. All rights reserved. | Terms of Service | Privacy Policy | ScyllaDB, and ScyllaDB Cloud, are registered trademarks of ScyllaDB, Inc.
Last updated on 08 Oct 2026.
Powered by Sphinx 9.1.1 & ScyllaDB Theme 1.10.0