别看我,不看答案我也不会写
正因为不会写,所以才要每天一练
本地hive练习题
SET hive.exec.mode.local.auto=true; -- 默认 false
SET hive.exec.mode.local.auto.inputbytes.max=50000000;
SET hive.exec.mode.local.auto.input.files.max=5; -- 默认 4
# 创建数据源
create database if not exists test_sql;CREATE TABLE test_sql.test1
(userId string,visitDate string,visitCount INT
) ROW format delimited FIELDS TERMINATED BY "\t";INSERT INTO TABLE test_sql.test1 VALUES( 'u01', '2017/1/21', 5 ), ( 'u02', '2017/1/23', 6 ), ( 'u03', '2017/1/22', 8 ), ( 'u04', '2017/1/20', 3 ), ( 'u01', '2017/1/23', 6 ), ( 'u01', '2017/2/21', 8 ), ( 'u02', '2017/1/23', 6 ), ( 'u01', '2017/2/22', 4 );