![]() ![]() ![]() Positional notation is generated by the system. The new alias can be used in the place of the original alias to refer the original relation.įields are referred to by positional notation or by name (alias). In this example the name (alias) of the relation is A.Ī = LOAD 'student' USING PigStorage() AS (name:chararray, age:int, gpa:float) Names are assigned by you as part of the Pig Latin statement. Relations are referred to by name (or alias). Furthermore, processing may be parallelized in which case tuples are not processed according to any total ordering. Unlike a relational table, however, Pig relations don't require that every tuple contain the same number of fields or that the fields in the same position (column) have the same type.Īlso note that relations are unordered which means there is no guarantee that tuples are processed in any particular order. A Pig relation is similar to a table in a relational database, where the tuples in the bag correspond to the rows in a table. A relation can be defined as follows:Ī relation is a bag (more specifically, an outer bag).Ī Pig relation is a bag of tuples. Pig Latin statements work with relations. In Pig, identifiers start with a letter and can be followed by any number of letters, digits, or underscores. Identifiers include the names of relations (aliases), fields, variables, and so on. (These conventions are not strictly adherered to in all examples.) In general, lowercase type indicates elements that you supply. In general, uppercase type indicates elements the system supplies. Horizontal ellipsis points indicate that you can repeat a portion of the code. In this case is used to indicate required items. In this case is used to indicate optional items.Ĭurly brackets enclose two or more items, one of which is required.Ĭurly brackets also used to indicate the bag data type. Straight brackets are also used to indicate the map data type. Straight brackets enclose one or more optional items. Parentheses are also used to indicate the tuple data type. ![]() Conventions for the syntax and code examples in the Pig Latin Reference Manual are described here. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |