Like nearly all computer languages, Pig is case sensitive. Thus "Joe" != "joe", and "Tom" != "tom".
You should change the names in the employees.txt
file to be lower case. Then you should get the expected results.
You can use the built-in Pig String function LOWER to accomplish the task of converting the name field to all lowercase.
Something along the lines of:
e1 = LOAD 'employees.txt' AS (name, age, zip, salary);
e2 = LOAD 'employees2.txt' AS (name, phone);
e1_lower = FOREACH e1 GENERATE LOWER(name),age,zip,salary;
e3 = JOIN e1_lower BY name, e2 BY name;
DUMP e3;