klotz: dataframe*

Bookmarks on this page are managed by an admin user.

0 bookmark(s) - Sort by: Date ↓ / Title / - Bookmarks from other users for this tag

  1. 3.1 Getting all map Keys from DataFrame MapType column
    2021-02-18 Tags: , , , by klotz
  2. df.withColumn("rank", rank().over(Window.partitionBy("Dept_id").orderBy($"salary".desc)))
    .filter($"rank" <= 3)
    .drop("rank")
    2019-06-24 Tags: , , , , , by klotz
  3. mport org.apache.spark.sql.expressions.Window
    import org.apache.spark.sql.functions.{rank, desc}

    val n: Int = ???

    // Window definition
    val w = Window.partitionBy($"user").orderBy(desc("rating"))

    // Filter
    df.withColumn("rank", rank.over(w)).where($"rank" <= n)
    2019-06-10 Tags: , , , by klotz

Top of the page

First / Previous / Next / Last / Page 1 of 0 SemanticScuttle - klotz.me: Tags: dataframe

About - Propulsed by SemanticScuttle