//TODO: we do not support projections from multiple pig statements yet
@Override
    public void meet(Projection node) throws RuntimeException {
        super.meet(node);
        ProjectionElemList list = node.getProjectionElemList();
        String set = null;
        StringBuilder projList = new StringBuilder();
        boolean first = true;
        //TODO: we do not support projections from multiple pig statements yet
        for (String name : list.getTargetNames()) {
            set = varToSet.get(name);  //TODO: overwrite
            if (set == null) {
                throw new IllegalArgumentException("Have not found any pig logic for name[" + name + "]");
            }
            if (!first) {
                projList.append(",");
            }
            first = false;
            projList.append(name);
        }
        if (set == null)
            throw new IllegalArgumentException(""); //TODO: Fill this
        //SUBORG = FOREACH SUBORG_L GENERATE dept, univ;
        pigScriptBuilder.append("PROJ = FOREACH ").append(set).append(" GENERATE ").append(projList.toString()).append(";\n");
    }
StringBuilder projList = new StringBuilder();
boolean first = true;
//TODO: we do not support projections from multiple pig statements yet
for (String name : list.getTargetNames()) {
set = varToSet.get(name); //TODO: overwrite
@Override
public void meet(Projection node) throws RuntimeException {
super.meet(node);
ProjectionElemList list = node.getProjectionElemList();
String set = null;
StringBuilder projList = new StringBuilder();
boolean first = true;
//TODO: we do not support projections from multiple pig statements yet
for (String name : list.getTargetNames()) {
set = varToSet.get(name); //TODO: overwrite
if (set == null) {
throw new IllegalArgumentException("Have not found any pig logic for name[" + name + "]");
}
if (!first) {
projList.append(",");
}
first = false;
projList.append(name);
@Override
public void meet(Projection node) throws RuntimeException {
super.meet(node);
ProjectionElemList list = node.getProjectionElemList();
String set = null;
StringBuilder projList = new StringBuilder();
boolean first = true;
//TODO: we do not support projections from multiple pig statements yet
for (String name : list.getTargetNames()) {
set = varToSet.get(name); //TODO: overwrite
if (set == null) {
throw new IllegalArgumentException("Have not found any pig logic for name[" + name + "]");
}
if (!first) {
projList.append(",");
}
first = false;
projList.append(name);
}
if (set == null)
throw new IllegalArgumentException(""); //TODO: Fill this
//SUBORG = FOREACH SUBORG_L GENERATE dept, univ;
pigScriptBuilder.append("PROJ = FOREACH ").append(set).append(" GENERATE ").append(projList.toString()).append(";\n");
}