Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Provide groupByKey shortcuts for groupBy.as#213

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
EnricoMi merged 3 commits intomasterfromgroupbykey
Dec 9, 2023
Merged

Conversation

@EnricoMi
Copy link
Contributor

This provides shortcuts forgroupBy(...).as[...] that make it easier to use column-basedgroupByKey.

CallingDataset.groupBy(...).as[K, T] should be preferred over callingDataset.groupByKey(...) whenever possible. The former allows Catalyst to exploit existing partitioning and ordering of the Dataset, while the latter hides from Catalyst which columns are used to create the keys.

When the dataset is already partitioned and ordered by the grouping columns,Dataset.groupByKey(...) will repartition and order the entire dataset again.

Example:

Callingds.groupByKey(_.id) hides from Catalyst that columnid is the grouping key, whileds.groupBy($"id").as[Int, V] tells Catalyst thatds is to be grouped by (partitioned and ordered by) columnid.

The new column-basedgroupByKey methods make it easier for users to find a way to express the grouping by expressions. Looking at theDataset API, the user findsgroupByKey withColumn. The existinggroupBy method returns aRelationalGroupedDataset, which provides theas[K, V] method, which allows for the same semantics, but is difficult to find.

The new column-basedgroupByKey methods further do not require the user to specify the typeV of the originalDataset[V], asgroupByKey has access to the type / encoder:

ds.groupBy($"id").as[Int, V]

vs.

ds.groupByKey[Int]($"id")

@github-actions
Copy link

github-actionsbot commentedDec 8, 2023
edited
Loading

Test Results

     566 files  ±  0       566 suites  ±0   1h 29m 12s⏱️ +11s
     536 tests +  2       536✔️ +  2  0💤 ±0  0 ±0 
16 828 runs  +72  16 826✔️ +72  2💤 ±0  0 ±0 

Results for commit411afe8. ± Comparison against base commit8314de4.

This pull requestremoves 28 andadds 30 tests.Note that renamed tests count towards both.
uk.co.gresearch.spark.GroupBySortedSuite ‑ df.groupByKeySorted should flatMapSortedGroupsuk.co.gresearch.spark.GroupBySortedSuite ‑ df.groupByKeySorted should flatMapSortedGroups reverseuk.co.gresearch.spark.GroupBySortedSuite ‑ df.groupByKeySorted should flatMapSortedGroups with partition numuk.co.gresearch.spark.GroupBySortedSuite ‑ df.groupByKeySorted should flatMapSortedGroups with partition num and reverseuk.co.gresearch.spark.GroupBySortedSuite ‑ df.groupByKeySorted should flatMapSortedGroups with stateuk.co.gresearch.spark.GroupBySortedSuite ‑ df.groupByKeySorted should flatMapSortedGroups with tuple keyuk.co.gresearch.spark.GroupBySortedSuite ‑ df.groupByKeySorted should flatMapSortedGroups with tuple key and stateuk.co.gresearch.spark.GroupBySortedSuite ‑ df.groupBySorted should flatMapSortedGroupsuk.co.gresearch.spark.GroupBySortedSuite ‑ df.groupBySorted should flatMapSortedGroups reverseuk.co.gresearch.spark.GroupBySortedSuite ‑ df.groupBySorted should flatMapSortedGroups with partition num…
uk.co.gresearch.spark.GroupBySuite ‑ df.groupByKeySorted should flatMapSortedGroupsuk.co.gresearch.spark.GroupBySuite ‑ df.groupByKeySorted should flatMapSortedGroups reverseuk.co.gresearch.spark.GroupBySuite ‑ df.groupByKeySorted should flatMapSortedGroups with partition numuk.co.gresearch.spark.GroupBySuite ‑ df.groupByKeySorted should flatMapSortedGroups with partition num and reverseuk.co.gresearch.spark.GroupBySuite ‑ df.groupByKeySorted should flatMapSortedGroups with stateuk.co.gresearch.spark.GroupBySuite ‑ df.groupByKeySorted should flatMapSortedGroups with tuple keyuk.co.gresearch.spark.GroupBySuite ‑ df.groupByKeySorted should flatMapSortedGroups with tuple key and stateuk.co.gresearch.spark.GroupBySuite ‑ df.groupBySorted should flatMapSortedGroupsuk.co.gresearch.spark.GroupBySuite ‑ df.groupBySorted should flatMapSortedGroups reverseuk.co.gresearch.spark.GroupBySuite ‑ df.groupBySorted should flatMapSortedGroups with partition num…

♻️ This comment has been updated with latest results.

@EnricoMiEnricoMi merged commit119c854 intomasterDec 9, 2023
@EnricoMiEnricoMi deleted the groupbykey branchDecember 9, 2023 21:51
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@EnricoMi

[8]ページ先頭

©2009-2025 Movatter.jp