我在Azure Blob存储中保存了作为Parquet文件的数据,按年、月、日和小时进行了分区,如下所示:
cont/data/year=2017/month=02/day=01/
我想使用以下创建语句在Hive中创建外部表,我是使用此参考文档编写的。
CREATE EXTERNAL TABLE table_name (uid string, title string, value string)
PARTITIONED BY (year int, month int, day int) STORED AS PARQUET
LOCATION 'wasb://cont@storage_name.blob.core.windows.net/data';
在查询时,这会创建一个表,但没有行。我尝试了同样的创建语句,但没有使用PARTITIONED BY
子句,那似乎可以工作。所以看起来问题出在分区上。
我错过了什么?
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask
。所以看起来有其他问题。 - chhantyalhive-site.xml
中属性hive.metastore.schema.verification
是否为true
。或者这可能是由于SQL Azure锁定或拒绝某些操作引起的。 - Peter Panhive.msck.repair.batch.size
只在 Hive 的新版本(2.2.0)中可用,但 HDInsight 目前还不支持该版本。即使是在新版本中,似乎仍然存在一些问题,我在更新的答案中提供了链接。 - chhantyal