pyspark.sql.functions.product

pyspark.sql.functions。 产品 ( 上校:ColumnOrName )→pyspark.sql.column.Column

聚合函数:返回一组中的值的乘积。

参数
上校 str,

列包含值相乘

例子

> > >df=火花范围(1,10)toDF(“x”)withColumn(“mod3”,上校(“x”)%3)> > >触头=dfgroupBy(“mod3”)gg(产品(“x”)别名(“产品”))> > >触头orderBy(“mod3”)显示()+ - - - + - - - - - - - +| | mod3 |产品+ - - - + - - - - - - - +| 0 | 162.0 || 1 | 28.0 || 2 | 80.0 |+ - - - + - - - - - - - +