hadoop - storing pig output into Hive table in a single instance -


i insert pig output hive tables(tables in hive created exact schema).just need insert output values table. dont want usual method, wherein first store file, read file hive , insert tables. need reduce hop done.

is possible. if please tell me how can done ?

thanks

ok. create external hive table schema layout somewhere in hdfs directory. lets

create external table emp_records(id int,                                   name string,                                   city string)                                   row formatted delimited                                    fields terminated '|'                                   location '/user/cloudera/outputfiles/usecase1'; 

just create table above , no need load file directory.

now write pig script read data input directory , when store output of pig script use below

a =  load 'inputfile.txt' using pigstorage(',') as(id:int,name:chararray,city:chararray); b = filter id > = 678933; c = foreach b generate id,name,city; store c '/user/cloudera/outputfiles/usecase1' using pigstorage('|'); 

ensure destination location , delimiter , schema layout of final foreach statement in pigscript matches hive ddl schema.


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -