Package org.apache.pig.newplan.logical.relational

Examples of org.apache.pig.newplan.logical.relational.LogicalSchema.addField()


        List<Schema.FieldSchema> ll = schema.getFields();
        for (Schema.FieldSchema f: ll) {
            LogicalSchema.LogicalFieldSchema f2 =
                new LogicalSchema.LogicalFieldSchema(f.alias, translateSchema(f.schema), f.type);
                      
            s2.addField(f2);
        }
       
        s2.setTwoLevelAccessRequired(schema.isTwoLevelAccessRequired());
       
        return s2;
View Full Code Here


        // The plan is built with the filter having been pushed above the join
        // but the listners not yet having been called.
        // A = load
        lp = new LogicalPlan();
        LogicalSchema aschema = new LogicalSchema();
        aschema.addField(new LogicalSchema.LogicalFieldSchema(
            "x", null, DataType.INTEGER));
        aschema.getField(0).uid = 1;
        LOLoad A = new LOLoad(null, null, lp, null);
        A.neverUseForRealSetSchema(aschema);
        lp.add(A);
View Full Code Here

        A.neverUseForRealSetSchema(aschema);
        lp.add(A);
       
        // B = load
        LogicalSchema bschema = new LogicalSchema();
        bschema.addField(new LogicalSchema.LogicalFieldSchema(
            "y", null, DataType.INTEGER));
        bschema.getField(0).uid = 2;
        LOLoad B = new LOLoad(null, null, lp, null);
        B.neverUseForRealSetSchema(bschema);
        lp.add(B);
View Full Code Here

        B.neverUseForRealSetSchema(bschema);
        lp.add(B);
       
        // C = join
        LogicalSchema cschema = new LogicalSchema();
        cschema.addField(new LogicalSchema.LogicalFieldSchema(
            "x", null, DataType.INTEGER));
        cschema.addField(new LogicalSchema.LogicalFieldSchema(
            "y", null, DataType.INTEGER));
        cschema.getField(0).uid = 1;
        cschema.getField(1).uid = 2;
View Full Code Here

       
        // C = join
        LogicalSchema cschema = new LogicalSchema();
        cschema.addField(new LogicalSchema.LogicalFieldSchema(
            "x", null, DataType.INTEGER));
        cschema.addField(new LogicalSchema.LogicalFieldSchema(
            "y", null, DataType.INTEGER));
        cschema.getField(0).uid = 1;
        cschema.getField(1).uid = 2;

        MultiMap<Integer, LogicalExpressionPlan> mm =
View Full Code Here

       
        org.apache.pig.newplan.logical.relational.LogicalPlan expected =
            new org.apache.pig.newplan.logical.relational.LogicalPlan();
       
        LogicalSchema aschema = new LogicalSchema();     
        aschema.addField(new LogicalSchema.LogicalFieldSchema("id", null, DataType.BYTEARRAY));
        aschema.addField(new LogicalSchema.LogicalFieldSchema("d", null, DataType.BYTEARRAY));
        LOLoad load = new LOLoad(new FileSpec("/test/d.txt", new FuncSpec("org.apache.pig.builtin.PigStorage")), aschema, expected, null);
        expected.add(load);
       
        LOForEach foreach = new LOForEach(expected);
View Full Code Here

        org.apache.pig.newplan.logical.relational.LogicalPlan expected =
            new org.apache.pig.newplan.logical.relational.LogicalPlan();
       
        LogicalSchema aschema = new LogicalSchema();     
        aschema.addField(new LogicalSchema.LogicalFieldSchema("id", null, DataType.BYTEARRAY));
        aschema.addField(new LogicalSchema.LogicalFieldSchema("d", null, DataType.BYTEARRAY));
        LOLoad load = new LOLoad(new FileSpec("/test/d.txt", new FuncSpec("org.apache.pig.builtin.PigStorage")), aschema, expected, null);
        expected.add(load);
       
        LOForEach foreach = new LOForEach(expected);
        org.apache.pig.newplan.logical.relational.LogicalPlan innerPlan = new org.apache.pig.newplan.logical.relational.LogicalPlan();
View Full Code Here

               
        org.apache.pig.newplan.logical.relational.LogicalPlan newPlan = migratePlan(plan);
        LogicalRelationalOperator op = (LogicalRelationalOperator)newPlan.getSinks().get(0);
       
        LogicalSchema s2 = new LogicalSchema();
        s2.addField(new LogicalSchema.LogicalFieldSchema("id", null, DataType.BYTEARRAY));
        s2.addField(new LogicalSchema.LogicalFieldSchema("v", null, DataType.BYTEARRAY));
        s2.addField(new LogicalSchema.LogicalFieldSchema("s", null, DataType.BYTEARRAY));
        assertTrue(s2.isEqual(op.getSchema()));
       
        // test no flatten
View Full Code Here

        org.apache.pig.newplan.logical.relational.LogicalPlan newPlan = migratePlan(plan);
        LogicalRelationalOperator op = (LogicalRelationalOperator)newPlan.getSinks().get(0);
       
        LogicalSchema s2 = new LogicalSchema();
        s2.addField(new LogicalSchema.LogicalFieldSchema("id", null, DataType.BYTEARRAY));
        s2.addField(new LogicalSchema.LogicalFieldSchema("v", null, DataType.BYTEARRAY));
        s2.addField(new LogicalSchema.LogicalFieldSchema("s", null, DataType.BYTEARRAY));
        assertTrue(s2.isEqual(op.getSchema()));
       
        // test no flatten
        lpt = new LogicalPlanTester(pc);
View Full Code Here

        LogicalRelationalOperator op = (LogicalRelationalOperator)newPlan.getSinks().get(0);
       
        LogicalSchema s2 = new LogicalSchema();
        s2.addField(new LogicalSchema.LogicalFieldSchema("id", null, DataType.BYTEARRAY));
        s2.addField(new LogicalSchema.LogicalFieldSchema("v", null, DataType.BYTEARRAY));
        s2.addField(new LogicalSchema.LogicalFieldSchema("s", null, DataType.BYTEARRAY));
        assertTrue(s2.isEqual(op.getSchema()));
       
        // test no flatten
        lpt = new LogicalPlanTester(pc);
        lpt.buildPlan("a = load '/test/d.txt' as (id, d:bag{t:(v, s)});");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.