Package org.apache.pig.newplan.logical.expression

Examples of org.apache.pig.newplan.logical.expression.ConstantExpression


            // Create expression inner plan #2
            LogicalExpressionPlan innerPlan2 = new LogicalExpressionPlan() ;
            ProjectExpression project21 = new ProjectExpression(innerPlan2, 0, 0, splitOutput1) ;
           
            ConstantExpression const21 =
                new ConstantExpression(innerPlan2, 26L) ;
           
            SubtractExpression subtract21 =
                new SubtractExpression(innerPlan2, project21, const21) ;

View Full Code Here


            LOCogroup cogroup1 = new LOCogroup(plan);
           
            // Create expression inner plan #1 of input #1
            LogicalExpressionPlan innerPlan11 = new LogicalExpressionPlan() ;
            ProjectExpression project111 = new ProjectExpression(innerPlan11, 0, 0, cogroup1) ;
            ConstantExpression const111 = new ConstantExpression(innerPlan11, 26F) ;
            SubtractExpression subtract111 = new SubtractExpression(innerPlan11, project111, const111) ;
   

   
            // Create expression inner plan #2 of input #1
            LogicalExpressionPlan innerPlan21 = new LogicalExpressionPlan() ;
            ProjectExpression project211 = new ProjectExpression(innerPlan21, 0, 0, cogroup1) ;
            ProjectExpression project212 = new ProjectExpression(innerPlan21, 0, 1, cogroup1) ;
   
            AddExpression add211 = new AddExpression(innerPlan21, project211, project212) ;

  
            // Create expression inner plan #1 of input #2
            LogicalExpressionPlan innerPlan12 = new LogicalExpressionPlan() ;
            ProjectExpression project121 = new ProjectExpression(innerPlan12, 1, 0, cogroup1) ;
            ConstantExpression const121 = new ConstantExpression(innerPlan12, 26) ;
            SubtractExpression subtract121 = new SubtractExpression(innerPlan12, project121, const121) ;
   

            // Create expression inner plan #2 of input #2
            LogicalExpressionPlan innerPlan22 = new LogicalExpressionPlan() ;
            ConstantExpression const122 = new ConstantExpression(innerPlan22, 26) ;
//            innerPlan22.add(const122) ;
   
            // Create Cogroup
            ArrayList<LogicalRelationalOperator> inputs = new ArrayList<LogicalRelationalOperator>() ;
            inputs.add(load1) ;
View Full Code Here

            LOCogroup cogroup1 = new LOCogroup(plan);
                   
            // Create expression inner plan #1 of input #1
            LogicalExpressionPlan innerPlan11 = new LogicalExpressionPlan() ;
            ProjectExpression project111 = new ProjectExpression(innerPlan11, 0, 0, cogroup1) ;
            ConstantExpression const111 = new ConstantExpression(innerPlan11, 26F) ;
            SubtractExpression subtract111 = new SubtractExpression(innerPlan11, project111, const111) ;

   
            // Create expression inner plan #1 of input #2
            LogicalExpressionPlan innerPlan12 = new LogicalExpressionPlan() ;
            ProjectExpression project121 = new ProjectExpression(innerPlan12, 1, 0, cogroup1) ;
            ConstantExpression const121 = new ConstantExpression(innerPlan12, 26) ;
            SubtractExpression subtract121 = new SubtractExpression(innerPlan12, project121, const121) ;
   

   
            // Create Cogroup
View Full Code Here

   
            LOCogroup cogroup1 = new LOCogroup(plan);
            // Create expression inner plan #1
            LogicalExpressionPlan innerPlan11 = new LogicalExpressionPlan() ;
            ProjectExpression project111 = new ProjectExpression(innerPlan11, 0, 0, cogroup1) ;
            ConstantExpression const111 = new ConstantExpression(innerPlan11, 26F) ;
            SubtractExpression subtract111 = new SubtractExpression(innerPlan11, project111, const111) ;

   
            // Create expression inner plan #2
            LogicalExpressionPlan innerPlan12 = new LogicalExpressionPlan() ;
            ConstantExpression const121 = new ConstantExpression(innerPlan12, 26) ;
//            innerPlan12.add(const121) ;
   
            // Create Cogroup
            ArrayList<LogicalRelationalOperator> inputs = new ArrayList<LogicalRelationalOperator>() ;
            inputs.add(load1) ;
View Full Code Here

            // Create expression inner plan #1
            LogicalExpressionPlan innerPlan1 = new LogicalExpressionPlan() ;
            ProjectExpression project11 = new ProjectExpression(innerPlan1, 0, 0, loGen) ;
           
           
            ConstantExpression const11 = new ConstantExpression(innerPlan1, 26F) ;

            SubtractExpression subtract11 = new SubtractExpression(innerPlan1, project11, const11) ;
           
            // Create expression inner plan #2
            LogicalExpressionPlan innerPlan2 = new LogicalExpressionPlan() ;
View Full Code Here

           
            // Create expression inner plan #1
            LogicalExpressionPlan innerPlan1 = new LogicalExpressionPlan() ;
            ProjectExpression project11 = new ProjectExpression(innerPlan1, 0, 0, loGen) ;
           
            ConstantExpression const11 = new ConstantExpression(innerPlan1, "26F") ;
            SubtractExpression subtract11 = new SubtractExpression(innerPlan1, project11, const11) ;

            // Create expression inner plan #2
            LogicalExpressionPlan innerPlan2 = new LogicalExpressionPlan() ;
            innerLoad1 = new LOInnerLoad(innerRelPlan, foreach1, 0);
View Full Code Here

    @Test
    public void testExpressionTypeChecking1() throws Throwable {
        LogicalExpressionPlan expPlan = new LogicalExpressionPlan();

        ConstantExpression constant1 = new ConstantExpression(expPlan, 10);

        ConstantExpression constant2 =  new ConstantExpression(expPlan, 20D) ;
        ConstantExpression constant3 =  new ConstantExpression(expPlan, 123f) ;

        AddExpression add1 = new AddExpression(expPlan, constant1, constant2) ;
        CastExpression cast1 = new CastExpression(expPlan,constant3, createFS(DataType.DOUBLE)) ;
        MultiplyExpression mul1 = new MultiplyExpression(expPlan, add1, cast1) ;
View Full Code Here

    }

    @Test
    public void testExpressionTypeCheckingFail1() throws Throwable {
        LogicalExpressionPlan plan = new LogicalExpressionPlan() ;
        ConstantExpression constant1 = new ConstantExpression(plan, 10) ;
        ConstantExpression constant2 =  new ConstantExpression(plan, 20D) ;
        ConstantExpression constant3 =  new ConstantExpression(plan, "123") ;

        AddExpression add1 = new AddExpression(plan, constant1, constant2) ;
        CastExpression cast1 = new CastExpression(plan, constant3,  createFS(DataType.BYTEARRAY)) ;
        MultiplyExpression mul1 = new MultiplyExpression(plan, add1, cast1) ;
View Full Code Here

    }

    @Test
    public void testExpressionTypeChecking2() throws Throwable {
        LogicalExpressionPlan plan = new LogicalExpressionPlan() ;
        ConstantExpression constant1 = new ConstantExpression(plan, 10) ;
        ConstantExpression constant2 =  new ConstantExpression(plan,  new DataByteArray()) ;
        ConstantExpression constant3 =  new ConstantExpression(plan,  123L) ;
        ConstantExpression constant4 =  new ConstantExpression(plan,  true) ;

        SubtractExpression sub1 = new SubtractExpression(plan, constant1, constant2) ;
        GreaterThanExpression gt1 = new GreaterThanExpression(plan, sub1, constant3) ;
        AndExpression and1 = new AndExpression(plan, gt1, constant4) ;
        NotExpression not1 = new NotExpression(plan, and1) ;
View Full Code Here


    @Test
    public void testExpressionTypeChecking3() throws Throwable {
        LogicalExpressionPlan plan = new LogicalExpressionPlan() ;
        ConstantExpression constant1 = new ConstantExpression(plan, 10) ;
        ConstantExpression constant2 =  new ConstantExpression(plan, 20L) ;
        ConstantExpression constant3 =  new ConstantExpression(plan, 123) ;

        ModExpression mod1 = new ModExpression(plan, constant1, constant2) ;
        EqualExpression equal1 = new EqualExpression(plan, mod1, constant3) ;

        CompilationMessageCollector collector = new CompilationMessageCollector() ;
View Full Code Here

TOP

Related Classes of org.apache.pig.newplan.logical.expression.ConstantExpression

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.