ScyllaDB University Live | Free Virtual Training Event
Learn more
ScyllaDB Documentation Logo Documentation
  • Server
  • Cloud
  • Tools
    • ScyllaDB Manager
    • ScyllaDB Monitoring Stack
    • ScyllaDB Operator
  • Drivers
    • CQL Drivers
    • DynamoDB Drivers
  • Resources
    • ScyllaDB University
    • Community Forum
    • Tutorials
Download
ScyllaDB Docs ScyllaDB C# driver Features CQL data types to C# types Nulls and unset

Nulls and unset¶

Null and unset values¶

To complete a distributed delete operation, Cassandra replaces it with a special value called a tombstone which can be propagated to replicas. When inserting or updating a field, Cassandra allows you to set a certain field to null as a way to clear the value of a field and it is considered a delete operation.

In some cases, you might be inserting rows using null for values that are not specified, and even though our intention is to leave the value empty, Cassandra represents it as a tombstone causing an unnecessary overhead.

To avoid tombstones, in previous versions of Cassandra, you can use different query combinations only containing the fields that have a value.

Unset¶

Cassandra 2.2 introduced the concept of “unset” for a parameter value. At server level, this field value is not considered. This can be represented in the C# driver with the class Unset.

// Prepare once in your application lifetime
var ps = session.Prepare("INSERT INTO tbl1 (id, val1) VALUES (?, ?)");

// Bind the unset value in a prepared statement
session.Execute(ps.Bind(id, Unset.Value));

Was this page helpful?

PREVIOUS
Date and time representation
NEXT
Execution Profiles
  • Create an issue
  • Edit this page

On this page

  • Nulls and unset
    • Null and unset values
    • Unset
ScyllaDB C# driver
  • master
    • master
  • Features
    • Address resolution
    • Authentication and Authorization
    • Automatic failover
    • Column Encryption
    • Driver components
      • ADO.NET
      • Core component
        • Statements
          • Batch statements
          • Per-query keyspace
          • Prepared statements
          • Simple statements
      • Linq component
        • Batch statements with LINQ
      • Mapper component
        • Batch statements with the Mapper
    • Connection heartbeat
    • Connection pooling
    • CQL data types to C# types
      • Date and time representation
      • Nulls and unset
    • Execution Profiles
    • Graph support
    • Cluster and schema metadata
    • Metrics
      • App.Metrics Provider
      • List of metrics
    • Native protocol
    • OpenTelemetry
    • Result paging
    • Parameterized queries
    • Query timestamps
    • Query warnings
    • Request Tracker
    • Routing queries
    • Speculative query execution
    • TLS/SSL
    • Tuning policies
    • User-defined functions and aggregates
    • User-defined types
    • Vector support
  • FAQ
  • Upgrade Guide
  • Examples
  • API Reference
Docs Tutorials University Contact Us About Us
© 2025 ScyllaDB | Terms of Service | Privacy Policy | ScyllaDB, and ScyllaDB Cloud, are registered trademarks of ScyllaDB, Inc.
Last updated on 01 Aug 2025.
Powered by Sphinx 7.4.7 & ScyllaDB Theme 1.8.7
Ask AI