Skip to content
This repository was archived by the owner on Nov 7, 2025. It is now read-only.

Commit 3716d36

Browse files
committed
better name I think
1 parent 2844fa7 commit 3716d36

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

platform/database_common/log_manager.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,9 @@ func (lm *LogManager) ResolveIndexPattern(ctx context.Context, schema schema.Reg
200200
return util.Distinct(results), nil
201201
}
202202

203-
// buildCountQueryString builds query string which will be sent to DB
203+
// buildStringOfCountQuery builds query string which will be sent to DB
204204
// Takes care whether `table` is "normal" or virtual
205-
func (lm *LogManager) buildCountQueryString(table *Table) string {
205+
func (lm *LogManager) buildStringOfCountQuery(table *Table) string {
206206
if table.VirtualTable {
207207
// CAUTION: Using only table.Name (and discarding table.DatabaseName) on purpose
208208
// Can be changed if needed, but that'd complicate the usual case
@@ -218,7 +218,7 @@ func (lm *LogManager) CountMultiple(ctx context.Context, tables ...*Table) (coun
218218
}
219219
var subCountStatements []string
220220
for _, t := range tables {
221-
subCountStatements = append(subCountStatements, fmt.Sprintf("(%s)", lm.buildCountQueryString(t)))
221+
subCountStatements = append(subCountStatements, fmt.Sprintf("(%s)", lm.buildStringOfCountQuery(t)))
222222
}
223223
err = lm.chDb.QueryRow(ctx, fmt.Sprintf("SELECT sum(*) as count FROM (%s)", strings.Join(subCountStatements, " UNION ALL "))).Scan(&count)
224224
if err != nil {
@@ -229,9 +229,9 @@ func (lm *LogManager) CountMultiple(ctx context.Context, tables ...*Table) (coun
229229

230230
func (lm *LogManager) Count(ctx context.Context, table *Table) (int64, error) {
231231
var count int64
232-
fmt.Printf("HEHE ExecuteCount\ntable: %+v\nquery: %s", table, lm.buildCountQueryString(table))
232+
fmt.Printf("HEHE ExecuteCount\ntable: %+v\nquery: %s", table, lm.buildStringOfCountQuery(table))
233233

234-
err := lm.chDb.QueryRow(ctx, lm.buildCountQueryString(table)).Scan(&count)
234+
err := lm.chDb.QueryRow(ctx, lm.buildStringOfCountQuery(table)).Scan(&count)
235235
if err != nil {
236236
return 0, fmt.Errorf("clickhouse: query row failed: %v", err)
237237
}

0 commit comments

Comments
 (0)