You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by "Jaehui Lee (Jira)" <ji...@apache.org> on 2025/11/19 00:53:00 UTC

[jira] [Created] (HBASE-29721) Add validation for Mutations without column families

Jaehui Lee created HBASE-29721:
----------------------------------

             Summary: Add validation for Mutations without column families
                 Key: HBASE-29721
                 URL: https://issues.apache.org/jira/browse/HBASE-29721
             Project: HBase
          Issue Type: Improvement
            Reporter: Jaehui Lee
            Assignee: Jaehui Lee


h2. Problem

When executing an Increment without column families via batch API, the client does not throw an error and the operation succeeds silently, resulting in no actual changes.
h2. Description

There are four classes that inherit from the Mutation class: Put, Increment, Append, and Delete.

These mutations can be executed through the following APIs:
 * Direct method calls (table.put(), table.increment(), table.append(), table.delete())
 * table.mutateRow()
 * bufferedMutator.mutate()
 * table.checkAndMutate()
 * table.batch()

The following table summarizes the behavior when each Mutation type lacks column families across different APIs:
||API \ Mutation||Put||Increment||Append||Delete||
|Direct method call|✗|✗|✗|✓|
|table.mutateRow()|✗|✓|✓|✓|
|bufferedMutator.mutate()|✗|✓|✓|✓|
|table.checkAndMutate()|✗|✓|✓|✓|
|table.batch()|✗|✓|✓|✓|

(✗ = fails/throws exception, ✓ = succeeds/allowed)

Delete operations are naturally allowed without column families because a Delete with only a row key means deleting the entire row.

Put operations are properly validated in all cases—they fail when column families are missing.

However, Increment and Append should also fail in all cases when column families are absent, but currently they only fail on direct method calls. They are incorrectly allowed through other APIs.
h2. Solution

Currently, only the validatePut() method exists to validate Put operations at the client level. This validation should be extended to all Mutation types except Delete.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)