Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for multiple grouped / aggregated columns in pivoting #1145

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mattjubb
Copy link

@mattjubb mattjubb commented Sep 5, 2022

Thanks for contributing.

Description

  • Added support for multiple grouping / aggregation columns via the pivot method. kept the old method contract as is but now delegates to shared logic
  • renamed column1/column2/column3 to groupedColumn/pivotColumn/aggregatedColumn to make it more
    obvious what the meaning of each argument is
  • not entirely sure the approach of concatenating the pivot value with aggregated column name ie "2012.Score" is the best, open to suggestions here.

Note: first time contributing to a project on github so let me know if i've done something wrong

Testing

yes added tests for 3 use cases 1) both multiple grouping and aggregation columns 2) multiple grouping and single aggregation 3) single grouping and

List<String> aggregatedColumnNames,
AggregateFunction<?, ?> aggregateFunction) {
return pivot(
groupingColumnNames.stream().map(this::categoricalColumn).collect(Collectors.toList()),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy is complaining that you're doing Collectors.toList here when toList is already statically imported. I'm fine either way to want it as long as it's consistent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants