Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@1ambda
Created December 24, 2021 00:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 1ambda/48f5bebb136b5085f936cc74d5f76bb2 to your computer and use it in GitHub Desktop.
Save 1ambda/48f5bebb136b5085f936cc74d5f76bb2 to your computer and use it in GitHub Desktop.
# dfListingJdbc\
.select(spark_partition_id().alias("partitionId"))\
.groupBy("partitionId")\
.count()\
.show()
+-----------+-----+
|partitionId|count|
+-----------+-----+
| 1| 1|
| 4| 4862|
| 2| 2|
+-----------+-----+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment