蜂巢中的导出功能
将 employees 表中的数据导出到/ tmp / ca_employees
INSERT OVERWRITE LOCAL DIRECTORY’/ tmp / ca_employees’SELECT 名称,工资,地址 FROM employees WHERE se.state =‘CA’;
根据特定条件将 employees 表中的数据导出到多个本地目录
以下查询显示了如何使用单个构造根据特定条件将数据导出到多个目录
FROM employees se INSERT OVERWRITE DIRECTORY '/tmp/or_employees' SELECT * WHERE se.cty = 'US' and se.st = 'OR'
INSERT OVERWRITE DIRECTORY '/tmp/ca_employees' SELECT * WHERE se.cty = 'US' and se.st = 'CA'
INSERT OVERWRITE DIRECTORY '/tmp/il_employees' SELECT * WHERE se.cty = 'US' and se.st = 'IL';