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

always include sys signals #81

Merged
merged 3 commits into from
Jul 19, 2024
Merged

always include sys signals #81

merged 3 commits into from
Jul 19, 2024

Conversation

skshetry
Copy link
Member

@skshetry skshetry commented Jul 18, 2024

This PR

  • renames DatasetQuery.results() and DatasetQuery.to_records() to db_results()/to_db_records().
  • Always adds signals during select(...), and removes them on as_iterable.

TODO

  • cleanup

src/datachain/lib/dc.py Outdated Show resolved Hide resolved
src/datachain/lib/dc.py Outdated Show resolved Hide resolved
@skshetry skshetry marked this pull request as ready for review July 18, 2024 14:13
@skshetry skshetry requested a review from rlamy July 18, 2024 14:15
Copy link
Contributor

@rlamy rlamy left a comment

Choose a reason for hiding this comment

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

LGTM so far. I guess it makes sense to handle this only in DataChain but then we should try to remove all special handling for sys columns from DatasetQuery.

I don't like that _select() and select() are so similar - it would probably be better to add an undocumented flag, but feel free to clean-up however you like.

Copy link
Member

@dmpetrov dmpetrov left a comment

Choose a reason for hiding this comment

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

An question is inline. Please answer.

In general, that's very interesting idea but I need time to think a bit more about this. What i'm not sure about right now:

  1. id & rand are technical signals that are required for map and shuffle. I'm not sure we need to expose this to app level. it feels like it belongs to DB level.
  2. this approach requires downloading ID & RAND all the time. In some cases it triples amount of data to transfer. In DB level it can be easily optimized.
  3. An open question: can we make RAND optional? So, it's created only when user asks. It will require separate datasets and shuffled/randomized dataset.

src/datachain/lib/dc.py Outdated Show resolved Hide resolved
src/datachain/lib/dc.py Outdated Show resolved Hide resolved
@skshetry
Copy link
Member Author

  1. id & rand are technical signals that are required for map and shuffle. I'm not sure we need to expose this to app level. it feels like it belongs to DB level.

It might be hard to do in db level, due to subqueries. We won't always know if id and rand should be added to select() or not.

  1. An open question: can we make RAND optional? So, it's created only when user asks. It will require separate datasets and shuffled/randomized dataset.

chunking for UDFs also require rand.

@dmpetrov
Copy link
Member

We won't always know if id and rand should be added to select() or not.

We do know! It should be added in 100% of the cases 🙂

@skshetry skshetry dismissed dmpetrov’s stale review July 19, 2024 10:23

discussed privately

@skshetry skshetry merged commit dcc08c4 into iterative:main Jul 19, 2024
11 checks passed
@skshetry skshetry deleted the fix-sys branch July 19, 2024 10:28
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.

3 participants