Examples of ConstantExpression


Examples of org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOperators.ConstantExpression

   

    @Test
    public void testDoubleEq() throws Exception {
        ConstantExpression lt = GenPhyOp.exprConst();
        lt.setValue(new Double(1.0));
        ConstantExpression rt = GenPhyOp.exprConst();
        rt.setValue(new Double(1.0));
        EqualToExpr g = GenPhyOp.compEqualToExpr();
        g.setLhs(lt);
        g.setRhs(rt);
        g.setOperandType(DataType.DOUBLE);
        Result r = g.getNext(new Boolean(true));
View Full Code Here

Examples of org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOperators.ConstantExpression

     
  }

    @Test
    public void testStringNe() throws Exception {
        ConstantExpression lt = GenPhyOp.exprConst();
        lt.setValue(new String("a"));
        ConstantExpression rt = GenPhyOp.exprConst();
        rt.setValue(new String("b"));
        EqualToExpr g = GenPhyOp.compEqualToExpr();
        g.setLhs(lt);
        g.setRhs(rt);
        g.setOperandType(DataType.CHARARRAY);
        Result r = g.getNext(new Boolean(true));
View Full Code Here

Examples of org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOperators.ConstantExpression

    }

   
    @Test
    public void testStringEq() throws Exception {
        ConstantExpression lt = GenPhyOp.exprConst();
        lt.setValue(new String("b"));
        ConstantExpression rt = GenPhyOp.exprConst();
        rt.setValue(new String("b"));
        EqualToExpr g = GenPhyOp.compEqualToExpr();
        g.setLhs(lt);
        g.setRhs(rt);
        g.setOperandType(DataType.CHARARRAY);
        Result r = g.getNext(new Boolean(true));
View Full Code Here

Examples of org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOperators.ConstantExpression

  }


  @Test
    public void testDataByteArrayNe() throws Exception {
        ConstantExpression lt = GenPhyOp.exprConst();
        lt.setValue(new DataByteArray("a"));
        ConstantExpression rt = GenPhyOp.exprConst();
        rt.setValue(new DataByteArray("b"));
        EqualToExpr g = GenPhyOp.compEqualToExpr();
        g.setLhs(lt);
        g.setRhs(rt);
        g.setOperandType(DataType.BYTEARRAY);
        Result r = g.getNext(new Boolean(true));
View Full Code Here

Examples of org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOperators.ConstantExpression

    }

   
    @Test
    public void testDataByteArrayEq() throws Exception {
        ConstantExpression lt = GenPhyOp.exprConst();
        lt.setValue(new DataByteArray("b"));
        ConstantExpression rt = GenPhyOp.exprConst();
        rt.setValue(new DataByteArray("b"));
        EqualToExpr g = GenPhyOp.compEqualToExpr();
        g.setLhs(lt);
        g.setRhs(rt);
        g.setOperandType(DataType.BYTEARRAY);
        Result r = g.getNext(new Boolean(true));
View Full Code Here

Examples of org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOperators.ConstantExpression

   
    @Test
    public void testTupleEq() throws ExecException{
        Tuple tuple_1=TupleFactory.getInstance().newTuple("item_1");
        Tuple tuple_2=TupleFactory.getInstance().newTuple("item_1");
        ConstantExpression lt = GenPhyOp.exprConst();
        lt.setValue(tuple_1);
        ConstantExpression rt = GenPhyOp.exprConst();
        rt.setValue(tuple_2);
        EqualToExpr g = GenPhyOp.compEqualToExpr();
        g.setLhs(lt);
        g.setRhs(rt);
        g.setOperandType(DataType.TUPLE);
        Result r = g.getNext(new Boolean(true));
View Full Code Here

Examples of org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOperators.ConstantExpression

   
    @Test
    public void testTupleNe() throws ExecException{
        Tuple tuple_1=TupleFactory.getInstance().newTuple("item_1");
        Tuple tuple_2=TupleFactory.getInstance().newTuple("item_2");
        ConstantExpression lt = GenPhyOp.exprConst();
        lt.setValue(tuple_1);
        ConstantExpression rt = GenPhyOp.exprConst();
        rt.setValue(tuple_2);
        EqualToExpr g = GenPhyOp.compEqualToExpr();
        g.setLhs(lt);
        g.setRhs(rt);
        g.setOperandType(DataType.TUPLE);
        Result r = g.getNext(new Boolean(true));
View Full Code Here

Examples of org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOperators.ConstantExpression

        Map map_1=new HashMap();
        map_1.put("key_1", "value_1");
        Map map_2=new HashMap();
        map_2.put("key_1", "value_1");
       
        ConstantExpression lt = GenPhyOp.exprConst();
        lt.setValue(map_1);
        ConstantExpression rt = GenPhyOp.exprConst();
        rt.setValue(map_2);
        EqualToExpr g = GenPhyOp.compEqualToExpr();
        g.setLhs(lt);
        g.setRhs(rt);
        g.setOperandType(DataType.MAP);
        Result r = g.getNext(new Boolean(true));
View Full Code Here

Examples of org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOperators.ConstantExpression

        map_1.put("key_1", "value_1");
        Map map_2=new HashMap();
        map_2.put("key_1", "value_2");
       
        Tuple tuple_2=TupleFactory.getInstance().newTuple("item_2");
        ConstantExpression lt = GenPhyOp.exprConst();
        lt.setValue(map_1);
        ConstantExpression rt = GenPhyOp.exprConst();
        rt.setValue(map_2);
        EqualToExpr g = GenPhyOp.compEqualToExpr();
        g.setLhs(lt);
        g.setRhs(rt);
        g.setOperandType(DataType.MAP);
        Result r = g.getNext(new Boolean(true));
View Full Code Here

Examples of org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOperators.ConstantExpression

       
  }
   
  public <U> void checkNullValues( byte operandType, U value ) throws Exception {
   
        ConstantExpression lt = GenPhyOp.exprConst();
        ConstantExpression rt = GenPhyOp.exprConst();
        EqualToExpr g = GenPhyOp.compEqualToExpr();

        // test with null in lhs
        g.setOperandType(operandType);
        lt.setValue(null);
        rt.setValue( value );
        g.setLhs(lt);
        g.setRhs(rt);
      
        Result r = g.getNext(new Boolean(true));
        assertEquals(POStatus.STATUS_NULL, r.returnStatus);
        assertEquals(null, (Boolean)r.result);
       
        // test with null in rhs
        g.setOperandType(operandType);
        lt.setValue( value );
        rt.setValue(null);
        g.setLhs(lt);
        g.setRhs(rt);
      
        r = g.getNext(new Boolean(true));
        assertEquals(POStatus.STATUS_NULL, r.returnStatus);
        assertEquals(null, (Boolean)r.result);
  
       
        // test with null in lhs and rhs
        g.setOperandType(operandType);
        lt.setValue(null);
        rt.setValue(null);
        g.setLhs(lt);
        g.setRhs(rt);
      
        r = g.getNext(new Boolean(true));
        assertEquals(POStatus.STATUS_NULL, r.returnStatus);
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.