当insert数据到有分区的hive表里时若不明显指定分区会抛出异常 insert overwrite table persons_tmp select * from persons; FAILED: SemanticException : Need to specify partition columns because the destination table is partitioned. Error encountered near token 'persons_tmp' 当指定分区后
今天下午有同事反馈她提交了了一个SQL后,hive 查询就停止响应了. 我看了下,发现hiveserver确实hug住了.听过查看日志,发现了一个牛逼的SQL, 这个SQL很简单: select a.column1, b.column2 from a left join b on a.id = b.id 这两张表都是很大的表,保存了好多年的数据,表b按照日期和类目进行了分区. 因为没有加限制,所以HiveMetaStore在获取分区的时候,会从mysql中获取这个表所有的分区信息,SQL如下: