文章目录
一、hive相关
1. 如何增加列
增加多列:
ALTER TABLE user_profile
ADD COLUMNS(
return_distance string,
return_duration string
);
增加多列并添加注释:
ALTER TABLE example_table
ADD COLUMNS (
salary DOUBLE COMMENT 'The salary of the employee',
department STRING COMMENT 'The department where the employee works'
);
2. 如何添加或修改列的注释
ALTER TABLE user_profile change COLUMN distance
distance string COMMENT '距离';
ALTER TABLE user_profile change COLUMN duration
duration string COMMENT '时长';
3. 如何查看表的具体列的数据类型
DESCRIBE your_table_name
4. 如何drop一个表
drop table your_table_name
5. 如何设置前置项
set mapreduce.job.queuename=your_queue_name;
set hive.exec.parallel=true;
set hive.exec.parallel.thread.number=10;
set mapred.job.name=your_job_name;
set ma