apache/cassandra · error · IllegalArgumentException

Table id not specified.

Error message

Table id not specified.

What it means

validate() requires a non-null tableId (the UUID identifying the table) in addition to the table name. The tableId is what the dictionary is actually keyed on internally, so a missing UUID makes the descriptor ambiguous and is rejected.

Source

Thrown at src/java/org/apache/cassandra/db/compression/CompressionDictionaryDetailsTabularData.java:292

         *     <li>keyspace, table and table id are not null</li>
         *     <li>dict id is lower than 0</li>
         *     <li>dict is not null nor empty</li>
         *     <li>dict length is less than or equal to 1MiB</li>
         *     <li>kind is not null and there is such {@link org.apache.cassandra.db.compression.CompressionDictionary.Kind}</li>
         *     <li>dictLength is bigger than 0</li>
         *     <li>dictLength has to be equal to dict's length</li>
         *     <li>dictChecksum has to be equal to checksum computed as part of this method</li>
         *     <li>creation date is not null</li>
         * </ul>
         */
        private void validate()
        {
            if (keyspace == null)
                throw new IllegalArgumentException("Keyspace not specified.");
            if (table == null)
                throw new IllegalArgumentException("Table not specified.");
            if (tableId == null)
                throw new IllegalArgumentException("Table id not specified.");
            if (dictId <= 0)
                throw new IllegalArgumentException("Provided dictionary id must be positive but it is '" + dictId + "'.");
            if (dict == null || dict.length == 0)
                throw new IllegalArgumentException("Provided dictionary byte array is null or empty.");
            if (kind == null)
                throw new IllegalArgumentException("Provided kind is null.");

            CompressionDictionary.Kind dictionaryKind;

            try
            {
                dictionaryKind = CompressionDictionary.Kind.valueOf(kind);
            }
            catch (IllegalArgumentException ex)
            {
                throw new IllegalArgumentException("There is no such dictionary kind like '" + kind + "'. Available kinds: " + Arrays.asList(CompressionDictionary.Kind.values()));
            }

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Resolve the TableId from the keyspace/table name (e.g. via SchemaManager/schema metadata) and set it on the data object
  2. If constructing from user input, parse the UUID explicitly and fail fast with a clearer message
  3. Check the CompositeData source includes the TABLE_ID item

Example fix

// before
TableId tableId = null; // never resolved
new CompressionDictionaryDataObject("ks", "tbl", tableId, ...);
// after
TableId tableId = Schema.instance.getTableId("ks", "tbl");
new CompressionDictionaryDataObject("ks", "tbl", tableId, ...);
Defensive patterns

Strategy: validation

Validate before calling

if (obj.tableId == null) throw new IllegalArgumentException("tableId must be resolved (TableId) before creating CompressionDictionaryDataObject");

Type guard

boolean hasTableId(CompressionDictionaryDataObject o) { return o.tableId != null; }

Try / catch

try { tabularData.fromDataObject(obj); } catch (IllegalArgumentException e) { if (e.getMessage().contains("Table id not specified")) { /* resolve TableId via Schema and rebuild */ } else throw e; }

Prevention

When it happens

Trigger: Creating a CompressionDictionaryDataObject with tableId == null — e.g. the caller knows the table name but never resolved its UUID (TableId) before importing the dictionary.

Common situations: Import scripts that use only 'ks.tbl' names; JMX clients passing partial descriptor data; UUID lost when round-tripping through text formats.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


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