我按年份将文件分隔为外部表格。我每年都添加分区。我运行了show table extended命令,它显示:
partitioned:true
partitionColumns:struct partition_columns { i32 year}
totalNumberFiles:0
totalFileSize:0
它应该列出每个分区位置的文件吗?
DROP TABLE IF EXISTS myTable;
CREATE EXTERNAL TABLE myTable(
somefield STRING,
somefield2 STRING,
GMTDateTime TIMESTAMP
)
PARTITIONED BY (year INT)
ROW FORMAT DELIMITED FIELDS TERMINATED BY ','
STORED AS TEXTFILE LOCATION 'wasb://{hdinsight instance}@{storage name}.blob.core.windows.net/data00/';
alter table myTable add partition ( year = 2015 ) location '{hdinsight instance}@{storage name}.blob.core.windows.net/data2015/' ;
alter table myTable add partition ( year = 2014 ) location '{hdinsight instance}@{storage name}.blob.core.windows.net/data2014/' ;
答案 0 :(得分:0)
但是没有这样的命令可以通过url知道所有分区..我们必须通过单独的分区找到它。