Package org.apache.pig.backend.hadoop.executionengine.optimizer

Examples of org.apache.pig.backend.hadoop.executionengine.optimizer.SecondaryKeyOptimizer


        String query = ("A=LOAD 'input1' AS (a0, a1, a2);"+
        "B = group A by $0;"+
        "C = foreach B { D = distinct A; generate group, D;};"+

        "store C into 'output';");
        SecondaryKeyOptimizer so = visitSecondaryKeyOptimizer(query);

        assertEquals(1, so.getNumUseSecondaryKey());
        assertEquals(0, so.getNumSortRemoved());
        assertEquals(1, so.getNumDistinctChanged());
    }
View Full Code Here


        String query = ("A=LOAD 'input1' AS (a0, a1, a2);" +
        "B = group A by $0;" +
        "C = foreach B { D = limit A 10; E = order D by $1; generate group, E;};" +

        "store C into 'output';");
        SecondaryKeyOptimizer so = visitSecondaryKeyOptimizer(query);

        assertEquals(1, so.getNumUseSecondaryKey());
        assertEquals(1, so.getNumSortRemoved());
        assertEquals(0, so.getNumDistinctChanged());
    }
View Full Code Here

        String query = ("A=LOAD 'input1' AS (a0, a1, a2);" +
        "B = group A by $0;" +
        "C = foreach B { D = limit A 10; E = order D by $0; generate group, E;};" +

        "store C into 'output';");
        SecondaryKeyOptimizer so = visitSecondaryKeyOptimizer(query);

        assertEquals(0, so.getNumUseSecondaryKey());
        assertEquals(1, so.getNumSortRemoved());
        assertEquals(0, so.getNumDistinctChanged());
    }
View Full Code Here

        String query = ("A=LOAD 'input1' AS (a0, a1, a2);" +
        "B = group A by $0;" +
        "C = foreach B { D = limit A 10; E = order D by $1; F = order E by $0; generate group, F;};"+

        "store C into 'output';");
        SecondaryKeyOptimizer so = visitSecondaryKeyOptimizer(query);

        assertEquals(1, so.getNumUseSecondaryKey());
        assertEquals(2, so.getNumSortRemoved());
        assertEquals(0, so.getNumDistinctChanged());
    }
View Full Code Here

        "B = group A by $0;" +
        "C = foreach B { D = limit A 10; E = order D by $0, $1, $2; generate group, E;};" +

        "store C into 'output';");

        SecondaryKeyOptimizer so = visitSecondaryKeyOptimizer(query);
        assertEquals(1, so.getNumUseSecondaryKey());
        assertEquals(1, so.getNumSortRemoved());
        assertEquals(0, so.getNumDistinctChanged());
    }
View Full Code Here

        String query = ("A=LOAD 'input1' AS (a0, a1, a2);" +
        "B = group A by $0;" +
        "C = foreach B { D = limit A 10; E = order D by $1; F = order E by $2; generate group, F;};" +
        "store C into 'output';");

        SecondaryKeyOptimizer so = visitSecondaryKeyOptimizer(query);
        assertEquals(1, so.getNumUseSecondaryKey());
        assertEquals(1, so.getNumSortRemoved());
        assertEquals(0, so.getNumDistinctChanged());
    }
View Full Code Here

        "B = group A by $0;" +
        "C = foreach B { D = order A by $0 desc; generate group, D;};" +

        "store C into 'output';");

        SecondaryKeyOptimizer so = visitSecondaryKeyOptimizer(query);
        assertEquals(1, so.getNumUseSecondaryKey());
        assertEquals(1, so.getNumSortRemoved());
        assertEquals(0, so.getNumDistinctChanged());
    }
View Full Code Here

        "B = group A by ($0, $1);" +
        "C = foreach B { D = order A by $0, $1 desc; generate group, D;};" +

        "store C into 'output';");

        SecondaryKeyOptimizer so = visitSecondaryKeyOptimizer(query);
        assertEquals(1, so.getNumUseSecondaryKey());
        assertEquals(1, so.getNumSortRemoved());
        assertEquals(0, so.getNumDistinctChanged());
    }
View Full Code Here

        "B = group A all;" +
        "C = foreach B { D = order A by $0 desc; generate DIFF(D, D);};" +

        "store C into 'output';");

        SecondaryKeyOptimizer so = visitSecondaryKeyOptimizer(query);
        assertEquals(1, so.getNumUseSecondaryKey());
        assertEquals(2, so.getNumSortRemoved());
        assertEquals(0, so.getNumDistinctChanged());
    }
View Full Code Here

TOP

Related Classes of org.apache.pig.backend.hadoop.executionengine.optimizer.SecondaryKeyOptimizer

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.