RelationalGroupedDataset.Apply 方法

定义

重载

Apply(StructType, Func<RecordBatch,RecordBatch>)

使用 UDF 映射当前数据帧的每个组,并将结果作为数据帧返回。

用户定义的函数应采用 Apache Arrow RecordBatch 并返回另一个 Apache Arrow RecordBatch。 对于每个组,所有列作为 RecordBatch 一起传递到 user-function,返回的 RecordBatch 组合为数据帧。

返回 Apache.Arrow.RecordBatch 的 可以是任意长度,并且其架构必须与 匹配 returnType

Apply(StructType, Func<DataFrame,DataFrame>)

使用 UDF 映射当前数据帧的每个组,并将结果作为数据帧返回。

用户定义的函数应采用 并返回另一个 DataFrameDataFrame。 对于每个组,所有列作为 一 DataFrame 起传递给 user-function,返回的 FxDataFrame 合并为数据帧。

返回 DataFrame 的 可以是任意长度,并且其架构必须与 匹配 returnType

Apply(StructType, Func<RecordBatch,RecordBatch>)

使用 UDF 映射当前数据帧的每个组,并将结果作为数据帧返回。

用户定义的函数应采用 Apache Arrow RecordBatch 并返回另一个 Apache Arrow RecordBatch。 对于每个组,所有列作为 RecordBatch 一起传递到 user-function,返回的 RecordBatch 组合为数据帧。

返回 Apache.Arrow.RecordBatch 的 可以是任意长度,并且其架构必须与 匹配 returnType

public Microsoft.Spark.Sql.DataFrame Apply (Microsoft.Spark.Sql.Types.StructType returnType, Func<Apache.Arrow.RecordBatch,Apache.Arrow.RecordBatch> func);
member this.Apply : Microsoft.Spark.Sql.Types.StructType * Func<Apache.Arrow.RecordBatch, Apache.Arrow.RecordBatch> -> Microsoft.Spark.Sql.DataFrame
Public Function Apply (returnType As StructType, func As Func(Of RecordBatch, RecordBatch)) As DataFrame

参数

returnType
StructType

表示 StructType 返回数据集形状的 。

func
Func<Apache.Arrow.RecordBatch,Apache.Arrow.RecordBatch>

分组映射用户定义函数。

返回

应用了 UDF 的新 DataFrame 对象。

适用于

Apply(StructType, Func<DataFrame,DataFrame>)

使用 UDF 映射当前数据帧的每个组,并将结果作为数据帧返回。

用户定义的函数应采用 并返回另一个 DataFrameDataFrame。 对于每个组,所有列作为 一 DataFrame 起传递给 user-function,返回的 FxDataFrame 合并为数据帧。

返回 DataFrame 的 可以是任意长度,并且其架构必须与 匹配 returnType

public Microsoft.Spark.Sql.DataFrame Apply (Microsoft.Spark.Sql.Types.StructType returnType, Func<Microsoft.Data.Analysis.DataFrame,Microsoft.Data.Analysis.DataFrame> func);
member this.Apply : Microsoft.Spark.Sql.Types.StructType * Func<Microsoft.Data.Analysis.DataFrame, Microsoft.Data.Analysis.DataFrame> -> Microsoft.Spark.Sql.DataFrame
Public Function Apply (returnType As StructType, func As Func(Of DataFrame, DataFrame)) As DataFrame

参数

returnType
StructType

表示 StructType 返回数据集架构的 。

func
Func<DataFrame,DataFrame>

分组映射用户定义函数。

返回

应用了 UDF 的新 DataFrame 对象。

适用于