console: fix use of aliased columns in dimensions

By default, `SELECT *` does not select ALIAS columns. Add the
appropriate settings to modify this.

Fix #541
This commit is contained in:
Vincent Bernat
2023-03-03 08:27:39 +01:00
parent b80a847268
commit 88b27a83e6
6 changed files with 24 additions and 22 deletions

View File

@@ -55,7 +55,7 @@ func (input graphCommonHandlerInput) sourceSelect() string {
}
}
if len(truncated) == 0 {
return "SELECT * FROM {{ .Table }}"
return "SELECT * FROM {{ .Table }} SETTINGS asterisk_include_alias_columns = 1"
}
return fmt.Sprintf("SELECT * REPLACE (%s) FROM {{ .Table }}", strings.Join(truncated, ", "))
return fmt.Sprintf("SELECT * REPLACE (%s) FROM {{ .Table }} SETTINGS asterisk_include_alias_columns = 1", strings.Join(truncated, ", "))
}