hive test

SET mapred.job.tracker=120.72.37.42:50030;
SET mapred.job.tracker=120.72.37.42:9001;
SET -v;

hadoop fs -mkdir /tmp
hadoop fs -mkdir       /user/hive/warehouse
hadoop fs -mkdir       /tmp/hadoop-hdfs/mapred
hadoop fs -chmod 777  /tmp
hadoop fs -chmod 777   /user/hive/warehouse
hadoop fs  -chmod  777  /tmp/hadoop-hdfs/mapred
hadoop fs  -chmod  777  /home/hadoop-hdfs/mapred

CREATE TABLE pokes (foo INT, bar STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t';

LOAD DATA LOCAL INPATH '/root/cooler/c.txt' OVERWRITE INTO TABLE pokes;


INSERT OVERWRITE LOCAL DIRECTORY '/tmp/cooler.log' SELECT a.* FROM pokes a;

!connect jdbc:hive2://localhost:10000 peng.zhou cooler org.apache.hive.jdbc.HiveDriver


!connect jdbc:hive2://localhost:10000/default;ssl=true;sslTrustStore=/etc/hive/conf/keystore-file-name.jks;trustStorePassword=cooler

CREATE TABLE href (href STRING, count INT)ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t';

INSERT OVERWRITE TABLE href SELECT a.href, count(1) FROM messages_two where a.lable='href:' a GROUP BY a.href;

INSERT OVERWRITE LOCAL DIRECTORY '/home/cooler.href' SELECT a.* FROM href a;

你可能感兴趣的:(hive)