Skip to content

Commit

Permalink
fix: custom data source creation failed in enterprise ClickHouse
Browse files Browse the repository at this point in the history
If the GROUP BY field is in `( )`, it will be considered that the GROUP BY is an entire tuple, not multiple fields.
The field to be SELECTed is not in the field list of GROUP BY, and a query error occurs.
  • Loading branch information
lzf575 committed Sep 27, 2024
1 parent 2e094d0 commit 4409e4c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/ingester/datasource/handle.go
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ func MakeMVTableCreateSQL(t *ckdb.Table, db, dstTable, aggrSummable, aggrUnsumma
return fmt.Sprintf(`CREATE MATERIALIZED VIEW IF NOT EXISTS %s TO %s
AS SELECT %s
FROM %s
GROUP BY (%s)
GROUP BY %s
ORDER BY (%s)`,
tableMv, tableAgg,
strings.Join(columns, ",\n"),
Expand Down

0 comments on commit 4409e4c

Please sign in to comment.