Hive 配置单元中的两列表分区

Hive 配置单元中的两列表分区,hive,subquery,hiveql,Hive,Subquery,Hiveql,我有一个有两列的表 id value abc 11 xyz 12 pqr 11 mno 13 pqr 12 stu 13 wxy 11 我必须通过配置单元或sql查询使用“值”对该表进行分区。在浏览之后,我得到了ans create table table (id string) partitioned by (value string) stored as ORC tblproperties ("orc.compress" =

我有一个有两列的表

  id   value
 abc    11
 xyz    12
 pqr    11
 mno    13 
 pqr    12
 stu    13
 wxy    11

我必须通过配置单元或sql查询使用“值”对该表进行分区。

在浏览之后,我得到了ans

create table table (id string) partitioned by (value string) stored as ORC tblproperties ("orc.compress" = "SNAPPY");


SET hive.exec.dynamic.partition.mode=nonstrict;
SET hive.exec.dynamic.partition=true;

SET hive.exec.max.dynamic.partitions=2048;
SET hive.exec.max.dynamic.partitions.pernode=256;

INSERT INTO table1 PARTITION (value)
select * from table where value is not NULL;

探索之后,我得到了答案

create table table (id string) partitioned by (value string) stored as ORC tblproperties ("orc.compress" = "SNAPPY");


SET hive.exec.dynamic.partition.mode=nonstrict;
SET hive.exec.dynamic.partition=true;

SET hive.exec.max.dynamic.partitions=2048;
SET hive.exec.max.dynamic.partitions.pernode=256;

INSERT INTO table1 PARTITION (value)
select * from table where value is not NULL;

我在配置单元中获得了一些关于表分区的文档,但它不适用于两列表。
通过键(id,value)分区2更改表1分区
@Dev.Joel error
ParseException行1:21无法通过alter table语句(state=42000,code=40000)中的“”键识别“分区”附近的输入
仍然相同
ParseException行1:21无法通过“”识别“分区”附近的输入(”在alter table语句中(state=42000,code=40000)
@Dev.Joel我认为这根本不是mysql的问题。Hadoop。我删除了一些标记。如果你愿意,可以将它们反馈给任何人。我在hive中获得了一些关于表分区的文档,但它不适用于两列表。
按键(id、值)更改表table1分区分区2;
@Dev.Joel error
ParseException行1:21无法通过alter table语句(state=42000,code=40000)中的“键”识别“分区”附近的输入。
仍然相同
ParseException行1:21无法通过alter table语句(state=42000,code=40000)中的“”识别“分区”附近的输入
@Dev.Joel我认为这根本不是mysql的问题。Hadoop。我删除了一些标记。如果你愿意,可以将它们反馈给任何人。这会占用大量内存,但任何人都有更好的解决方案,所以请给我删除这两个属性
SET hive.exec.max.dynamic.partitions=2048;SET hive.exec.max.dynamic.partitions.pernode=256
这不是t必需。它占用了大量内存,但仍有人有更好的解决方案,因此请为它提供删除这两个属性
设置hive.exec.max.dynamic.partitions=2048;设置hive.exec.max.dynamic.partitions.pernode=256
这不是必需的。