Search code examples
hadoopapache-pigdump

pig storage script failing


I am running a pig script , it is running fine but it fails when I am trying to store the output in file. dump works fine. Could someone please let me know the reason or at lease guide me to how to troubleshoot.

pig -useHCatalog;
a = load 'geolocation_part' using org.apache.hive.hcatalog.pig.HCatLoader();
b = filter a by truckid == 'A1';
Dump b;
store b INTO '/user/admin/pig/scritps/geolocation_20160401';

Solution

  • you should have the correct script like below

    pig -useHCatalog;
    a = load 'geolocation_part' using org.apache.hive.hcatalog.pig.HCatLoader();
    b = filter a by truckid == 'A1';
    store b INTO '/user/admin/pig/scritps/geolocation_20160401';
    

    DUMP is used to view the data relation. It displays the data and we can confirm that the operation are getting correct data.

    Never use DUMP in the script.

    Do not use DUMP as it will disable multi-query execution and is likely to slow down execution. (If you have included DUMP statements in your scripts for debugging purposes, you should remove them.)