Co-Authored By:

Asked by: Neyva Zhiryakov
technology and computing databasesWhat is the default data type of fields in pig?
Then, what are the complex data types in pig?
Complex Types. Pig has three complex data types: maps, tuples, and bags. All of these types can contain data of any type, including other complex types. So it is possible to have a map where the value field is a bag, which contains a tuple where one of the fields is a map.
Just so, what is flatten in pig?
The FLATTEN operator which is an arithmetic operator looks like a UDF syntactically, but it is actually an operator that changes the structure of tuples and bags in a way that a UDF cannot. Flatten un-nests tuples as well as bags. For tuples, flatten substitutes the fields of a tuple in place of the tuple.
Keywords in Pig Latin are not case-sensitive; for example, LOAD is equivalent to load . But relation and field names are, so A = load 'foo'; is not equivalent to a = load 'foo'; . UDF names are also case-sensitive; thus, COUNT is not the same UDF as count .