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

Table: grouping #1392

Merged
merged 8 commits into from
Jan 11, 2021
Merged

Table: grouping #1392

merged 8 commits into from
Jan 11, 2021

Conversation

kustosz
Copy link
Contributor

@kustosz kustosz commented Jan 11, 2021

Pull Request Description

Introduces grouping to tables

Important Notes

Checklist

Please include the following checklist in your PR:

  • The documentation has been updated if necessary.
  • All code conforms to the Scala, Java, and Rust style guides.
  • All documentation and configuration conforms to the markdown and YAML style guides.
  • All code has been tested where possible.

@kustosz kustosz added Type: Enhancement p-highest Should be completed ASAP labels Jan 11, 2021
@kustosz kustosz self-assigned this Jan 11, 2021
Copy link
Contributor

@iamrecursion iamrecursion left a comment

Choose a reason for hiding this comment

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

Great job Marcin! Just some cosmetic and minor stuff.

catte

@@ -262,10 +262,118 @@ type Column
fields = Map.singleton "name" (Json.String name) . insert "data" storage_json
Json.Object fields

## Efficiently joins two tables based on either the index or a key column.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
## Efficiently joins two tables based on either the index or a key column.
## Efficiently joins two tables based on either the index or the specified key column.

Comment on lines 268 to 269
`other` with matching indexes. If the index in `other` is not unique,
the corresponding rows of `this` will be duplicated in the result.
Copy link
Contributor

Choose a reason for hiding this comment

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

This sentence seems a bit unclear to me. Maybe it would be clearer with something like: "If the column corresponding to this' index in other is not unique..."?

Comment on lines 302 to 303
- function: the function used for value aggregation. Values belonging
to each grouped are passed to this function in a vector.
Copy link
Contributor

Choose a reason for hiding this comment

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

This sentence doesn't make sense. Do you mean "belonging to each group"?

Comment on lines +359 to +364
mean : Text -> Column
mean name_suffix='_mean' =
vec_mean v = if v.length == 0 then Nothing else
(Vector.Vector v).reduce (+) / v.length
r = this.java_column.aggregate ['mean', name_suffix, vec_mean, True]
Column r
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably worth adding mode and median as fast operations alongside mean.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

One day :P


Arguments:
- show_rows: the number of initial rows that should be displayed.
print show_rows=10 = this.values.print show_rows
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing type signature.

Object _this, Object src, long source_index, Array that, long dest_index, long count) {
Builtins builtins = lookupContextReference(Language.class).get().getBuiltins();
throw new PanicException(
builtins.error().typeError().newInstance(builtins.mutable().array().newInstance(), src),
Copy link
Contributor

Choose a reason for hiding this comment

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

Use makeTypeError.

@kustosz kustosz merged commit b751dfb into main Jan 11, 2021
@kustosz kustosz deleted the wip/mk/group branch January 11, 2021 16:05
iamrecursion pushed a commit that referenced this pull request Jan 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p-highest Should be completed ASAP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants