Skip to content

Commit

Permalink
[VL] Fix aggregation dumpped as json string (apache#3969)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rong Ma authored and kecookier committed May 16, 2024
1 parent d11d5fc commit ab60f8b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
9 changes: 7 additions & 2 deletions docs/developers/MicroBenchmarks.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"]}}]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit ab60f8b

Please sign in to comment.