Skip to content

Commit 9240c87

Browse files
committed
feat: order by, group by
1 parent 4b98cb7 commit 9240c87

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/data/sqlGenerator.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ const generateSimpleTimeSeriesQuery = (_options: QueryBuilderOptions): string =>
377377
}
378378

379379
if ((options.groupBy?.length || 0) > 0) {
380-
const groupByTime = timeColumn !== undefined ? `, ${timeColumn.name}` : '';
380+
const groupByTime = timeColumn !== undefined ? `, ${timeColumn.columnName || timeColumn.name}` : '';
381381
queryParts.push(`${options.groupBy!.join(', ')}${groupByTime}`);
382382
} else if (hasAggregates && timeColumn) {
383383
queryParts.push(timeColumn.name!);
@@ -648,7 +648,7 @@ const getOrderBy = (options: QueryBuilderOptions): string => {
648648
let colName = o.name;
649649
const hintedColumn = o.hint && getColumnByHint(options, o.hint);
650650
if (hintedColumn) {
651-
colName = hintedColumn.alias || hintedColumn.name;
651+
colName = hintedColumn.columnName || hintedColumn.name;
652652
}
653653

654654
if (!colName) {

0 commit comments

Comments
 (0)