Apache pig Tutorial 5: LOAD data
LOAD key word is used to load data into Pig. LOAD 'data' [USING function] [AS schema]; data: It will the input file(/home/user/inputfile) USING : If the USING clause is omitted, the default load function PigStorage is used. function: We can use built-in-function or UDF AS : key word schema: Schemas enable you to assign names to fields and declare types for fields. Schemas are optional but we encourage you to use them whenever possible; type declarations result in better parse-time error checking and more efficient code execution. Known Schema Handling Note the following: You can define a schema that includes both the field name and field type. You can define a schema that includes the field name only; in this case, the field type defaults to bytearray. You can choose not to define a schema; in this case, the field is un-named and the field type defaults to bytearray. If you assign a name to a field, you can refer to that field using the name ...