Examples of ReturnValueExpression


Examples of org.apache.drill.exec.physical.impl.filter.ReturnValueExpression

          ._then()
          ._return(JExpr.lit(1));
    }

    FunctionCall f = new FunctionCall(ComparatorFunctions.COMPARE_TO, ImmutableList.of((LogicalExpression) new HoldingContainerExpression(compareLeftExprHolder), (LogicalExpressionnew HoldingContainerExpression(compareRightExprHolder)), ExpressionPosition.UNKNOWN);
    cg.addExpr(new ReturnValueExpression(f, false), false);
//   
//    // equality
//    cg.getEvalBlock()._if(compareLeftExprHolder.getValue().eq(compareRightExprHolder.getValue()))
//                     ._then()
//                       ._return(JExpr.lit(0));
View Full Code Here

Examples of org.apache.drill.exec.physical.impl.filter.ReturnValueExpression

    final LogicalExpression expr = ExpressionTreeMaterializer.materialize(filterExpression, incoming, collector);
    if(collector.hasErrors()){
      throw new SchemaChangeException(String.format("Failure while trying to materialize incoming schema.  Errors:\n %s.", collector.toErrorString()));
    }

    cg.addExpr(new ReturnValueExpression(expr));
   
    try {
      Partitioner p = context.getImplementationClass(cg);
      p.setup(context, incoming, outgoing);
    } catch (ClassTransformationException | IOException e) {
View Full Code Here

Examples of org.drools.spi.ReturnValueExpression

        // Declarations know the pattern they derive their value form
        final Declaration priceDeclaration = new Declaration( "price1",
                                                              priceExtractor,
                                                              pattern );

        final ReturnValueExpression isDoubleThePrice = new ReturnValueExpression() {
            /**
             *
             */
            private static final long serialVersionUID = 400L;

View Full Code Here

Examples of org.drools.spi.ReturnValueExpression

        Rule rule3 = ((KnowledgePackageImp)pkg3).pkg.getRule( "rule1" );
       
        // test return value
        Pattern p1 = ( Pattern ) rule1.getLhs().getChildren().get( 0 );
        VariableConstraint rvc1 = ( VariableConstraint ) p1.getConstraints().get( 0 );       
        ReturnValueExpression rve1 = ((ReturnValueRestriction) rvc1.getRestriction()).getExpression();
       
        Pattern p2 = ( Pattern ) rule2.getLhs().getChildren().get( 0 );       
        VariableConstraint rvc2 = ( VariableConstraint ) p2.getConstraints().get( 0 );       
        ReturnValueExpression rve2 = ((ReturnValueRestriction) rvc2.getRestriction()).getExpression();       
       
        assertNotSame( rve1, rve2 );
        assertEquals( rve1, rve2 );
       
        Pattern p3 = ( Pattern ) rule3.getLhs().getChildren().get( 0 );
        VariableConstraint rvc3 = ( VariableConstraint ) p3.getConstraints().get( 0 );       
        ReturnValueExpression rve3 = ((ReturnValueRestriction) rvc3.getRestriction()).getExpression();
       
        assertNotSame( rve1, rve3 );
        assertThat(rve1, not( equalTo( rve3 ) ) );
       
        // test inline eval
View Full Code Here

Examples of org.drools.spi.ReturnValueExpression

        // Declarations know the pattern they derive their value form
        final Declaration priceDeclaration = new Declaration( "price1",
                                                              priceExtractor,
                                                              pattern );

        final ReturnValueExpression isDoubleThePrice = new ReturnValueExpression() {
            private static final long serialVersionUID = 510l;

            public FieldValue evaluate(Object object,
                                       Tuple tuple, // ?price
                                       Declaration[] previousDeclarations,
View Full Code Here

Examples of org.drools.spi.ReturnValueExpression

        // Declarations know the pattern they derive their value form
        final Declaration priceDeclaration = new Declaration( "price1",
                                                              priceExtractor,
                                                              pattern );

        final ReturnValueExpression isDoubleThePrice = new ReturnValueExpression() {
            /**
             *
             */
            private static final long serialVersionUID = 400L;

View Full Code Here

Examples of org.drools.spi.ReturnValueExpression

        // Declarations know the pattern they derive their value form
        final Declaration priceDeclaration = new Declaration( "price1",
                                                              priceExtractor,
                                                              pattern );

        final ReturnValueExpression isDoubleThePrice = new ReturnValueExpression() {
            private static final long serialVersionUID = 510l;

            public FieldValue evaluate(Object object,
                                       Tuple tuple, // ?price
                                       Declaration[] previousDeclarations,
View Full Code Here

Examples of org.drools.spi.ReturnValueExpression

        // Declarations know the pattern they derive their value form
        final Declaration priceDeclaration = new Declaration( "price1",
                                                              priceExtractor,
                                                              pattern );

        final ReturnValueExpression isDoubleThePrice = new ReturnValueExpression() {
            /**
             *
             */
            private static final long serialVersionUID = 400L;

View Full Code Here

Examples of org.drools.spi.ReturnValueExpression

        // Declarations know the pattern they derive their value form
        final Declaration priceDeclaration = new Declaration( "price1",
                                                              priceExtractor,
                                                              pattern );

        final ReturnValueExpression isDoubleThePrice = new ReturnValueExpression() {
            /**
             *
             */
            private static final long serialVersionUID = 400L;

View Full Code Here

Examples of org.drools.spi.ReturnValueExpression

        Rule rule3 = ((KnowledgePackageImp)pkg3).pkg.getRule( "rule1" );              
       
        // test return value
        Pattern p1 = ( Pattern ) rule1.getLhs().getChildren().get( 0 );
        ReturnValueConstraint rvc1 = ( ReturnValueConstraint ) p1.getConstraints().get( 1 );
        ReturnValueExpression rve1 = rvc1.getExpression();
       
        Pattern p2 = ( Pattern ) rule2.getLhs().getChildren().get( 0 );
        ReturnValueConstraint rvc2 = ( ReturnValueConstraint ) p2.getConstraints().get( 1 );
        ReturnValueExpression rve2 = rvc2.getExpression();
        assertNotSame( rve1, rve2 );
        assertEquals( rve1, rve2 );
       
        Pattern p3 = ( Pattern ) rule3.getLhs().getChildren().get( 0 );
        ReturnValueConstraint rvc3 = ( ReturnValueConstraint ) p3.getConstraints().get( 1 );
        ReturnValueExpression rve3 = rvc3.getExpression();               
        assertNotSame( rve1, rve3 );
        assertThat(rve1, not( equalTo( rve3 ) ) );
       
        // test inline eval
        PredicateConstraint pc1 = ( PredicateConstraint p1.getConstraints().get( 2 );
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.