You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by zh...@apache.org on 2021/03/03 06:48:36 UTC

[hbase] branch branch-2.4 updated: HBASE-25421 There is no limit on the column length when creating a table (#2796)

This is an automated email from the ASF dual-hosted git repository.

zhangduo pushed a commit to branch branch-2.4
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-2.4 by this push:
     new 824e7a4  HBASE-25421 There is no limit on the column length when creating a table (#2796)
824e7a4 is described below

commit 824e7a46a24ea5c2e589348b2ea4c34c50f0f14c
Author: lidingshengHHU <50...@users.noreply.github.com>
AuthorDate: Wed Mar 3 14:42:39 2021 +0800

    HBASE-25421 There is no limit on the column length when creating a table (#2796)
    
    Signed-off-by: Duo Zhang <zh...@apache.org>
---
 .../java/org/apache/hadoop/hbase/client/TableDescriptorBuilder.java   | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/TableDescriptorBuilder.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/TableDescriptorBuilder.java
index 5370321..7301315 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/TableDescriptorBuilder.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/TableDescriptorBuilder.java
@@ -1068,6 +1068,10 @@ public class TableDescriptorBuilder {
       if (family.getName() == null || family.getName().length <= 0) {
         throw new IllegalArgumentException("Family name cannot be null or empty");
       }
+      int flength = family.getName() == null ? 0 : family.getName().length;
+      if (flength > Byte.MAX_VALUE) {
+        throw new IllegalArgumentException("The length of family name is bigger than " + Byte.MAX_VALUE);
+      }
       if (hasColumnFamily(family.getName())) {
         throw new IllegalArgumentException("Family '"
                 + family.getNameAsString() + "' already exists so cannot be added");