multiple criteria for aggregation on pySpark Dataframe

后端 未结 1 1144
夕颜
夕颜 2021-01-04 02:32

I have a pySpark dataframe that looks like this:

+-------------+----------+
|          sku|      date|
+-------------+----------+
|MLA-603526656|02/09/2016|
         


        
相关标签:
1条回答
  • You cannot use dict. Use:

    >>> from pyspark.sql import functions as F
    >>>
    >>> df_testing.groupBy('sku').agg(F.min('date'), F.max('date'))
    
    0 讨论(0)
提交回复
热议问题