Examples of UserFuncExpression


Examples of org.apache.pig.experimental.logical.expression.UserFuncExpression

            EqualExpression eq = new EqualExpression(exprPlan, exprOpsMap.get(left), exprOpsMap.get(right));
            exprOpsMap.put(op, eq);
        }

        public void visit(LOUserFunc op) throws VisitorException {
            UserFuncExpression exp = new UserFuncExpression(exprPlan, op.getFuncSpec(), op.getType());
           
            List<ExpressionOperator> args = op.getArguments();
           
            for( ExpressionOperator arg : args ) {
                LogicalExpression expArg = exprOpsMap.get(arg);
View Full Code Here

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

        @Override
        public void transform(OperatorPlan matched) throws FrontendException {
            for (LogicalExpressionPlan expPlan : expPlansToInsertIdentity) {
                LogicalExpression oldRoot = (LogicalExpression)expPlan.getSources().get(0);
                UserFuncExpression userFuncExpression = new UserFuncExpression(expPlan, new FuncSpec(IdentityColumn.class.getName()));
                expPlan.connect(userFuncExpression, oldRoot);
            }
            expPlansToInsertIdentity.clear();
        }
View Full Code Here

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

        EqualExpression eq = new EqualExpression(exprPlan, exprOpsMap.get(left), exprOpsMap.get(right));
        exprOpsMap.put(op, eq);
    }

    public void visit(LOUserFunc op) throws VisitorException {
        UserFuncExpression exp = new UserFuncExpression(exprPlan, op.getFuncSpec());
       
        List<ExpressionOperator> args = op.getArguments();
       
        for( ExpressionOperator arg : args ) {
            LogicalExpression expArg = exprOpsMap.get(arg);
            exprPlan.connect(exp, expArg);
        }
       
        exprOpsMap.put(op, exp);
        // We need to track all the scalars
        if(op.getImplicitReferencedOperator() != null) {
            exp.setImplicitReferencedOperator(outerOpsMap.get(op.getImplicitReferencedOperator()));
        }

    }
View Full Code Here

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

        @Override
        public void transform(OperatorPlan matched) throws FrontendException {
            for (LogicalExpressionPlan expPlan : expPlansToInsertIdentity) {
                LogicalExpression oldRoot = (LogicalExpression)expPlan.getSources().get(0);
                UserFuncExpression userFuncExpression = new UserFuncExpression(expPlan, new FuncSpec(IdentityColumn.class.getName()));
                expPlan.connect(userFuncExpression, oldRoot);
            }
            expPlansToInsertIdentity.clear();

            // Since we adjust the uid layout, clear all cached uids
View Full Code Here

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

            SourceLocation valLoc) {
        LogicalExpressionPlan filterPlan = new LogicalExpressionPlan();
        //  Generate a filter condition.
        LogicalExpression konst = new ConstantExpression( filterPlan, value);
        konst.setLocation( valLoc );
        UserFuncExpression udf = new UserFuncExpression( filterPlan, new FuncSpec( RANDOM.class.getName() ) );
        new LessThanEqualExpression( filterPlan, udf, konst );
        LOFilter filter = new LOFilter( plan );
        return buildFilterOp( loc, filter, alias, inputAlias, filterPlan );
    }
View Full Code Here

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

        if( funcSpec == null ) {
            funcName = func.getClass().getName();
            funcSpec = new FuncSpec( funcName );
        }
       
        LogicalExpression le = new UserFuncExpression( plan, funcSpec, args );
        le.setLocation( loc );
        return le;
    }
View Full Code Here

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

        LogicalExpressionPlan filterPlan = new LogicalExpressionPlan();
        //  Generate a filter condition.
        LogicalExpression konst = new ConstantExpression( filterPlan, value);
        konst.setLocation( valLoc );
        UserFuncExpression udf = new UserFuncExpression( filterPlan, new FuncSpec( RANDOM.class.getName() ) );
        new LessThanExpression( filterPlan, udf, konst );
        LOFilter filter = new LOFilter( plan, true );
        return buildFilterOp( loc, filter, alias, inputAlias, filterPlan );
    }
View Full Code Here

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

    String buildSampleOp(SourceLocation loc, LOFilter filter, String alias, String inputAlias,
            LogicalExpressionPlan samplePlan, LogicalExpression expr)
                    throws ParserValidationException {

        UserFuncExpression udf = new UserFuncExpression( samplePlan, new FuncSpec( RANDOM.class.getName() ) );
        new LessThanExpression( samplePlan, udf, expr );
        return buildFilterOp( loc, filter, alias, inputAlias, samplePlan );
    }
View Full Code Here

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

      }

      // Create UDF with user specified dimensions
      LogicalExpressionPlan uexpPlan = new LogicalExpressionPlan();
      if (operations.get(operIdx).equals("CUBE")) {
    new UserFuncExpression(uexpPlan, new FuncSpec(CubeDimensions.class.getName()),
            lexpList);
      } else {
    new UserFuncExpression(uexpPlan, new FuncSpec(RollupDimensions.class.getName()),
            lexpList);
      }

      for (LogicalExpressionPlan lexp : lexpPlanList) {
    Iterator<Operator> it = lexp.getOperators();
View Full Code Here

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

            ConstantExpression rhs = new ConstantExpression(exprPlan, new Boolean(false));
            BinCondExpression binCond = new BinCondExpression(exprPlan, expr, lhs, rhs);
            args.add(binCond);
            ConstantExpression constExpr = new ConstantExpression(exprPlan, comment);
            args.add(constExpr);
            UserFuncExpression udf = new UserFuncExpression(exprPlan, new FuncSpec( Assert.class.getName() ), args );
            exprPlan.add(udf);
            filterOp.setFilterPlan(exprPlan);
            // pass the inputAlias to alias
            return buildFilterOp(loc, filterOp, inputAlias, inputAlias, exprPlan);
        } catch (Exception ex) {
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.