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

refactor: allow InMemory to take in non python based entries #3554

Merged
merged 19 commits into from
Dec 18, 2024

Conversation

universalmind303
Copy link
Contributor

No description provided.

Copy link

codspeed-hq bot commented Dec 12, 2024

CodSpeed Performance Report

Merging #3554 will degrade performances by 25.51%

Comparing universalmind303:refactor-lp-3 (84e96eb) with main (07752b8)

Summary

❌ 2 regressions
✅ 25 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark main universalmind303:refactor-lp-3 Change
test_count[1 Small File] 3.4 ms 3.9 ms -11.79%
test_iter_rows_first_row[100 Small Files] 159.5 ms 214.2 ms -25.51%

@universalmind303 universalmind303 marked this pull request as ready for review December 12, 2024 17:37
Copy link

codecov bot commented Dec 12, 2024

Codecov Report

Attention: Patch coverage is 75.58685% with 104 lines in your changes missing coverage. Please review.

Project coverage is 77.93%. Comparing base (07752b8) to head (84e96eb).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/common/partitioning/src/lib.rs 18.36% 40 Missing ⚠️
src/daft-micropartition/src/partitioning.rs 67.64% 33 Missing ⚠️
src/daft-connect/src/translation/logical_plan.rs 78.57% 12 Missing ⚠️
...daft-connect/src/translation/logical_plan/range.rs 77.77% 8 Missing ⚠️
...-connect/src/translation/logical_plan/aggregate.rs 91.42% 3 Missing ⚠️
.../daft-connect/src/translation/logical_plan/drop.rs 91.66% 2 Missing ⚠️
...aft-connect/src/translation/logical_plan/filter.rs 80.00% 2 Missing ⚠️
...ft-connect/src/translation/logical_plan/project.rs 88.88% 1 Missing ⚠️
...daft-connect/src/translation/logical_plan/to_df.rs 94.11% 1 Missing ⚠️
...nnect/src/translation/logical_plan/with_columns.rs 95.00% 1 Missing ⚠️
... and 1 more
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3554      +/-   ##
==========================================
+ Coverage   77.86%   77.93%   +0.06%     
==========================================
  Files         719      720       +1     
  Lines       88459    88478      +19     
==========================================
+ Hits        68877    68953      +76     
+ Misses      19582    19525      -57     
Files with missing lines Coverage Δ
src/daft-connect/src/lib.rs 62.88% <ø> (ø)
src/daft-connect/src/op/execute/root.rs 96.00% <100.00%> (+0.34%) ⬆️
src/daft-connect/src/op/execute/write.rs 78.04% <100.00%> (-0.27%) ⬇️
src/daft-connect/src/session.rs 100.00% <100.00%> (ø)
src/daft-connect/src/translation/datatype/codec.rs 47.02% <100.00%> (-0.32%) ⬇️
...ect/src/translation/logical_plan/local_relation.rs 91.42% <100.00%> (+29.76%) ⬆️
.../daft-connect/src/translation/logical_plan/read.rs 73.68% <100.00%> (ø)
src/daft-connect/src/translation/schema.rs 100.00% <ø> (ø)
src/daft-local-execution/src/pipeline.rs 88.78% <100.00%> (+0.08%) ⬆️
src/daft-local-execution/src/run.rs 89.69% <100.00%> (+0.16%) ⬆️
... and 17 more

... and 3 files with indirect coverage changes

Copy link
Contributor

@andrewgazelka andrewgazelka left a comment

Choose a reason for hiding this comment

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

im a little confused in some areas. I think some docs could help

};

/// Common trait interface for dataset partitioning, defined in this shared crate to avoid circular dependencies.
/// Acts as a forward reference for concrete partition implementations. _(Specifically the `MicroPartition` type defined in `daft-micropartition`)_
Copy link
Contributor

Choose a reason for hiding this comment

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

still a little bit confused why this is a trait instead of us just being able to use MicroPartition directly. Maybe explain this more? Or are we expecting to expand more. add to docs maybe

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's pretty much the equivalent of a forward declaration. In daft-logical-plan, we don't have a concept of MicroPartition yet, and we generally dont want to because 'daft-micropartition' is a pretty heavy crate that we don't want part of the logical plan. We did a similar pattern with Expr::Subquery

src/common/partitioning/src/lib.rs Outdated Show resolved Hide resolved
src/common/partitioning/src/lib.rs Outdated Show resolved Hide resolved
src/common/partitioning/src/lib.rs Show resolved Hide resolved
src/daft-local-execution/src/pipeline.rs Outdated Show resolved Hide resolved
src/common/partitioning/src/lib.rs Outdated Show resolved Hide resolved
@@ -10,6 +11,9 @@ pub struct Session {

id: String,
server_side_session_id: String,
/// MicroPartitionSet associated with this session
/// this will be filled up as the user runs queries
pub(crate) pset: Arc<MicroPartitionSet>,
Copy link
Member

Choose a reason for hiding this comment

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

iiuc MicroPartitionSet should only represent the result set of a single query. Should we have a Map of HashMap<key, MicroPartitionSetRef> instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

so i could be abusing the MicroPartitionSet, but since MicroPartitionSet is already a batch of partitions pub partitions: DashMap<PartitionId, Vec<Arc<MicroPartition>>>,, it seemed redundant to have essentially HashMap<String, HashMap<String, Vec<MicroPartition>> this is what I was actually doing at first, but found there was currently no need for the outer hashmap. We'll likely need to refactor once we support distributed, but we're still a way away from that for spark.

Copy link
Contributor

Choose a reason for hiding this comment

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

so is it usually

GlobalHashMap<String, LocalHashMap<String, ...>> in a distributed setting?

Copy link
Contributor

@andrewgazelka andrewgazelka left a comment

Choose a reason for hiding this comment

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

I want to get this in as soon as possible even if it is not perfect because a lot of my work depends on this.

@andrewgazelka
Copy link
Contributor

andrewgazelka commented Dec 18, 2024

will be glad to help fix things in future in smaller PRs if there are any issues we run into

@universalmind303 universalmind303 merged commit 6602502 into Eventual-Inc:main Dec 18, 2024
39 of 41 checks passed
@universalmind303 universalmind303 deleted the refactor-lp-3 branch January 23, 2025 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants