Use lzo in hive
1 startup hive error
exception in thread "Main" Java. lang. noclassdeffounderror: ORG/Apache/hadoop/hive/CONF/hiveconf
at java. lang. class. forname0 (native method)
at java. lang. class. forname (class. java: 247)
at Org. apache. hadoop. util. runjar. main (runjar. java: 149)
solution: When hadoop is installed, add the hadoop_classpath variable to overwrite the original variable when/CONF/hadoop-env.sh under the hadoop directory is modified, change it to the following format:
hadoop_classpath = $ hadoop_classpath:
2. Create a test table
Create Table lzo (name string) stored as inputformat 'com. hadoop. mapred. deprecatedlzotextinputformat 'outputformat' Org. apache. hadoop. hive. QL. io. hiveignorekeytextoutputformat ';
3. Compress Test Data
lzop users.txt
4. Import Data
load data local inpath'/home/hadoop/tmp/tmplzo.txt. lzo 'into table lzo;
4 test
select * From lzo;
Use lzo in hive