Skip to content

Commit

Permalink
[MINOR][SQL] Fix minor formatting issue of SortAggregateExec.toString
Browse files Browse the repository at this point in the history
## What changes were proposed in this pull request?

This PR fixes a minor formatting issue (missing space after comma) of `SorgAggregateExec.toString`.

Before:

```
SortAggregate(key=[a#76,b#77], functions=[max(c#78),min(c#78)], output=[a#76,b#77,max(c)apache#89,min(c)apache#90])
+- *Sort [a#76 ASC, b#77 ASC], false, 0
   +- Exchange hashpartitioning(a#76, b#77, 200)
      +- SortAggregate(key=[a#76,b#77], functions=[partial_max(c#78),partial_min(c#78)], output=[a#76,b#77,max#99,min#100])
         +- *Sort [a#76 ASC, b#77 ASC], false, 0
            +- LocalTableScan <empty>, [a#76, b#77, c#78]
```

After:

```
SortAggregate(key=[a#76, b#77], functions=[max(c#78), min(c#78)], output=[a#76, b#77, max(c)apache#89, min(c)apache#90])
+- *Sort [a#76 ASC, b#77 ASC], false, 0
   +- Exchange hashpartitioning(a#76, b#77, 200)
      +- SortAggregate(key=[a#76, b#77], functions=[partial_max(c#78), partial_min(c#78)], output=[a#76, b#77, max#99, min#100])
         +- *Sort [a#76 ASC, b#77 ASC], false, 0
            +- LocalTableScan <empty>, [a#76, b#77, c#78]
```

## How was this patch tested?

Manually tested.

Author: Cheng Lian <lian@databricks.com>

Closes apache#14480 from liancheng/fix-sort-based-agg-string-format.
  • Loading branch information
liancheng committed Aug 4, 2016
1 parent 583d91a commit 780c722
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ case class SortAggregateExec(
private def toString(verbose: Boolean): String = {
val allAggregateExpressions = aggregateExpressions

val keyString = Utils.truncatedString(groupingExpressions, "[", ",", "]")
val functionString = Utils.truncatedString(allAggregateExpressions, "[", ",", "]")
val outputString = Utils.truncatedString(output, "[", ",", "]")
val keyString = Utils.truncatedString(groupingExpressions, "[", ", ", "]")
val functionString = Utils.truncatedString(allAggregateExpressions, "[", ", ", "]")
val outputString = Utils.truncatedString(output, "[", ", ", "]")
if (verbose) {
s"SortAggregate(key=$keyString, functions=$functionString, output=$outputString)"
} else {
Expand Down

0 comments on commit 780c722

Please sign in to comment.