Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ private String functionToStringForAvgRate(
.getSeconds();

return String.format(
"SUM(%s / %s)", columnName, (double) aggregateIntervalInSeconds / rateIntervalInSeconds);
"SUM(%s) / %s", columnName, (double) aggregateIntervalInSeconds / rateIntervalInSeconds);
}

private String convertCount() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,7 @@ public void testQueryWithAverageRateInOrderBy() {
+ "' "
+ "and ( start_time_millis >= 1637297304041 and start_time_millis < 1637300904041 and service_id != 'null' ) "
+ "group by service_id, service_name "
+ "order by SUM(error_count / 3600.0) "
+ "order by SUM(error_count) / 3600.0 "
+ "limit 10000",
viewDefinition,
executionContext);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ void convertAvgRateFunction() {
.thenReturn(Optional.of(Duration.ofSeconds(10)));

assertEquals(
"SUM(foo / 2.0)",
"SUM(foo) / 2.0",
new PinotFunctionConverter()
.convert(
mockingExecutionContext,
Expand All @@ -223,7 +223,7 @@ void convertAvgRateFunction() {
.thenReturn(Optional.of(Duration.ofSeconds(20)));

assertEquals(
"SUM(foo / 4.0)",
"SUM(foo) / 4.0",
new PinotFunctionConverter()
.convert(
mockingExecutionContext,
Expand Down