Yida Wu has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/24283 )
Change subject: IMPALA-14962: Query Profile Parser Interface ...................................................................... IMPALA-14962: Query Profile Parser Interface This interface exposes stable, JSON-returning tool methods over query profiles so AI-driven analysis can request focused sections like summary, fragments, nodes, and resource estimates instead of parsing raw profile text (avoids exceeding LLM context window limits). Implementation introduces a parser/accessor layer that normalizes profile JSON into query-scoped structures, dispatches named tool calls (get_summary, get_fragment, get_node, etc.), supports argument parsing/validation, and returns consistent JSON outputs suitable for LLM tool-calling. Tests added: query-profile-parsing-tools-test.cc with golden-file validation for all supported tool methods, plus negative-path coverage for rejecting non-JSON profile input. Code Generated-by: Cursor AI Change-Id: I4d9c9e735aa089bb243b07af421553002a465a88 Reviewed-on: http://gerrit.cloudera.org:8080/24283 Reviewed-by: Jason Fehr <[email protected]> Tested-by: Impala Public Jenkins <[email protected]> Reviewed-by: Yida Wu <[email protected]> --- M be/src/service/CMakeLists.txt A be/src/service/query-profile-parsing-tools-test.cc A be/src/service/query-profile-parsing-tools.cc A be/src/service/query-profile-parsing-tools.h M be/src/service/query-profile-redaction.cc A be/src/service/query-profile-size-limit-util.h M be/src/util/json-util.cc M be/src/util/json-util.h M be/src/util/string-util.cc M be/src/util/string-util.h A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_mt_dop_0_profile/get_all_fragments_F00.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_mt_dop_0_profile/get_all_plan_nodes_HDFS_SCAN_NODE_F00.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_mt_dop_0_profile/get_analyzed_query.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_mt_dop_0_profile/get_average_plan_node_HDFS_SCAN_NODE.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_mt_dop_0_profile/get_compilation.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_mt_dop_0_profile/get_execution_profile.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_mt_dop_0_profile/get_fragment_F00.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_mt_dop_0_profile/get_fragment_instances_F00.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_mt_dop_0_profile/get_fragments_overview.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_mt_dop_0_profile/get_node_HDFS_SCAN_NODE_F00.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_mt_dop_0_profile/get_per_node_profiles.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_mt_dop_0_profile/get_query_options.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_mt_dop_0_profile/get_resource_estimates.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_mt_dop_0_profile/get_scan_nodes_summary.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_mt_dop_0_profile/get_specific_plan_node_HDFS_SCAN_NODE_F00_instance_00000001.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_mt_dop_0_profile/get_summary.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_mt_dop_0_profile/get_tables_queried.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_mt_dop_0_profile/get_timeline.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_mt_dop_12_profile/get_all_fragments_F00.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_mt_dop_12_profile/get_all_plan_nodes_HDFS_SCAN_NODE_F00.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_mt_dop_12_profile/get_analyzed_query.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_mt_dop_12_profile/get_average_plan_node_HDFS_SCAN_NODE.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_mt_dop_12_profile/get_compilation.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_mt_dop_12_profile/get_execution_profile.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_mt_dop_12_profile/get_fragment_F00.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_mt_dop_12_profile/get_fragment_instances_F00.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_mt_dop_12_profile/get_fragments_overview.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_mt_dop_12_profile/get_node_HDFS_SCAN_NODE_F00.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_mt_dop_12_profile/get_per_node_profiles.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_mt_dop_12_profile/get_query_options.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_mt_dop_12_profile/get_resource_estimates.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_mt_dop_12_profile/get_scan_nodes_summary.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_mt_dop_12_profile/get_specific_plan_node_HDFS_SCAN_NODE_F00_instance_00000000.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_mt_dop_12_profile/get_specific_plan_node_HDFS_SCAN_NODE_F00_instance_00000001.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_mt_dop_12_profile/get_summary.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_mt_dop_12_profile/get_tables_queried.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_mt_dop_12_profile/get_timeline.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_num_nodes_0_profile/get_all_fragments_F00.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_num_nodes_0_profile/get_all_plan_nodes_HDFS_SCAN_NODE_F00.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_num_nodes_0_profile/get_analyzed_query.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_num_nodes_0_profile/get_average_plan_node_HDFS_SCAN_NODE.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_num_nodes_0_profile/get_compilation.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_num_nodes_0_profile/get_execution_profile.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_num_nodes_0_profile/get_fragment_F00.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_num_nodes_0_profile/get_fragment_instances_F00.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_num_nodes_0_profile/get_fragments_overview.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_num_nodes_0_profile/get_node_HDFS_SCAN_NODE_F00.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_num_nodes_0_profile/get_per_node_profiles.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_num_nodes_0_profile/get_query_options.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_num_nodes_0_profile/get_resource_estimates.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_num_nodes_0_profile/get_scan_nodes_summary.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_num_nodes_0_profile/get_specific_plan_node_HDFS_SCAN_NODE_F00_instance_00000000.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_num_nodes_0_profile/get_summary.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_num_nodes_0_profile/get_tables_queried.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_1_local_run_num_nodes_0_profile/get_timeline.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_72_local_run_profile/get_all_fragments_F00.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_72_local_run_profile/get_all_plan_nodes_HDFS_SCAN_NODE_F00.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_72_local_run_profile/get_analyzed_query.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_72_local_run_profile/get_average_plan_node_HDFS_SCAN_NODE.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_72_local_run_profile/get_compilation.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_72_local_run_profile/get_execution_profile.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_72_local_run_profile/get_fragment_F00.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_72_local_run_profile/get_fragment_instances_F00.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_72_local_run_profile/get_fragments_overview.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_72_local_run_profile/get_node_HDFS_SCAN_NODE_F00.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_72_local_run_profile/get_per_node_profiles.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_72_local_run_profile/get_query_options.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_72_local_run_profile/get_resource_estimates.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_72_local_run_profile/get_scan_nodes_summary.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_72_local_run_profile/get_specific_plan_node_HDFS_SCAN_NODE_F00_instance_00000001.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_72_local_run_profile/get_summary.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_72_local_run_profile/get_tables_queried.json A testdata/impala-profiles/query-profile-parsing-tools-expected/tpcds_72_local_run_profile/get_timeline.json A testdata/impala-profiles/tpcds_1_local_run_mt_dop_0_profile.json A testdata/impala-profiles/tpcds_1_local_run_mt_dop_12_profile.json A testdata/impala-profiles/tpcds_1_local_run_num_nodes_0_profile.json 86 files changed, 251,757 insertions(+), 19 deletions(-) Approvals: Jason Fehr: Looks good to me, but someone else must approve Impala Public Jenkins: Verified Yida Wu: Looks good to me, approved -- To view, visit http://gerrit.cloudera.org:8080/24283 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I4d9c9e735aa089bb243b07af421553002a465a88 Gerrit-Change-Number: 24283 Gerrit-PatchSet: 19 Gerrit-Owner: Gokul Kolady <[email protected]> Gerrit-Reviewer: Abhishek Rawat <[email protected]> Gerrit-Reviewer: Gokul Kolady <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Jason Fehr <[email protected]> Gerrit-Reviewer: Yida Wu <[email protected]>
