Hive 如何在通过配置单元创建分区时不使用分区名称

Hive 如何在通过配置单元创建分区时不使用分区名称,hive,orc,Hive,Orc,我们有一个表(表1),它是按年、月、日划分的。 我创建了一个orc表,类似于表1,具有类似的分区,但类型为orc。我正试图插入 使用下面的语句将日期添加到分区中,但我将数据转储到具有分区名称的文件夹中。 如何确保文件夹中没有分区名称 create external table table1_orc( col1 string, col2 string, col3 int PARTITIONED BY ( `year` string, `month` string, `day` string) R

我们有一个表(表1),它是按年、月、日划分的。 我创建了一个orc表,类似于表1,具有类似的分区,但类型为orc。我正试图插入 使用下面的语句将日期添加到分区中,但我将数据转储到具有分区名称的文件夹中。 如何确保文件夹中没有分区名称

create external table table1_orc(
col1 string,
col2 string,
col3 int
PARTITIONED BY ( 
`year` string,
`month` string,
`day` string)
ROW FORMAT SERDE 'org.apache.hadoop.hive.ql.io.orc.OrcSerde'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.orc.OrcInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat'
LOCATION '/base_path_orc/';

set hive.exec.dynamic.partition=true;
insert overwrite table table1_orc partition(year,month,day) select * from table1 where year = '2015' and month = '10' and day = '01';
hdfs-/base_Path/2015/10/01/data.csv中表1的路径

hdfs中orc表的路径(当前输出)-/base\u Path\u orc/year=2015/month=10/day=01/000000\u 0


期望输出-/base\u path\u orc/2015/10/01/000000\u 0

为什么您特别需要这种输出?这是一种在配置单元中存储分区数据的方法。在hdfs中保持文件结构与原始文件相同。原始文件只有Y/M/d,而不是Year=Y/Month=M etcWhy您特别需要这种输出?这是一种在配置单元中存储分区数据的方法。在hdfs中保持文件结构与原始文件相同。原始文件只有Y/M/d,而不是Year=Y/Month=M等