-
Notifications
You must be signed in to change notification settings - Fork 317
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
Add simple parts of Table.take and Table.drop functions to Database table #7615
Conversation
test/Table_Tests/src/Common_Table_Operations/Take_Drop_Spec.enso
Outdated
Show resolved
Hide resolved
distribution/lib/Standard/Database/0.0.0-dev/src/Data/Table.enso
Outdated
Show resolved
Hide resolved
distribution/lib/Standard/Database/0.0.0-dev/src/Data/Table.enso
Outdated
Show resolved
Hide resolved
distribution/lib/Standard/Database/0.0.0-dev/src/Data/Column.enso
Outdated
Show resolved
Hide resolved
distribution/lib/Standard/Database/0.0.0-dev/src/Data/Table.enso
Outdated
Show resolved
Hide resolved
distribution/lib/Standard/Database/0.0.0-dev/src/Data/Take_Drop_Helpers.enso
Outdated
Show resolved
Hide resolved
distribution/lib/Standard/Database/0.0.0-dev/src/Data/Take_Drop_Helpers.enso
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The overall structure looks good to me.
However I was very surprised to see union
used as part of the implementation. IMO it is too heavy and creates too complex queries (essentially the whole subquery which itself can be complex will be duplicated for each sub range, that can grow the SQL by large).
I'd suggest to use OR
conditions in the filter instead - then we still keep a single subquery for this.
Also, please add the test for consecutive dropping/taking of elements, i.e.:
t.take 5 . take 3
t.take 3 . take 5
t.drop 3 . drop 2
t.drop 2 . drop 3
I know with the current implementation it should work, but I'd like to make sure and ensure we don't regress this when implementing any optimizations in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks all good.
If possible, I'd like to change the ordering of sort
operation in the newly added tests.
Please also try adding an 'integration' test where we try to
I imagine the actual result may be non deterministic, we should just check if it is "sane" - e.g. the |
Aggregate test added. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of minor tweaks.
Otherwise LGTM 👍
distribution/lib/Standard/Database/0.0.0-dev/src/Data/Table.enso
Outdated
Show resolved
Hide resolved
distribution/lib/Standard/Database/0.0.0-dev/src/Data/Take_Drop_Helpers.enso
Outdated
Show resolved
Hide resolved
…p_Helpers.enso Co-authored-by: James Dunkerley <jdunkerley@users.noreply.github.com>
Co-authored-by: James Dunkerley <jdunkerley@users.noreply.github.com>
Pull Request Description
Implements database Table and Column take/drop, except While and Sample.
Additional features and optimizations are in #7614.
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.
./run ide build
.