Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Yisaer committed Jan 31, 2023
1 parent 761b34b commit ccbda88
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions statistics/handle/dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,21 +159,21 @@ func (h *Handle) DumpHistoricalStatsBySnapshot(dbName string, tableInfo *model.T
}()
pi := tableInfo.GetPartitionInfo()
if pi == nil {
return h.getTableHistoricalStatsToJsonWithFallback(dbName, tableInfo, tableInfo.ID, snapshot)
return h.getTableHistoricalStatsToJSONWithFallback(dbName, tableInfo, tableInfo.ID, snapshot)
}
jsonTbl := &JSONTable{
DatabaseName: dbName,
TableName: tableInfo.Name.L,
Partitions: make(map[string]*JSONTable, len(pi.Definitions)),
}
for _, def := range pi.Definitions {
tbl, err := h.getTableHistoricalStatsToJsonWithFallback(dbName, tableInfo, def.ID, snapshot)
tbl, err := h.getTableHistoricalStatsToJSONWithFallback(dbName, tableInfo, def.ID, snapshot)
if err != nil {
return nil, errors.Trace(err)
}
jsonTbl.Partitions[def.Name.L] = tbl
}
tbl, err := h.getTableHistoricalStatsToJsonWithFallback(dbName, tableInfo, tableInfo.ID, snapshot)
tbl, err := h.getTableHistoricalStatsToJSONWithFallback(dbName, tableInfo, tableInfo.ID, snapshot)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -249,8 +249,8 @@ func GenJSONTableFromStats(dbName string, tableInfo *model.TableInfo, tbl *stati
return jsonTbl, nil
}

// getTableHistoricalStatsToJsonWithFallback try to get table historical stats, if not exit, directly fallback to the latest stats
func (h *Handle) getTableHistoricalStatsToJsonWithFallback(dbName string, tableInfo *model.TableInfo, physicalID int64, snapshot uint64) (*JSONTable, error) {
// getTableHistoricalStatsToJSONWithFallback try to get table historical stats, if not exit, directly fallback to the latest stats
func (h *Handle) getTableHistoricalStatsToJSONWithFallback(dbName string, tableInfo *model.TableInfo, physicalID int64, snapshot uint64) (*JSONTable, error) {
jt, exist, err := h.tableHistoricalStatsToJSON(physicalID, snapshot)
if err != nil {
return nil, err
Expand Down

0 comments on commit ccbda88

Please sign in to comment.