Examples of UserFuncExpression


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 == null ? "" : 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

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

        }

    }

    LogicalExpression buildInvokerUDF(SourceLocation loc, LogicalExpressionPlan plan, String packageName, String funcName, boolean isStatic, List<LogicalExpression> args) throws RecognitionException {
        LogicalExpression le = new UserFuncExpression(plan, new FuncSpec(InvokerGenerator.class.getName()), args, false, true, isStatic, packageName, funcName);
        le.setLocation(loc);
        return le;
    }
View Full Code Here

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

        if( funcSpec == null ) {
            funcName = func.getName();
            funcSpec = new FuncSpec(funcName);
            //this point is only reached if there was no DEFINE statement for funcName
            //in which case, we pass that information along
            le = new UserFuncExpression(plan, funcSpec, args, false);
        } else {
            le = new UserFuncExpression(plan, funcSpec, args, true);
        }

        le.setLocation(loc);
        return le;
    }
View Full Code Here

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

        innerPlan.add(innerGenerate);
        innerPlan.connect(innerLoad, innerGenerate);

        LogicalExpressionPlan lep = new LogicalExpressionPlan();
        LogicalExpression proj = new ProjectExpression(lep, 0, -1, innerGenerate);    // -1 in the 3rd arg. means "*"
        LogicalExpression func = new UserFuncExpression(lep, funcSpec);
        lep.add(proj);
        lep.add(func);
        lep.connect(func, proj);
        exps.add(lep);
       
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

       
        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
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.