diff --git a/serde/src/java/org/apache/hadoop/hive/serde2/typeinfo/BaseCharUtils.java b/serde/src/java/org/apache/hadoop/hive/serde2/typeinfo/BaseCharUtils.java index 09e07c7..bfd1e5f 100644 --- a/serde/src/java/org/apache/hadoop/hive/serde2/typeinfo/BaseCharUtils.java +++ b/serde/src/java/org/apache/hadoop/hive/serde2/typeinfo/BaseCharUtils.java @@ -28,15 +28,15 @@ public class BaseCharUtils { public static void validateVarcharParameter(int length) { - if (length > HiveVarchar.MAX_VARCHAR_LENGTH || length < 1) { - throw new RuntimeException("Varchar length " + length + " out of allowed range [1, " + + if (length > HiveVarchar.MAX_VARCHAR_LENGTH || length < 0) { + throw new RuntimeException("Varchar length " + length + " out of allowed range [0, " + HiveVarchar.MAX_VARCHAR_LENGTH + "]"); } } public static void validateCharParameter(int length) { - if (length > HiveChar.MAX_CHAR_LENGTH || length < 1) { - throw new RuntimeException("Char length " + length + " out of allowed range [1, " + + if (length > HiveChar.MAX_CHAR_LENGTH || length < 0) { + throw new RuntimeException("Char length " + length + " out of allowed range [0, " + HiveChar.MAX_CHAR_LENGTH + "]"); } }