Hive: Unable to insert data in table with 100 or more partition columns Error: in column "PART_NAME" that has maximum length of 767

Hive: Unable to insert data in table with 100 or more partition columns Error: in column "PART_NAME" that has maximum length of 767

我正在使用配置单元,我需要创建一个 table,其中 'n' 普通列和 100 个或更多作为分区列,我能够成功创建 table。 现在,当我用具有相同模式的另一个 table 的数据加载 table 并且所有列都是非分区列时,我收到这样的错误:

Failed with exception MetaException(message:Attempt to store value Failed with exception MetaException(message:Attempt to store value "c1=v1/c2=v2/c3=v3/....c100=v100" in column "PART_NAME" that has maximum length of 767. Please correct your data!)

考虑到最后一行的错误,我尝试减少列名和它们的值,这样得到的分区路径就会变短,而且成功了!!但它不应该像在实时场景中那样,列名的大小和它们的值可以是分区路径的任何东西。

例如这是我创建的 table 查询:

CREATE TABLE xyz( c0 int) PARTITIONED BY ( c1 String,c2 String,c3 String,c4 String.......c100 String) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE

这是我在查询中插入的内容:

INSERT INTO TABLE xyz PARTITION (gc1,c2,c3....,c100) SELECT c0,c1,c2,c3,c4....,c100 FROM table123;

我是不是做错了什么,还是我必须设置一些属性才能使用这么多分区,比如 100 个或更多?
请给我任何线索。
谢谢

我同意专家的意见,我们不应该在 table 中进行这么多分区。

此外,我想引用这一点,因为大多数节点都是基于 unix/linux 的,我们无法创建长度大于 255 字节的文件夹或文件名。这可能是您收到此错误的原因,因为分区只是一个文件夹。

Linux has a maximum filename length of 255 characters for most filesystems (including EXT4), and a maximum path of 4096 characters. eCryptfs is a layered filesystem.