Package org.apache.pig.impl.logicalLayer.schema

Examples of org.apache.pig.impl.logicalLayer.schema.TupleSchema


       
        //Adding a new start spec to get the group by spec. The new star spec that
        //we are adding should not contain a schema since that can cause conflicts.
       
        StarSpec ss = new StarSpec();
        ss.setSchema(new TupleSchema());
        specs.add(ss);
        return new GenerateSpec(specs);
    }
View Full Code Here


        return funcs;
    }

    @Override
    protected TupleSchema mapInputSchema(Schema input) {
        TupleSchema output = new TupleSchema();
               
        for (EvalSpec spec: specs) {
            Schema schema = spec.getOutputSchemaForPipe(input).copy();
           
            if (spec.isFlattened()){
                List<Schema> flattenedSchema = schema.flatten();
                if (flattenedSchema.size() == 0){
                    output.add(new TupleSchema(),true);
                    continue;
                }
                for (Schema flattenedItem: flattenedSchema){
                    output.add(flattenedItem,true);
                }
            }else{
                output.add(schema,false);
            }
        }
        return output;
    }
View Full Code Here

    @Override
    protected Schema mapInputSchema(Schema schema) {
        if (!wrapInTuple && cols.size()==1){
            return maskNullSchema(schema.schemaFor(cols.get(0)));
        }else{
            TupleSchema output = new TupleSchema();
            for (int i: cols){
                output.add(maskNullSchema(schema.schemaFor(i)));
            }
            return output;
        }
    }
View Full Code Here

        }
    }
   
    private Schema maskNullSchema(Schema s){
        if (s == null)
            return new TupleSchema();
        else
            return s;
       
    }
View Full Code Here

    }
   
    @Override
    protected Schema mapInputSchema(Schema schema) {
        //TODO: until we have map schemas
        return new TupleSchema();
    }
View Full Code Here

       
        // check if we can instantiate load func
        PigContext.instantiateFuncFromSpec(inputFileSpec.getFuncSpec());

        // TODO: Handle Schemas defined by Load Functions
        schema = new TupleSchema();
    }
View Full Code Here

        ifFalse.instantiateFunc(fInstantiaor);
    };

    @Override
    protected Schema mapInputSchema(Schema schema) {
        return new TupleSchema();
    }
View Full Code Here

    protected Schema mapInputSchema(Schema schema) {
        Schema inputToFunction;
        if (args!=null){
            inputToFunction = args.mapInputSchema(schema);
        }else{
            inputToFunction = new TupleSchema();
        }
       
        return func.outputSchema(inputToFunction);
    }
View Full Code Here

TOP

Related Classes of org.apache.pig.impl.logicalLayer.schema.TupleSchema

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.