- 创建外部表 wwwlogs (...) 分区 (logdate string, nodeip string, tag string) ...
- alter table wwwlogs 添加分区(logdate='2013-01-21', nodeip='192.168.1.101', tag='error');
- alter table wwwlogs 添加分区(logdate='2013-01-20', nodeip='192.168.1.102', tag='access');
- 添加其他分区。
问题是: 1. show partitions wwwlogs partition (logdate='2013-01-21') 会列出所有分区。2. select count(1) from wwwlogs where logdate='2013-01-21' and tag='error': Hadoop job information for Stage-1: number of mappers: 0; 减速机数量:1
由于映射器的数量为 0,因此选择结果为 0。