hadoop - Log file into Hive -


i have log file "sample.log" looks below:

41 texas 2000 42 louisiana4 3211 43 texas 5000 22 iowa 4998p  

in log file first column id, second state name , third amount. if see state name has louisiana4 , sales total has 4998p. how can cleanse can insert hive (using python or other way?). please show steps?

i want insert hive table tblsample:

table schema is:

create  table tblsample( id int,  state string,  sales int) row format delimited fields terminated '\t' stored textfile location '/user/cloudera/staging' ; 

to load data hive table do:

load data local inpath '/home/cloudera/sample.log' table tblsample; 

thank you!

you load data hive table , use udfs cleanse data , load table. far more efficient python running mapr reduce.


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -