Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spaces in timestamp column name #1490

Merged
merged 3 commits into from
Dec 20, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
spaces in timestamp column name
  • Loading branch information
egor-ryashin committed Dec 20, 2022
commit 140fce59cb95419b3a2acbc107964e1febc694a0
2 changes: 1 addition & 1 deletion runtime/queries/column_timeseries.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func (q *ColumnTimeseries) Resolve(ctx context.Context, rt *runtime.Runtime, ins
-- transform the original data, and optionally sample it.
series AS (
SELECT
date_trunc('` + timeGranularity + `', "` + EscapeDoubleQuotes(timestampColumn) + `") as ` + tsAlias + `,` + getExpressionColumnsFromMeasures(measures) + `
date_trunc('` + timeGranularity + `', ` + timestampColumn + `) as ` + tsAlias + `,` + getExpressionColumnsFromMeasures(measures) + `
FROM "` + EscapeDoubleQuotes(tableName) + `" ` + filter + `
GROUP BY ` + tsAlias + ` ORDER BY ` + tsAlias + `
)
Expand Down
3 changes: 3 additions & 0 deletions runtime/queries/sqlutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ func escapeDoubleQuotes(column string) string {
}

func safeName(name string) string {
if name == "" {
return name
}
return quoteName(escapeDoubleQuotes(name))
}

Expand Down