diff --git a/docs/developers/MicroBenchmarks.md b/docs/developers/MicroBenchmarks.md index 81ebf9d2438b..6826feae6a43 100644 --- a/docs/developers/MicroBenchmarks.md +++ b/docs/developers/MicroBenchmarks.md @@ -101,9 +101,14 @@ cd /path_to_gluten/ ./dev/buildbundle-veloxbe.sh --build_tests=ON --build_benchmarks=ON --build_type=RelWithDebInfo ``` -Run the query by spark-shell. Get the Substrait plan from executor's stdout. +Run the query by spark-shell. Be sure to add below configurations to get the Substrait plan from executor's stdout. -Example: +``` +--conf spark.gluten.sql.debug=true +--conf spark.gluten.sql.columnar.backend.velox.glogSeverityLevel=0 +``` + +Example output: ```shell ################################################## received substrait::Plan: Task stageId: 2, partitionId: 855, taskId: 857; {"extensions":[{"extensionFunction":{"name":"sum:req_i32"}}],"relations":[{"root":{"input":{"fetch":{"common":{"direct":{}},"input":{"project":{"common":{"direct":{}},"input":{"aggregate":{"common":{"direct":{}},"input":{"read":{"common":{"direct":{}},"baseSchema":{"names":["i_product_name#15","i_brand#16","spark_grouping_id#14","sum#22"],"struct":{"types":[{"string":{"nullability":"NULLABILITY_NULLABLE"}},{"string":{"nullability":"NULLABILITY_NULLABLE"}},{"i64":{"nullability":"NULLABILITY_REQUIRED"}},{"i64":{"nullability":"NULLABILITY_NULLABLE"}}]}},"localFiles":{"items":[{"uriFile":"iterator:0"}]}}},"groupings":[{"groupingExpressions":[{"selection":{"directReference":{"structField":{}}}},{"selection":{"directReference":{"structField":{"field":1}}}},{"selection":{"directReference":{"structField":{"field":2}}}}]}],"measures":[{"measure":{"phase":"AGGREGATION_PHASE_INTERMEDIATE_TO_RESULT","outputType":{"i64":{"nullability":"NULLABILITY_NULLABLE"}},"arguments":[{"value":{"selection":{"directReference":{"structField":{"field":3}}}}}]}}]}},"expressions":[{"selection":{"directReference":{"structField":{"field":3}}}}]}},"count":"100"}},"names":["qoh#10"]}}]} diff --git a/gluten-core/src/main/scala/io/glutenproject/execution/HashAggregateExecBaseTransformer.scala b/gluten-core/src/main/scala/io/glutenproject/execution/HashAggregateExecBaseTransformer.scala index d0391bba4bbe..d153a46789fa 100644 --- a/gluten-core/src/main/scala/io/glutenproject/execution/HashAggregateExecBaseTransformer.scala +++ b/gluten-core/src/main/scala/io/glutenproject/execution/HashAggregateExecBaseTransformer.scala @@ -588,7 +588,8 @@ abstract class HashAggregateExecBaseTransformer( "0" } val optimization = - Any.pack(StringValue.newBuilder.setValue(s"isStreaming=$isStreaming\n").build) + BackendsApiManager.getTransformerApiInstance.getPackMessage( + StringValue.newBuilder.setValue(s"isStreaming=$isStreaming\n").build) ExtensionBuilder.makeAdvancedExtension(optimization, enhancement) }