hive 常用语句
创建表=================================================
create EXTERNAL table IF NOT EXISTS t1 (
c1 string,
c2 string,
c3 string,
c34 string)
partitioned by (ptdate string)
ROW FORMAT DELIMITED FIELDS TERMINATED BY '\001'
stored as textfile
location '/user/hive/warehouse/t1';
增加删除分区=================================================
ALTER TABLE t1 DROP PARTITION (ptDate='20170323') location '/warehouse/t1/20170323';
ALTER TABLE t1 DROP PARTITION (ptDate='20170323');
增加自定义函数=================================================
add jar /var/lib/hadoop-hdfs/udf.jar;
create temporary function protobuf as 'com.xxx';
永久生效办法,在hive/conf/下添加.hiverc文件,并将以上内容写入,不过通过CDH更改HIVE配置后,该文件会被删除
设置最大reduce数量=================================================
hive.exec.reducers.max=1;
其他=================================================
insert overwrite DIRECTORY '/tmp/temp10' select。。。
创建表=================================================
create EXTERNAL table IF NOT EXISTS t1 (
c1 string,
c2 string,
c3 string,
c34 string)
partitioned by (ptdate string)
ROW FORMAT DELIMITED FIELDS TERMINATED BY '\001'
stored as textfile
location '/user/hive/warehouse/t1';
增加删除分区=================================================
ALTER TABLE t1 DROP PARTITION (ptDate='20170323') location '/warehouse/t1/20170323';
ALTER TABLE t1 DROP PARTITION (ptDate='20170323');
增加自定义函数=================================================
add jar /var/lib/hadoop-hdfs/udf.jar;
create temporary function protobuf as 'com.xxx';
永久生效办法,在hive/conf/下添加.hiverc文件,并将以上内容写入,不过通过CDH更改HIVE配置后,该文件会被删除
设置最大reduce数量=================================================
hive.exec.reducers.max=1;
其他=================================================
insert overwrite DIRECTORY '/tmp/temp10' select。。。