-
Notifications
You must be signed in to change notification settings - Fork 5.5k
fix: Live plan not showing and output data size is undefined #26033
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
Conversation
Reviewer's GuideThis PR refactors UI components to use the new byte-based data size properties and proper formatting, ensures the LivePlan visualization always updates, and addresses React warning in the query header tabs. Class diagram for updated data size properties in Operator and Stage statisticsclassDiagram
class Operator {
+inputDataSizeInBytes
+outputDataSizeInBytes
+inputPositions
+outputPositions
+Other attributes
}
class StageStatistics {
+bufferedDataSizeInBytes
+userMemoryReservationInBytes
+rawInputDataSizeInBytes
+outputDataSizeInBytes
+Other attributes
}
Operator --> StageStatistics: used in statistics display
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Hey there - I've reviewed your changes - here's some feedback:
- Consider formatting the raw byte count (outputDataSizeInBytes) into a human-readable string (KB/MB/GB) rather than displaying the raw number to match the rest of the UI.
- Instead of unconditionally calling updateD3Graph in componentDidUpdate, add a guard to only run it when the underlying plan data actually changes to avoid unnecessary graph re-renders.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider formatting the raw byte count (outputDataSizeInBytes) into a human-readable string (KB/MB/GB) rather than displaying the raw number to match the rest of the UI.
- Instead of unconditionally calling updateD3Graph in componentDidUpdate, add a guard to only run it when the underlying plan data actually changes to avoid unnecessary graph re-renders.
## Individual Comments
### Comment 1
<location> `presto-ui/src/components/LivePlan.jsx:253` </location>
<code_context>
style: "stroke-width: 4px",
arrowheadClass: "plan-arrowhead",
- label: sourceStats.outputDataSize + " / " + formatRows(sourceStats.outputPositions),
+ label: sourceStats.outputDataSizeInBytes + " bytes / " + formatRows(sourceStats.outputPositions),
labelStyle: "color: #fff; font-weight: bold; font-size: 24px;",
labelType: "html",
</code_context>
<issue_to_address>
Consider using a human-readable format for byte size display.
Formatting the byte size as KB, MB, or GB will make the label easier for users to interpret.
Suggested implementation:
```javascript
label: formatBytes(sourceStats.outputDataSizeInBytes) + " / " + formatRows(sourceStats.outputPositions),
```
```javascript
}
// Utility function to format bytes as human-readable string
function formatBytes(bytes) {
if (bytes === 0) return '0 Bytes';
const k = 1024;
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB'];
const i = Math.floor(Math.log(bytes) / Math.log(k));
return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];
}
```
</issue_to_address>
### Comment 2
<location> `presto-ui/src/components/QueryHeader.jsx:118` </location>
<code_context>
<div className="col-6 d-flex justify-content-end">
<nav className="nav nav-tabs">
{tabs.map((page, _) => (
- <>
+ <React.Fragment key={page.label}>
<a className={clsx('nav-link', 'navbar-btn', this.isActive(page.path) && 'active')} href={page.path + '?' + queryId} >{page.label}</a>
</code_context>
<issue_to_address>
Using page.label as a key may cause issues if labels are not unique.
Using non-unique keys can lead to React rendering problems. Please use a unique value like page.path for the key.
</issue_to_address>
<suggested_fix>
<<<<<<< SEARCH
<React.Fragment key={page.label}>
=======
<React.Fragment key={page.path}>
>>>>>>> REPLACE
</suggested_fix>
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
ad58d76
to
fc6432a
Compare
Another reason to work on #25744, it would have caught this problem. |
style: "stroke-width: 4px", | ||
arrowheadClass: "plan-arrowhead", | ||
label: sourceStats.outputDataSize + " / " + formatRows(sourceStats.outputPositions), | ||
label: sourceStats.outputDataSizeInBytes + " / " + formatRows(sourceStats.outputPositions), |
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.
will this be less user friendly/readable then previously (e.g. would it previously show 10GB, and now will show 10000000000 bytes)? Can we convert it back to something that will be readable? Same comment for the rest of the usages
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.
utils.formatDataSizeBytes()
could be used here to improve the readability
Also,
|
Just found there are many other issues about the |
d58e73e
to
32ee924
Compare
@rschlussel here are the screenshots |
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.
@unidevel imported this issue as lakehouse/presto #26033 |
style: "stroke-width: 4px", | ||
arrowheadClass: "plan-arrowhead", | ||
label: sourceStats.outputDataSize + " / " + formatRows(sourceStats.outputPositions), | ||
label: sourceStats.outputDataSizeInBytes + " / " + formatRows(sourceStats.outputPositions), |
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.
do we need to format this part too? just curious
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.
this should match to the LivePlan
in LivePlan.jsx
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.
Thanks @yhwang , fixed
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.
thanks for the fix!
LGTM
Hi @rschlussel
I think this would be a working item for the UI. We should trace this in another issue and new PR to address it. Are you okay with the this? |
The lack of tests are certainly something we should address, but it's a pre-existing issue. This makes the UI usable again, so we should merge this. |
@unidevel we should also make sure this lands in |
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.
Thanks for fixing this!
@tdcmeehan I added the PR for 0.295 release and did a quick test with this new PR, it looks fine in my local env. => #26264 |
## Description 1. Fix live plan not showing <img width="2448" height="1730" alt="image" src="https://github.com/user-attachments/assets/25698228-0d62-4326-b0c7-41c1ed3af579" /> 2. Fix warnings in Query Header 3. Fix output data size is `undefined` - due to [this change](7458b52) , `outputDataSize` is changed to `outputDataSizeInBytes` ## Motivation and Context PR for master branch: #26033 ## Impact UI ## Test Plan Manual test ## Contributor checklist - [ ] Please make sure your submission complies with our [contributing guide](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md), in particular [code style](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md#code-style) and [commit standards](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md#commit-standards). - [ ] PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced. - [ ] Documented new properties (with its default value), SQL syntax, functions, or other functionality. - [ ] If release notes are required, they follow the [release notes guidelines](https://github.com/prestodb/presto/wiki/Release-Notes-Guidelines). - [ ] Adequate tests were added if applicable. - [ ] CI passed. ## Release Notes ``` == NO RELEASE NOTE == ``` --------- Co-authored-by: Timothy Meehan <tim@timdmeehan.com>
Description
Fix warnings in Query Header
Fix output data size is
undefined
- due to this change ,outputDataSize
is changed tooutputDataSizeInBytes
Motivation and Context
Impact
UI
Test Plan
Manual test
Contributor checklist
Release Notes