Skip to content

Commit

Permalink
debug #888, fix can't calculate max(bytes_on_disk)
Browse files Browse the repository at this point in the history
  • Loading branch information
Slach committed Jul 28, 2024
1 parent 1eb37c5 commit 27c42a0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/clickhouse/clickhouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -1157,6 +1157,7 @@ func (ch *ClickHouse) CalculateMaxFileSize(ctx context.Context, cfg *config.Conf
if !cfg.General.UploadByPart {
maxSizeQuery = "SELECT toInt64(max(data_by_disk) * 1.02) AS max_file_size FROM (SELECT disk_name, max(toInt64(bytes_on_disk)) data_by_disk FROM system.parts GROUP BY disk_name)"
}
maxSizeQuery += " SETTINGS empty_result_for_aggregation_by_empty_set=0"
if err := ch.SelectSingleRow(ctx, &rows, maxSizeQuery); err != nil {
return 0, fmt.Errorf("can't calculate max(bytes_on_disk): %v", err)
}
Expand Down

0 comments on commit 27c42a0

Please sign in to comment.