hadoop - 配置单元动态分区不起作用

标签 hadoop hive

我正在尝试在表中创建动态分区。

1)第一个表称为stock1,其中驻留了未分区的数据。
这是模式:

hive> describe stock1;
id                      int
xcg                     string
stock                   string
sector                  string
country                 string
dt                      string
open                    float
high                    float
low                     float
close                   float
volume                  int
adj_close               float

2)第二张表是stock2,我希望在其中对数据进行动态分区。
hive> create table stock2(id int,stock string,sector string,country string,dt string,open float,high float,low float,close float,volume int,adj_close float) PARTITIONED BY (xchng string);

3)现在启用动态分区:
set hive.exec.dynamic.partition=true;
set hive.exec.dynamic.partition.mode=nonstrict;

4)将数据从stock1加载到stock2中。
insert overwrite table stock2 partition(xchng)select id,stock,sector,country,dt,open,high,low,close,volume,adj_close,t.xcg as xchng from stock1 t;

现在,当我检查hive文件夹下的stock2时,我只会看到一个默认分区

/user/hive/warehouse/stock.db/stock2/xchng= HIVE_DEFAULT_PARTITION

如何更正,以便为每个xchng获得单独的文件夹。

最佳答案

您可以检查“stock1”中的所有“xcg”值吗?至少某些值或所有值可能不符合String格式。我的意思是前。可以为null或数字,而不是字符串。

关于hadoop - 配置单元动态分区不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37090944/

相关文章:

hadoop - 解析并加载到 Hive/Hadoop

hadoop - 'From' 语句中 HiveQL 中的 UDF

hadoop - oozie 协调员作业未在给定的开始时间开始

hadoop - Phoenix未从Cloudera CDH5发行版连接在Zookeeper上

hadoop - 基于时间的桶记录(kafka-hdfs-connector)

android - 如何将android连接到AWS EC2实例中安装的Hive?

mysql - Hive 查询中的错误

unix - 从Pig中的元组中提取键值对

hadoop - 具有 Parquet 数据的 Hive 外部表未选择数据

hadoop - Hive Tez reducer 运行速度超慢