apache/cassandra · error · InvalidRequestException

Invalid null set element

Error message

Invalid null set element

What it means

In ElementDiscarder.execute (DELETE m[key] on a non-frozen set), the bound key term evaluated to null. A null element cannot identify a set member to tombstone, so the deletion is rejected with InvalidRequestException before adding the tombstone.

Solutions

  1. Ensure the term bound for the set element does not evaluate to null before executing the delete
  2. Guard the delete operation so it is skipped when the element term binds to null
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/java/org/apache/cassandra/cql3/terms/Sets.java:339 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/c7e75c2548d53148. Report an issue: GitHub.

Appendix: source

Thrown at src/java/org/apache/cassandra/cql3/terms/Sets.java:339

            for (ByteBuffer bb : toDiscard)
                builder.addTombstone(column, CellPath.create(bb));
        }
    }

    public static class ElementDiscarder extends Operation
    {
        public ElementDiscarder(ColumnMetadata column, Term k)
        {
            super(column, k);
        }

        public void execute(DecoratedKey partitionKey, RowUpdateBuilder builder) throws InvalidRequestException
        {
            assert column.type.isMultiCell() : "Attempted to delete a single element in a frozen set";
            Term.Terminal elt = t.bind(builder);
            if (elt == null)
                throw new InvalidRequestException("Invalid null set element");

            builder.addTombstone(column, CellPath.create(elt.get()));
        }
    }
}

View on GitHub (pinned to 88fd0f6a0e)