hive icon indicating copy to clipboard operation
hive copied to clipboard

HIVE-29362: New configuration to display EXPLAIN FORMATTED in human-readable format

Open zabetak opened this issue 3 months ago • 1 comments

What changes were proposed in this pull request?

  1. Add new property to control indentation of EXPLAIN FORMATTED result
  2. Create the appropriate JsonParser in ExplainTask based on explain configurations
  3. Drop now unused and redundant JsonParserFactory
  4. Extract logic for augmenting RS outputs in separate method dedicated for this purpose

Why are the changes needed?

  1. Improve readability of EXPLAIN FORMATTED result in qtest
  2. Avoid unnecessary masking in q.out files
  3. Speed-up processing of files by QOutProcessor (shorter lines -> more efficient pattern matching)
  4. Better git utilization (history, log, blame, merge, rebase, etc.)

Does this PR introduce any user-facing change?

No, unless they change the value of hive.explain.formatted.indent property.

How was this patch tested?

mvn test -Dtest=TestMiniLlapLocalCliDriver -Dqfile=plan_json.q,excluded_rule_explain.q,materialized_view_rebuild_2.q,ctas.q,input4.q,join0.q,vector_outer_join5.q,vector_outer_join4.q,materialized_view_create.q,explain_ast.q,explain_locks.q,cte_cbo_plan_json.q,authorization_explain.q,concat_op.q,vector_outer_join3.q,tez_union.q,parallel_join0.q,vector_outer_join6.q,explain_dependency.q,explain_dependency2.q,explaindenpendencydiffengs.q
mvn test -Dtest=TestIcebergCliDriver -Dqfile=iceberg_explain_formatted.q

zabetak avatar Dec 09 '25 12:12 zabetak

@soumyakanti3578 You are absolutely right that there should be a test case using set hive.explain.formatted.indent=false. I added one in https://github.com/apache/hive/pull/6230/commits/73e95d17ce3e97a582e35d3339dd4e46a27bc0e6

zabetak avatar Dec 16 '25 15:12 zabetak