This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new f74e635aa5 [bug](proc) fix NumberFormatException in show proc 
'/current_queries' (#21400)
f74e635aa5 is described below

commit f74e635aa548311ba1fab0f79c25de65a590e17b
Author: xy720 <[email protected]>
AuthorDate: Sat Jul 1 17:42:46 2023 +0800

    [bug](proc) fix NumberFormatException in show proc '/current_queries' 
(#21400)
    
    If the current query is running for a very long time, the ExecTime of this 
query may larger than the MAX_INT value, then a NumberFormatException will be 
thrown when execute "show proc '/current_queries'."
    The query's ExecTime is long type, we should not use 'Integer.parseInt' to 
parse it.
---
 .../apache/doris/common/proc/CurrentQueryStatementsProcNode.java    | 6 +++---
 .../org/apache/doris/common/proc/CurrentQueryStatisticsProcDir.java | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/common/proc/CurrentQueryStatementsProcNode.java
 
b/fe/fe-core/src/main/java/org/apache/doris/common/proc/CurrentQueryStatementsProcNode.java
index 16d09a5afe..746726c905 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/common/proc/CurrentQueryStatementsProcNode.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/common/proc/CurrentQueryStatementsProcNode.java
@@ -61,9 +61,9 @@ public class CurrentQueryStatementsProcNode implements 
ProcNodeInterface {
 
         // sort according to ExecTime
         sortedRowData.sort((l1, l2) -> {
-            final int execTime1 = Integer.parseInt(l1.get(EXEC_TIME_INDEX));
-            final int execTime2 = Integer.parseInt(l2.get(EXEC_TIME_INDEX));
-            return execTime2 - execTime1;
+            final long execTime1 = Long.parseLong(l1.get(EXEC_TIME_INDEX));
+            final long execTime2 = Long.parseLong(l2.get(EXEC_TIME_INDEX));
+            return Long.compare(execTime2, execTime1);
         });
         result.setRows(sortedRowData);
         return result;
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/common/proc/CurrentQueryStatisticsProcDir.java
 
b/fe/fe-core/src/main/java/org/apache/doris/common/proc/CurrentQueryStatisticsProcDir.java
index 4c59d93bb1..0df36c0040 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/common/proc/CurrentQueryStatisticsProcDir.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/common/proc/CurrentQueryStatisticsProcDir.java
@@ -92,9 +92,9 @@ public class CurrentQueryStatisticsProcDir implements 
ProcDirInterface {
         }
         // sort according to ExecTime
         sortedRowData.sort((l1, l2) -> {
-            final int execTime1 = Integer.parseInt(l1.get(EXEC_TIME_INDEX));
-            final int execTime2 = Integer.parseInt(l2.get(EXEC_TIME_INDEX));
-            return execTime2 - execTime1;
+            final long execTime1 = Long.parseLong(l1.get(EXEC_TIME_INDEX));
+            final long execTime2 = Long.parseLong(l2.get(EXEC_TIME_INDEX));
+            return Long.compare(execTime2, execTime1);
         });
         result.setRows(sortedRowData);
         return result;


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to