Projects >> pig >>c9641b1d4e87cc0cef5b58ba21bd5c398a6add23

Chunk
Conflicting content
public class POStore extends PhysicalOperator {

    private static final long serialVersionUID = 1L;
<<<<<<< HEAD
    protected static Result empty = new Result(POStatus.STATUS_NULL, null);
=======
    private static Result empty = new Result(POStatus.STATUS_NULL, null);
>>>>>>> a7ec7f19dd73840e2d3552abb87619d6f45c5dab
    transient private StoreFuncInterface storer;
    transient private POStoreImpl impl;
    transient private String counterName = null;
Solution content
public class POStore extends PhysicalOperator {

    private static final long serialVersionUID = 1L;
    protected static Result empty = new Result(POStatus.STATUS_NULL, null);
    transient private StoreFuncInterface storer;
    transient private POStoreImpl impl;
    transient private String counterName = null;
File
POStore.java
Developer's decision
Version 1
Kind of conflict
Attribute
Method invocation
Chunk
Conflicting content
        super(k, rp, inp);
    }

<<<<<<< HEAD
    public POStore(POStore copy) {
        super(copy);
        this.sFile = copy.sFile;
        this.schema = copy.schema;
        this.isTmpStore = copy.isTmpStore;
        this.isMultiStore = copy.isMultiStore;
        this.disableCounter = copy.disableCounter;
        this.index = copy.index;
        this.lFile = copy.lFile;
        this.sortInfo = copy.sortInfo;
        this.signature = copy.signature;
    }

=======
>>>>>>> a7ec7f19dd73840e2d3552abb87619d6f45c5dab
    /**
     * Set up the storer
     * @throws IOException
Solution content
        super(k, rp, inp);
    }

    public POStore(POStore copy) {
        super(copy);
        this.sFile = copy.sFile;
        this.schema = copy.schema;
        this.isTmpStore = copy.isTmpStore;
        this.isMultiStore = copy.isMultiStore;
        this.disableCounter = copy.disableCounter;
        this.index = copy.index;
        this.lFile = copy.lFile;
        this.sortInfo = copy.sortInfo;
        this.signature = copy.signature;
    }

    /**
     * Set up the storer
     * @throws IOException
File
POStore.java
Developer's decision
Version 1
Kind of conflict
Method declaration
Chunk
Conflicting content
        createFiles();
    }

<<<<<<< HEAD
    @AfterClass
    public static void oneTimeTearDown() throws Exception {
        deleteFiles();
        cluster.shutDown();
=======
    private PigServer pigServer;
    private static MiniCluster cluster = MiniCluster.buildCluster();

    public TestAccumulator() throws ExecException, IOException{
        pigServer = new PigServer(ExecType.MAPREDUCE, cluster.getProperties());
        // pigServer = new PigServer(ExecType.LOCAL);
        pigServer.getPigContext().getProperties().setProperty("pig.accumulative.batchsize", "2");
        pigServer.getPigContext().getProperties().setProperty("pig.exec.nocombiner", "true");
        // reducing the number of retry attempts to speed up test completion
        pigServer.getPigContext().getProperties().setProperty("mapred.map.max.attempts","1");
        pigServer.getPigContext().getProperties().setProperty("mapred.reduce.max.attempts","1");
>>>>>>> a7ec7f19dd73840e2d3552abb87619d6f45c5dab
    }

    @Before
Solution content
        createFiles();
    }

    @AfterClass
    public static void oneTimeTearDown() throws Exception {
        deleteFiles();
        cluster.shutDown();
    }

    @Before
File
TestAccumulator.java
Developer's decision
Version 1
Kind of conflict
Annotation
Attribute
Comment
Method invocation
Method signature
Chunk
Conflicting content
                "org.apache.pig.test.utils.AccumulativeSumBag(A);");

        checkAccumulatorOff("C");
<<<<<<< HEAD
        pigServer.getPigContext().getProperties().setProperty(
                PigConfiguration.OPT_ACCUMULATOR, "true");
=======
        pigServer.getPigContext().getProperties().setProperty("opt.accumulator", "true");

>>>>>>> a7ec7f19dd73840e2d3552abb87619d6f45c5dab
    }

    private void checkAccumulatorOff(String alias) {
Solution content
                "org.apache.pig.test.utils.AccumulativeSumBag(A);");

        checkAccumulatorOff("C");
        pigServer.getPigContext().getProperties().setProperty(
                PigConfiguration.OPT_ACCUMULATOR, "true");

    }

    private void checkAccumulatorOff(String alias) {
File
TestAccumulator.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Chunk
Conflicting content
        myPig.registerQuery("f1 = foreach f generate group, SUM(d.c::uid);");
        myPig.registerQuery("store f1 into 'output2';");

<<<<<<< HEAD
=======
        List jobs = myPig.executeBatch();

        assertTrue(jobs.size() == 2);

        for (ExecJob job : jobs) {
            assertTrue(job.getStatus() == ExecJob.JOB_STATUS.COMPLETED);
        }
    }

    /**
       This test will fail indeterministically without the PIG-3902 patch. Sometimes
       the loads will get attached as dependencies to the appropriate stores (during
       the postProcess() method on PigServer.Graph) and the dag will successfully
       run, while other times it will fail (if the loads get attached as dependencies
       of the incorrect stores).
     */
    @Test
    public void testMultiQueryJiraPig3902() throws Exception {

        // test case: Pig Server creates implicit cycle when
        // loading and storing from same location with an
        // intermediate store.

        Storage.Data data = Storage.resetData(myPig);
        data.set("inputLocation", Storage.tuple(1,2,3));

        myPig.setBatchOn();
        myPig.registerQuery("A = load 'inputLocation' using mock.Storage() as (a:int, b, c);");
        myPig.registerQuery("A1 = order A by a desc parallel 3;");
        myPig.registerQuery("A2 = limit A1 2;");
        myPig.registerQuery("store A1 into 'output1' using mock.Storage();");
        myPig.registerQuery("A3 = load 'output1' using mock.Storage()as (a:int, b, c);");
        myPig.registerQuery("A4 = filter A3 by a > 2;");
        myPig.registerQuery("store A4 into 'inputLocation' using mock.Storage();");

>>>>>>> a7ec7f19dd73840e2d3552abb87619d6f45c5dab
        List jobs = myPig.executeBatch();

        assertTrue(jobs.size() == 2);
Solution content
        myPig.registerQuery("f1 = foreach f generate group, SUM(d.c::uid);");
        myPig.registerQuery("store f1 into 'output2';");

        List jobs = myPig.executeBatch();

        assertTrue(jobs.size() == 2);

        for (ExecJob job : jobs) {
            assertTrue(job.getStatus() == ExecJob.JOB_STATUS.COMPLETED);
        }
    }

    /**
       This test will fail indeterministically without the PIG-3902 patch. Sometimes
       the loads will get attached as dependencies to the appropriate stores (during
       the postProcess() method on PigServer.Graph) and the dag will successfully
       run, while other times it will fail (if the loads get attached as dependencies
       of the incorrect stores).
     */
    @Test
    public void testMultiQueryJiraPig3902() throws Exception {

        // test case: Pig Server creates implicit cycle when
        // loading and storing from same location with an
        // intermediate store.

        Storage.Data data = Storage.resetData(myPig);
        data.set("inputLocation", Storage.tuple(1,2,3));

        myPig.setBatchOn();
        myPig.registerQuery("A = load 'inputLocation' using mock.Storage() as (a:int, b, c);");
        myPig.registerQuery("A1 = order A by a desc parallel 3;");
        myPig.registerQuery("A2 = limit A1 2;");
        myPig.registerQuery("store A1 into 'output1' using mock.Storage();");
        myPig.registerQuery("A3 = load 'output1' using mock.Storage()as (a:int, b, c);");
        myPig.registerQuery("A4 = filter A3 by a > 2;");
        myPig.registerQuery("store A4 into 'inputLocation' using mock.Storage();");

        List jobs = myPig.executeBatch();

        assertTrue(jobs.size() == 2);
File
TestMultiQuery.java
Developer's decision
Version 2
Kind of conflict
Annotation
Comment
For statement
Method invocation
Method signature
Variable