Example #1
0
 /// <summary>
 /// Registers the given delegate as a vector user-defined function with the specified name.
 /// </summary>
 /// <typeparam name="T">Specifies the type of the first argument to the UDF.</typeparam>
 /// <typeparam name="TResult">Specifies the return type of the UDF.</typeparam>
 /// <param name="udf">The <see cref="UdfRegistration"/> object to invoke the register the Vector UDF.</param>
 /// <param name="name">The UDF name.</param>
 /// <param name="f">The UDF function implementation.</param>
 public static void RegisterVector <T, TResult>(
     this UdfRegistration udf, string name, Func <T, TResult> f)
     where T : DataFrameColumn
     where TResult : DataFrameColumn
 {
     RegisterVector <TResult>(udf, name, DataFrameUdfUtils.CreateVectorUdfWrapper(f));
 }
 /// <summary>Creates a Vector UDF from the specified delegate.</summary>
 /// <typeparam name="T">Specifies the type of the first argument to the UDF.</typeparam>
 /// <typeparam name="TResult">Specifies the return type of the UDF.</typeparam>
 /// <param name="udf">The Vector UDF function implementation.</param>
 /// <returns>
 /// A delegate that returns a <see cref="Column"/> for the result of the Vector UDF.
 /// </returns>
 public static Func <Column, Column> VectorUdf <T, TResult>(Func <T, TResult> udf)
     where T : DataFrameColumn
     where TResult : DataFrameColumn
 {
     return(Functions.CreateVectorUdf <TResult>(
                udf.Method.ToString(),
                DataFrameUdfUtils.CreateVectorUdfWrapper(udf)).Apply1);
 }
Example #3
0
 /// <summary>
 /// Registers the given delegate as a vector user-defined function with the specified name.
 /// </summary>
 /// <typeparam name="T1">Specifies the type of the first argument to the UDF.</typeparam>
 /// <typeparam name="T2">Specifies the type of the second argument to the UDF.</typeparam>
 /// <typeparam name="T3">Specifies the type of the third argument to the UDF.</typeparam>
 /// <typeparam name="T4">Specifies the type of the fourth argument to the UDF.</typeparam>
 /// <typeparam name="T5">Specifies the type of the fifth argument to the UDF.</typeparam>
 /// <typeparam name="T6">Specifies the type of the sixth argument to the UDF.</typeparam>
 /// <typeparam name="TResult">Specifies the return type of the UDF.</typeparam>
 /// <param name="udf">The <see cref="UdfRegistration"/> object to invoke the register the Vector UDF.</param>
 /// <param name="name">The UDF name.</param>
 /// <param name="f">The UDF function implementation.</param>
 public static void RegisterVector <T1, T2, T3, T4, T5, T6, TResult>(
     this UdfRegistration udf, string name, Func <T1, T2, T3, T4, T5, T6, TResult> f)
     where T1 : DataFrameColumn
     where T2 : DataFrameColumn
     where T3 : DataFrameColumn
     where T4 : DataFrameColumn
     where T5 : DataFrameColumn
     where T6 : DataFrameColumn
     where TResult : DataFrameColumn
 {
     RegisterVector <TResult>(udf, name, DataFrameUdfUtils.CreateVectorUdfWrapper(f));
 }
 /// <summary>Creates a Vector UDF from the specified delegate.</summary>
 /// <typeparam name="T1">Specifies the type of the first argument to the UDF.</typeparam>
 /// <typeparam name="T2">Specifies the type of the second argument to the UDF.</typeparam>
 /// <typeparam name="T3">Specifies the type of the third argument to the UDF.</typeparam>
 /// <typeparam name="T4">Specifies the type of the fourth argument to the UDF.</typeparam>
 /// <typeparam name="T5">Specifies the type of the fifth argument to the UDF.</typeparam>
 /// <typeparam name="TResult">Specifies the return type of the UDF.</typeparam>
 /// <param name="udf">The Vector UDF function implementation.</param>
 /// <returns>
 /// A delegate that returns a <see cref="Column"/> for the result of the Vector UDF.
 /// </returns>
 public static Func <Column, Column, Column, Column, Column, Column> VectorUdf <T1, T2, T3, T4, T5, TResult>(
     Func <T1, T2, T3, T4, T5, TResult> udf)
     where T1 : DataFrameColumn
     where T2 : DataFrameColumn
     where T3 : DataFrameColumn
     where T4 : DataFrameColumn
     where T5 : DataFrameColumn
     where TResult : DataFrameColumn
 {
     return(Functions.CreateVectorUdf <TResult>(
                udf.Method.ToString(),
                DataFrameUdfUtils.CreateVectorUdfWrapper(udf)).Apply5);
 }