Skip to content

Commit b12e7ef

Browse files
committed
use BigDecimal to parse minute
1 parent 535802e commit b12e7ef

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

gateway-ha/src/main/java/io/trino/gateway/ha/router/HaQueryHistoryManager.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import io.trino.gateway.ha.persistence.dao.QueryHistoryDao;
2222
import org.jdbi.v3.core.Jdbi;
2323

24+
import java.math.BigDecimal;
2425
import java.time.Instant;
2526
import java.time.LocalDateTime;
2627
import java.time.ZoneId;
@@ -144,7 +145,7 @@ public List<DistributionResponse.LineChart> findDistribution(Long ts)
144145
List<DistributionResponse.LineChart> resList = new ArrayList<>();
145146
for (Map<String, Object> model : results) {
146147
DistributionResponse.LineChart lineChart = new DistributionResponse.LineChart();
147-
long minute = (long) Float.parseFloat(model.get("minute").toString());
148+
long minute = new BigDecimal(model.get("minute").toString()).longValue();
148149
Instant instant = Instant.ofEpochSecond(minute * 60L);
149150
LocalDateTime dateTime = LocalDateTime.ofInstant(instant, ZoneId.systemDefault());
150151
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm");

0 commit comments

Comments
 (0)