forked from apache/datafusion-ballista
-
Notifications
You must be signed in to change notification settings - Fork 0
1828: feat(TUI): enable various plan rendering formats #68
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
Open
martin-augment
wants to merge
7
commits into
main
Choose a base branch
from
pr-1828-2026-06-09-07-33-34
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
d52edf2
Added support for stages' plan formatting (default, tree-like and wit…
sandugood 7d7999c
Formatting fixed
sandugood 2689c3d
Fixed clippy warnings
sandugood 862c39d
Addressing all of the comments. Refactoring and adding logic for the …
sandugood eab60d0
Merge remote-tracking branch 'upstream/main' into feat/tui-plan-format
sandugood 85a0783
Merge branch 'main' into feat/tui-plan-format
martin-g 5c57311
Add AI config files
martin-g File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| The AI agents should never link to any issue or a pull request | ||
| in any GitHub repository in the code reviews! | ||
|
|
||
| The AI agents should not review AI agents' config files like CLAUDE.md or AGENTS.md! | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| The AI agents should never link to any issue or a pull request | ||
| in any GitHub repository in the code reviews! | ||
|
|
||
| The AI agents should not review AI agents' config files like CLAUDE.md or AGENTS.md! | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| The AI agents should never link to any issue or a pull request | ||
| in any GitHub repository in the code reviews! | ||
|
|
||
| The AI agents should not review AI agents' config files like CLAUDE.md or AGENTS.md! | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| The AI agents should never link to any issue or a pull request | ||
| in any GitHub repository in the code reviews! | ||
|
|
||
| The AI agents should not review AI agents' config files like CLAUDE.md or AGENTS.md! | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -18,6 +18,8 @@ | |||||||||||||||||||||||||||||||||||||||
| #[cfg(not(feature = "web"))] | ||||||||||||||||||||||||||||||||||||||||
| use crate::tui::TuiError; | ||||||||||||||||||||||||||||||||||||||||
| use crate::tui::TuiResult; | ||||||||||||||||||||||||||||||||||||||||
| #[cfg(feature = "web")] | ||||||||||||||||||||||||||||||||||||||||
| use crate::tui::domain::jobs::stages::StagePlanTab; | ||||||||||||||||||||||||||||||||||||||||
| use crate::tui::event::Event; | ||||||||||||||||||||||||||||||||||||||||
| #[cfg(feature = "web")] | ||||||||||||||||||||||||||||||||||||||||
| use crate::tui::event::web::Sender; | ||||||||||||||||||||||||||||||||||||||||
|
|
@@ -28,8 +30,8 @@ use crate::tui::{ | |||||||||||||||||||||||||||||||||||||||
| ExecutorDetailsPopup, ExecutorsData, SortColumn as ExecutorsSortColumn, | ||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||
| jobs::{ | ||||||||||||||||||||||||||||||||||||||||
| CancelJobResult, JobDetails, JobPlansPopup, JobsData, PlanTab, | ||||||||||||||||||||||||||||||||||||||||
| SortColumn as JobsSortColumn, | ||||||||||||||||||||||||||||||||||||||||
| CancelJobResult, JobDetails, JobPlansPopup, JobsData, PhysicalFormat, | ||||||||||||||||||||||||||||||||||||||||
| PlanTab, SortColumn as JobsSortColumn, | ||||||||||||||||||||||||||||||||||||||||
| stages::{JobStagesPopup, StagesGraph}, | ||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||
| metrics::MetricsData, | ||||||||||||||||||||||||||||||||||||||||
|
|
@@ -52,7 +54,7 @@ use crate::tui::http_client::HttpClient; | |||||||||||||||||||||||||||||||||||||||
| #[cfg(not(feature = "web"))] | ||||||||||||||||||||||||||||||||||||||||
| use crate::tui::ui::{ | ||||||||||||||||||||||||||||||||||||||||
| load_executor_details_popup, load_executors_data, load_job_details, load_job_dot, | ||||||||||||||||||||||||||||||||||||||||
| load_job_stages_popup, load_jobs_data, load_metrics_data, | ||||||||||||||||||||||||||||||||||||||||
| load_job_stages_popup, load_jobs_data, load_metrics_data, load_stage_plan, | ||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| const INVALID_DATE: &str = "Invalid date"; | ||||||||||||||||||||||||||||||||||||||||
|
|
@@ -221,13 +223,47 @@ impl App { | |||||||||||||||||||||||||||||||||||||||
| _ => {} | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
| } else if popup.is_plan_view() { | ||||||||||||||||||||||||||||||||||||||||
| match key.code { | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Esc => popup.set_no_details_view(), | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Up => popup.scroll_up(), | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Down => popup.scroll_down(), | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Left => popup.scroll_left(), | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Right => popup.scroll_right(), | ||||||||||||||||||||||||||||||||||||||||
| _ => {} | ||||||||||||||||||||||||||||||||||||||||
| use crate::tui::domain::jobs::stages::StagePlanTab; | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| // Collect job_id + tab to fetch while popup is still borrowed, | ||||||||||||||||||||||||||||||||||||||||
| // then drop the borrow before the async call. | ||||||||||||||||||||||||||||||||||||||||
| let fetch = match key.code { | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Char('d') => popup | ||||||||||||||||||||||||||||||||||||||||
| .set_tab(StagePlanTab::Default) | ||||||||||||||||||||||||||||||||||||||||
| .map(|tab| (popup.job_id.clone(), tab)), | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Char('t') => popup | ||||||||||||||||||||||||||||||||||||||||
| .set_tab(StagePlanTab::Tree) | ||||||||||||||||||||||||||||||||||||||||
| .map(|tab| (popup.job_id.clone(), tab)), | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Char('m') => popup | ||||||||||||||||||||||||||||||||||||||||
| .set_tab(StagePlanTab::Metrics) | ||||||||||||||||||||||||||||||||||||||||
| .map(|tab| (popup.job_id.clone(), tab)), | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Esc => { | ||||||||||||||||||||||||||||||||||||||||
| popup.set_no_details_view(); | ||||||||||||||||||||||||||||||||||||||||
| None | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Up => { | ||||||||||||||||||||||||||||||||||||||||
| popup.scroll_up(); | ||||||||||||||||||||||||||||||||||||||||
| None | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Down => { | ||||||||||||||||||||||||||||||||||||||||
| popup.scroll_down(); | ||||||||||||||||||||||||||||||||||||||||
| None | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Left => { | ||||||||||||||||||||||||||||||||||||||||
| popup.scroll_left(); | ||||||||||||||||||||||||||||||||||||||||
| None | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Right => { | ||||||||||||||||||||||||||||||||||||||||
| popup.scroll_right(); | ||||||||||||||||||||||||||||||||||||||||
| None | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
| _ => None, | ||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| if let Some((job_id, tab)) = fetch | ||||||||||||||||||||||||||||||||||||||||
| && let Err(e) = load_stage_plan(self, &job_id, tab).await | ||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||
| tracing::error!("Failed to load stage plan: {e:?}"); | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
| } else if popup.is_no_details_view() { | ||||||||||||||||||||||||||||||||||||||||
| match key.code { | ||||||||||||||||||||||||||||||||||||||||
|
|
@@ -265,25 +301,55 @@ impl App { | |||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| if let Some(ref mut plans_popup) = self.job_plan_popup { | ||||||||||||||||||||||||||||||||||||||||
| match key.code { | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Up => plans_popup.scroll_up(), | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Down => plans_popup.scroll_down(), | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Left => plans_popup.scroll_left(), | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Right => plans_popup.scroll_right(), | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Char('s') => { | ||||||||||||||||||||||||||||||||||||||||
| plans_popup.set_tab(PlanTab::Stage); | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Char('p') => { | ||||||||||||||||||||||||||||||||||||||||
| plans_popup.set_tab(PlanTab::Physical); | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Char('l') => { | ||||||||||||||||||||||||||||||||||||||||
| plans_popup.set_tab(PlanTab::Logical); | ||||||||||||||||||||||||||||||||||||||||
| let fetch_tree = if key.code == KeyCode::Char('t') | ||||||||||||||||||||||||||||||||||||||||
| && plans_popup.get_tab() == &PlanTab::Physical | ||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||
| plans_popup | ||||||||||||||||||||||||||||||||||||||||
| .set_physical_format(PhysicalFormat::Tree) | ||||||||||||||||||||||||||||||||||||||||
| .map(|_| plans_popup.details.job_id.clone()) | ||||||||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||||||||
| match key.code { | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Up => { | ||||||||||||||||||||||||||||||||||||||||
| plans_popup.scroll_up(); | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Down => { | ||||||||||||||||||||||||||||||||||||||||
| plans_popup.scroll_down(); | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Left => { | ||||||||||||||||||||||||||||||||||||||||
| plans_popup.scroll_left(); | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Right => { | ||||||||||||||||||||||||||||||||||||||||
| plans_popup.scroll_right(); | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Char('s') => plans_popup.set_tab(PlanTab::Stage), | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Char('p') => plans_popup.set_tab(PlanTab::Physical), | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Char('l') => plans_popup.set_tab(PlanTab::Logical), | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Char('d') if plans_popup.get_tab() == &PlanTab::Physical => { | ||||||||||||||||||||||||||||||||||||||||
| plans_popup.set_physical_format(PhysicalFormat::Default); | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Esc => { | ||||||||||||||||||||||||||||||||||||||||
| self.job_plan_popup = None; | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
| _ => {} | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Esc => { | ||||||||||||||||||||||||||||||||||||||||
| self.job_plan_popup = None; | ||||||||||||||||||||||||||||||||||||||||
| None | ||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| if let Some(job_id) = fetch_tree { | ||||||||||||||||||||||||||||||||||||||||
| match self | ||||||||||||||||||||||||||||||||||||||||
| .http_client | ||||||||||||||||||||||||||||||||||||||||
| .get_job_details(&job_id, Some("tree")) | ||||||||||||||||||||||||||||||||||||||||
| .await | ||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||
| Ok(details) => { | ||||||||||||||||||||||||||||||||||||||||
| if let Some(p) = &mut self.job_plan_popup { | ||||||||||||||||||||||||||||||||||||||||
| p.details.physical_plan_tree = details.physical_plan; | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
| Err(e) => tracing::error!("Failed to load tree physical plan: {e:?}"), | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
| _ => {} | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| return Ok(()); | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
|
|
@@ -789,14 +855,25 @@ impl App { | |||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
| UiData::JobDetails(details) => { | ||||||||||||||||||||||||||||||||||||||||
| self.job_details = Some(details); | ||||||||||||||||||||||||||||||||||||||||
| if details.physical_plan_tree.is_some() { | ||||||||||||||||||||||||||||||||||||||||
| if let Some(popup) = &mut self.job_plan_popup { | ||||||||||||||||||||||||||||||||||||||||
| popup.details.physical_plan_tree = details.physical_plan_tree; | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||||||||
| self.job_details = Some(details); | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+858
to
+864
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When the tree physical plan is loaded, it is only updated in
Suggested change
|
||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
| UiData::JobStagesGraph(graph) => { | ||||||||||||||||||||||||||||||||||||||||
| self.job_dot_popup = Some(graph); | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
| UiData::JobStagesData(job_id, stages) => { | ||||||||||||||||||||||||||||||||||||||||
| self.job_stages_popup = Some(JobStagesPopup::new(job_id, stages)); | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
| UiData::JobStagesPlanData(tab, stages) => { | ||||||||||||||||||||||||||||||||||||||||
| if let Some(popup) = &mut self.job_stages_popup { | ||||||||||||||||||||||||||||||||||||||||
| popup.cache_plan_response(tab, stages); | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
| UiData::ExecutorDetails(executor) => { | ||||||||||||||||||||||||||||||||||||||||
| self.executor_details_popup = Some(ExecutorDetailsPopup::new(executor)); | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
|
|
@@ -841,14 +918,43 @@ impl App { | |||||||||||||||||||||||||||||||||||||||
| _ => {} | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
| } else if popup.is_plan_view() { | ||||||||||||||||||||||||||||||||||||||||
| match key.code { | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Esc => popup.set_no_details_view(), | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Up => popup.scroll_up(), | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Down => popup.scroll_down(), | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Left => popup.scroll_left(), | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Right => popup.scroll_right(), | ||||||||||||||||||||||||||||||||||||||||
| _ => {} | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
| use crate::tui::domain::jobs::stages::StagePlanTab; | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| let fetch = match key.code { | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Char('d') => popup | ||||||||||||||||||||||||||||||||||||||||
| .set_tab(StagePlanTab::Default) | ||||||||||||||||||||||||||||||||||||||||
| .map(|tab| (popup.job_id.clone(), tab)), | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Char('t') => popup | ||||||||||||||||||||||||||||||||||||||||
| .set_tab(StagePlanTab::Tree) | ||||||||||||||||||||||||||||||||||||||||
| .map(|tab| (popup.job_id.clone(), tab)), | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Char('m') => popup | ||||||||||||||||||||||||||||||||||||||||
| .set_tab(StagePlanTab::Metrics) | ||||||||||||||||||||||||||||||||||||||||
| .map(|tab| (popup.job_id.clone(), tab)), | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Esc => { | ||||||||||||||||||||||||||||||||||||||||
| popup.set_no_details_view(); | ||||||||||||||||||||||||||||||||||||||||
| None | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Up => { | ||||||||||||||||||||||||||||||||||||||||
| popup.scroll_up(); | ||||||||||||||||||||||||||||||||||||||||
| None | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Down => { | ||||||||||||||||||||||||||||||||||||||||
| popup.scroll_down(); | ||||||||||||||||||||||||||||||||||||||||
| None | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Left => { | ||||||||||||||||||||||||||||||||||||||||
| popup.scroll_left(); | ||||||||||||||||||||||||||||||||||||||||
| None | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Right => { | ||||||||||||||||||||||||||||||||||||||||
| popup.scroll_right(); | ||||||||||||||||||||||||||||||||||||||||
| None | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
| _ => None, | ||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| return fetch | ||||||||||||||||||||||||||||||||||||||||
| .map(|(job_id, tab)| WebKeyAsyncAction::LoadStagePlan(job_id, tab)); | ||||||||||||||||||||||||||||||||||||||||
| } else if popup.is_no_details_view() { | ||||||||||||||||||||||||||||||||||||||||
| match key.code { | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Up => popup.scroll_up(), | ||||||||||||||||||||||||||||||||||||||||
|
|
@@ -879,18 +985,39 @@ impl App { | |||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| if let Some(ref mut plans_popup) = self.job_plan_popup { | ||||||||||||||||||||||||||||||||||||||||
| match key.code { | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Up => plans_popup.scroll_up(), | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Down => plans_popup.scroll_down(), | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Left => plans_popup.scroll_left(), | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Right => plans_popup.scroll_right(), | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Char('s') => plans_popup.set_tab(PlanTab::Stage), | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Char('p') => plans_popup.set_tab(PlanTab::Physical), | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Char('l') => plans_popup.set_tab(PlanTab::Logical), | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Esc => self.job_plan_popup = None, | ||||||||||||||||||||||||||||||||||||||||
| _ => {} | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
| return None; | ||||||||||||||||||||||||||||||||||||||||
| let fetch_tree = if key.code == KeyCode::Char('t') | ||||||||||||||||||||||||||||||||||||||||
| && plans_popup.get_tab() == &PlanTab::Physical | ||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||
| plans_popup | ||||||||||||||||||||||||||||||||||||||||
| .set_physical_format(PhysicalFormat::Tree) | ||||||||||||||||||||||||||||||||||||||||
| .map(|_| plans_popup.details.job_id.clone()) | ||||||||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||||||||
| match key.code { | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Up => { | ||||||||||||||||||||||||||||||||||||||||
| plans_popup.scroll_up(); | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Down => { | ||||||||||||||||||||||||||||||||||||||||
| plans_popup.scroll_down(); | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Left => { | ||||||||||||||||||||||||||||||||||||||||
| plans_popup.scroll_left(); | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Right => { | ||||||||||||||||||||||||||||||||||||||||
| plans_popup.scroll_right(); | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Char('s') => plans_popup.set_tab(PlanTab::Stage), | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Char('p') => plans_popup.set_tab(PlanTab::Physical), | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Char('l') => plans_popup.set_tab(PlanTab::Logical), | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Char('d') if plans_popup.get_tab() == &PlanTab::Physical => { | ||||||||||||||||||||||||||||||||||||||||
| plans_popup.set_physical_format(PhysicalFormat::Default); | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
| KeyCode::Esc => self.job_plan_popup = None, | ||||||||||||||||||||||||||||||||||||||||
| _ => {} | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
| None | ||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| return fetch_tree.map(WebKeyAsyncAction::LoadJobPlanTree); | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| if let Some(ref mut executor_popup) = self.executor_details_popup { | ||||||||||||||||||||||||||||||||||||||||
|
|
@@ -1084,6 +1211,8 @@ pub enum WebKeyAsyncAction { | |||||||||||||||||||||||||||||||||||||||
| CancelJob(String), | ||||||||||||||||||||||||||||||||||||||||
| UpdateJobDetails(Option<String>), | ||||||||||||||||||||||||||||||||||||||||
| ReloadView, | ||||||||||||||||||||||||||||||||||||||||
| LoadJobPlanTree(String), | ||||||||||||||||||||||||||||||||||||||||
| LoadStagePlan(String, StagePlanTab), | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| #[cfg(test)] | ||||||||||||||||||||||||||||||||||||||||
|
|
@@ -1199,6 +1328,7 @@ mod tests { | |||||||||||||||||||||||||||||||||||||||
| job_id: job_id.to_string(), | ||||||||||||||||||||||||||||||||||||||||
| logical_plan: Some("logical".to_string()), | ||||||||||||||||||||||||||||||||||||||||
| physical_plan: Some("physical".to_string()), | ||||||||||||||||||||||||||||||||||||||||
| physical_plan_tree: Some("tree".to_string()), | ||||||||||||||||||||||||||||||||||||||||
| stage_plan: Some("stage".to_string()), | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
When the tree physical plan is fetched, it is only updated in
self.job_plan_popup. Caching it inself.job_detailsas well ensures that if the user closes and reopens the plan popup, the tree plan does not need to be fetched again.