Examples of SortInfo


Examples of org.apache.pig.SortInfo

        lpt.buildPlan("b = order a by i, d;");
        LogicalPlan lp = lpt.buildPlan("store b into 'foo';");
        PigServer.SortInfoSetter siSetter = new PigServer.SortInfoSetter(lp);
        siSetter.visit();
        PhysicalPlan pp = buildPhysicalPlan(lp);
        SortInfo si = ((POStore)(pp.getLeaves().get(0))).getSortInfo();
        SortInfo expected = getSortInfo(
                Arrays.asList(new String[] {"i", "d"}),
                Arrays.asList(new Integer[] {0, 2}),
                Arrays.asList(new SortColInfo.Order[] {
                        SortColInfo.Order.ASCENDING,
                        SortColInfo.Order.ASCENDING}));
View Full Code Here

Examples of org.apache.pig.SortInfo

        lpt.buildPlan("c = order b by i desc, d;");
        LogicalPlan lp = lpt.buildPlan("store c into 'foo';");
        PigServer.SortInfoSetter siSetter = new PigServer.SortInfoSetter(lp);
        siSetter.visit();
        PhysicalPlan pp = buildPhysicalPlan(lp);
        SortInfo si = ((POStore)(pp.getLeaves().get(0))).getSortInfo();
        SortInfo expected = getSortInfo(
                Arrays.asList(new String[] {"i", "d"}),
                Arrays.asList(new Integer[] {0, 2}),
                Arrays.asList(new SortColInfo.Order[] {
                        SortColInfo.Order.DESCENDING,
                        SortColInfo.Order.ASCENDING}));
View Full Code Here

Examples of org.apache.pig.SortInfo

        lpt.buildPlan("b = filter a by i > 10;");
        LogicalPlan lp = lpt.buildPlan("store b into 'foo';");
        PigServer.SortInfoSetter siSetter = new PigServer.SortInfoSetter(lp);
        siSetter.visit();
        PhysicalPlan pp = buildPhysicalPlan(lp);
        SortInfo si = ((POStore)(pp.getLeaves().get(0))).getSortInfo();
        assertEquals(null, si);
    }
View Full Code Here

Examples of org.apache.pig.SortInfo

        lpt.buildPlan("c = filter b by i > 10;");
        LogicalPlan lp = lpt.buildPlan("store c into 'foo';");
        PhysicalPlan pp = buildPhysicalPlan(lp);
        PigServer.SortInfoSetter siSetter = new PigServer.SortInfoSetter(lp);
        siSetter.visit();
        SortInfo si = ((POStore)(pp.getLeaves().get(0))).getSortInfo();
        assertEquals(null, si);
    }
View Full Code Here

Examples of org.apache.pig.SortInfo

        PigServer.SortInfoSetter siSetter = new PigServer.SortInfoSetter(lp);
        siSetter.visit();
        LOPrinter lpr = new LOPrinter(System.err, lp);
        lpr.visit();
        PhysicalPlan pp = buildPhysicalPlan(lp);
        SortInfo si = ((POStore)(pp.getLeaves().get(0))).getSortInfo();
        SortInfo expected = getSortInfo(
                Arrays.asList(new String[] {"i", "d"}),
                Arrays.asList(new Integer[] {0, 2}),
                Arrays.asList(new SortColInfo.Order[] {
                        SortColInfo.Order.ASCENDING,
                        SortColInfo.Order.DESCENDING}));
View Full Code Here

Examples of org.apache.pig.SortInfo

            new Class[] { LogicalPlan.class });
       
        compilePp.setAccessible(true);
       
        PhysicalPlan pp = (PhysicalPlan) compilePp.invoke(myPig, new Object[] { lp });
        SortInfo si0 = ((POStore)(pp.getLeaves().get(0))).getSortInfo();
        SortInfo si1 = ((POStore)(pp.getLeaves().get(1))).getSortInfo();
        SortInfo expected = getSortInfo(
                Arrays.asList(new String[] {"i", "d"}),
                Arrays.asList(new Integer[] {0, 2}),
                Arrays.asList(new SortColInfo.Order[] {
                        SortColInfo.Order.ASCENDING,
                        SortColInfo.Order.DESCENDING}));
View Full Code Here

Examples of org.apache.pig.SortInfo

        lpt.buildPlan("b = order a by $0;");
        LogicalPlan lp = lpt.buildPlan("store b into 'foo';");
        PigServer.SortInfoSetter siSetter = new PigServer.SortInfoSetter(lp);
        siSetter.visit();
        PhysicalPlan pp = buildPhysicalPlan(lp);
        SortInfo si = ((POStore)(pp.getLeaves().get(0))).getSortInfo();
        SortInfo expected = getSortInfo(Arrays.asList(new String[] {null}),
                Arrays.asList(new Integer[] {0}),
                Arrays.asList(new SortColInfo.Order[] {
                        SortColInfo.Order.ASCENDING}));
        assertEquals(expected, si);
    }
View Full Code Here

Examples of org.apache.pig.SortInfo

        List<SortColInfo> sortColInfoList = new ArrayList<SortColInfo>();
        for(int i = 0; i < colNames.size(); i++) {
            sortColInfoList.add(new SortColInfo(colNames.get(i),
                    colIndices.get(i), orderingTypes.get(i)));
        }
        return new SortInfo(sortColInfoList);
    }
View Full Code Here

Examples of org.apache.pig.SortInfo

        List<SortColInfo> colList = new ArrayList<SortColInfo>();
        SortColInfo col1 = new SortColInfo("f1", 0, SortColInfo.Order.ASCENDING);
        SortColInfo col2 = new SortColInfo("f1", 1, SortColInfo.Order.DESCENDING);
        colList.add(col1);
        colList.add(col2);
        SortInfo sortInfo = new SortInfo(colList);
                       
        ResourceSchema rsSchema = new ResourceSchema(origSchema, sortInfo);

        Schema genSchema = Schema.getPigSchema(rsSchema);
        assertTrue("generated schema equals original",
View Full Code Here

Examples of org.apache.pig.SortInfo

        List<SortColInfo> colList = new ArrayList<SortColInfo>();
        SortColInfo col1 = new SortColInfo("f1", 0, SortColInfo.Order.ASCENDING);
        SortColInfo col2 = new SortColInfo("f1", 1, SortColInfo.Order.DESCENDING);
        colList.add(col1);
        colList.add(col2);
        SortInfo sortInfo = new SortInfo(colList);
                       
        ResourceSchema rsSchema = new ResourceSchema(origSchema, sortInfo);

        Schema genSchema = Schema.getPigSchema(rsSchema);
        assertTrue("generated schema equals original",
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.