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

feat: log the execution plan in a more compact fashion #2906

Merged

Conversation

westonpace
Copy link
Contributor

Currently we log the debug representation of the plan (twice!) every time a plan is executed. This is way too much information (e.g. the object store's debug information is repeated many times). In one egregious case I was dealing with that had 8k fragments this was generating 35MB of log data!

This PR changes to an indented display representation of the plan.

@github-actions github-actions bot added the enhancement New feature or request label Sep 18, 2024
@westonpace
Copy link
Contributor Author

Example output:

[2024-09-18T13:41:35Z DEBUG lance_file::v2::writer] write_batch called with 80096 bytes of data
[2024-09-18T13:41:35Z DEBUG lance_datafusion::exec] Executing plan:
    ProjectionExec: expr=[x@0 as x]
      FilterExec: x@0 = 7
        LanceScan: uri=tmp/foo.lance/data, projection=[x], row_id=true, row_addr=false, ordered=true
    
[2024-09-18T13:41:35Z DEBUG lance::io::exec::scan] Given io_parallelism=8 and num_columns=1 we will read 16 fragments at once while scanning v2 dataset

One potential concern here is that we are generating more than one line of info. This is much more human readable but could potentially upset simple log parsers that assume each newline is a new line of log info.

However, I think more sophisticated log parsers will be able to detect the newline + timestamp pattern as the start of a line.

But I'd be open to changing it to one line if anyone felt strongly.

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 77.96%. Comparing base (73599c5) to head (1ce57dc).

Files with missing lines Patch % Lines
rust/lance-datafusion/src/exec.rs 33.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2906      +/-   ##
==========================================
+ Coverage   77.93%   77.96%   +0.03%     
==========================================
  Files         231      231              
  Lines       70641    70643       +2     
  Branches    70641    70643       +2     
==========================================
+ Hits        55051    55074      +23     
+ Misses      12439    12437       -2     
+ Partials     3151     3132      -19     
Flag Coverage Δ
unittests 77.96% <33.33%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@westonpace westonpace merged commit 9c361fe into lancedb:main Sep 18, 2024
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants