coral-beam/src/main/java/com/linkedin/beam/utils/RexToBeamConverter.java
private Expression callUDF(Method udfMethod, String pigUDFKey, List<Expression> exOperands) {
    localExeptions.addAll(Arrays.asList(udfMethod.getExceptionTypes()));
    final Class udfClass = udfMethod.getDeclaringClass();
    final PigUserDefinedFunction pigFunc = pigUDFs.get(pigUDFKey);
    if (pigFunc != null) {
      // Pig UDF was already declared and initialized in the beginning of the code-gen file
      return Expressions.call(PigUDFUtils.getPigUDFParamExpr(pigFunc), MethodNames.EXEC, exOperands);
    } else if (Modifier.isStatic(udfMethod.getModifiers())) {
      List<Expression> pigExpOperands = exOperands;
      if (udfClass.getName().equals("org.apache.calcite.piglet.PigRelSqlUdfs") && udfMethod.getName()
          .equals(MethodNames.BUILD_TUPLE)) {
        // To buil Pig Tuple for the UDF, need to wrap operands into Pig types
        pigExpOperands = wrapPigOperands(exOperands);
      }
      return Expressions.call(udfMethod, pigExpOperands);
    } else {
      return Expressions.call(Expressions.new_(udfMethod.getDeclaringClass()), udfMethod.getName(), exOperands);
    }
  }
/**
   * Calls an UDF.
   *
   * @param udfMethod Method implementing the UDF
   * @param pigUDFKey Key to lookup Pig UDF map for pre-initialized Pig UDF object
   * @param exOperands UDF operands
   */
Calls an UDF.
@param udfMethod Method implementing the UDF
@param pigUDFKey Key to lookup Pig UDF map for pre-initialized Pig UDF object
@param exOperands UDF operands
Calls an UDF . @param udfMethod Method implementing the UDF @param pigUDFKey Key to lookup Pig UDF map for pre - initialized Pig UDF object @param exOperands UDF operands
private Expression callUDF(Method udfMethod, String pigUDFKey, List<Expression> exOperands) {
    localExeptions.addAll(Arrays.asList(udfMethod.getExceptionTypes()));
    final Class udfClass = udfMethod.getDeclaringClass();
    final PigUserDefinedFunction pigFunc = pigUDFs.get(pigUDFKey);
    if (pigFunc != null) {
      return Expressions.call(PigUDFUtils.getPigUDFParamExpr(pigFunc), MethodNames.EXEC, exOperands);
    } else if (Modifier.isStatic(udfMethod.getModifiers())) {
      List<Expression> pigExpOperands = exOperands;
      if (udfClass.getName().equals("org.apache.calcite.piglet.PigRelSqlUdfs") && udfMethod.getName()
          .equals(MethodNames.BUILD_TUPLE)) {
        pigExpOperands = wrapPigOperands(exOperands);
      }
      return Expressions.call(udfMethod, pigExpOperands);
    } else {
      return Expressions.call(Expressions.new_(udfMethod.getDeclaringClass()), udfMethod.getName(), exOperands);
    }
  }
private Expression callUDF ( Method udfMethod , String pigUDFKey , List < Expression > exOperands ) { localExeptions . addAll ( Arrays . asList ( udfMethod . getExceptionTypes ( ) ) ) ; final Class udfClass = udfMethod . getDeclaringClass ( ) ; final PigUserDefinedFunction pigFunc = pigUDFs . get ( pigUDFKey ) ; if ( pigFunc != null ) { return Expressions . call ( PigUDFUtils . getPigUDFParamExpr ( pigFunc ) , MethodNames . EXEC , exOperands ) ; } else if ( Modifier . isStatic ( udfMethod . getModifiers ( ) ) ) { List < Expression > pigExpOperands = exOperands ; if ( udfClass . getName ( ) . equals ( "org.apache.calcite.piglet.PigRelSqlUdfs" ) && udfMethod . getName ( ) . equals ( MethodNames . BUILD_TUPLE ) ) { pigExpOperands = wrapPigOperands ( exOperands ) ; } return Expressions . call ( udfMethod , pigExpOperands ) ; } else { return Expressions . call ( Expressions . new_ ( udfMethod . getDeclaringClass ( ) ) , udfMethod . getName ( ) , exOperands ) ; } }
Calls an UDF.
Calls an UDF .
// Pig UDF was already declared and initialized in the beginning of the code-gen file // To buil Pig Tuple for the UDF, need to wrap operands into Pig types