@@ -20,7 +20,7 @@ public class ClickHouseResponseSummary implements Serializable {
2020 public static final class Progress implements Serializable {
2121 private static final long serialVersionUID = -1447066780591278108L ;
2222
23- static final Progress EMPTY = new Progress (0L , 0L , 0L , 0L , 0L , 0L , 0L );
23+ static final Progress EMPTY = new Progress (0L , 0L , 0L , 0L , 0L , 0L , 0L , "" );
2424
2525 private final long read_rows ;
2626 private final long read_bytes ;
@@ -29,6 +29,7 @@ public static final class Progress implements Serializable {
2929 private final long written_bytes ;
3030 private final long elapsed_time ;
3131 private final long result_rows ;
32+ private final String query_id ;
3233
3334 /**
3435 * Default constructor.
@@ -39,16 +40,34 @@ public static final class Progress implements Serializable {
3940 * @param written_rows Number of rows written
4041 * @param written_bytes Volume of data written in bytes
4142 * @param elapsed_time Query processing time in (ns)
43+ * @param result_rows Number of rows in the result
4244 */
4345 public Progress (long read_rows , long read_bytes , long total_rows_to_read , long written_rows ,
44- long written_bytes , long elapsed_time , long result_rows ) {
46+ long written_bytes , long elapsed_time , long result_rows ) {
47+ this (read_rows , read_bytes , total_rows_to_read , written_rows , written_bytes , elapsed_time , result_rows , "" );
48+ }
49+ /**
50+ * Default constructor.
51+ *
52+ * @param read_rows Number of rows read
53+ * @param read_bytes Volume of data read in bytes
54+ * @param total_rows_to_read Total number of rows to be read
55+ * @param written_rows Number of rows written
56+ * @param written_bytes Volume of data written in bytes
57+ * @param elapsed_time Query processing time in (ns)
58+ * @param result_rows Number of rows in the result
59+ * @param query_id Query ID
60+ */
61+ public Progress (long read_rows , long read_bytes , long total_rows_to_read , long written_rows ,
62+ long written_bytes , long elapsed_time , long result_rows , String query_id ) {
4563 this .read_rows = read_rows ;
4664 this .read_bytes = read_bytes ;
4765 this .total_rows_to_read = total_rows_to_read ;
4866 this .written_rows = written_rows ;
4967 this .written_bytes = written_bytes ;
5068 this .elapsed_time = elapsed_time ;
5169 this .result_rows = result_rows ;
70+ this .query_id = query_id ;
5271 }
5372
5473 public long getReadRows () {
@@ -78,6 +97,10 @@ public long getElapsedTime() {
7897 public long getResultRows () {
7998 return result_rows ;
8099 }
100+
101+ public String getQueryId () {
102+ return query_id ;
103+ }
81104 public Progress add (Progress progress ) {
82105 if (progress == null ) {
83106 return this ;
@@ -86,7 +109,7 @@ public Progress add(Progress progress) {
86109 return new Progress (read_rows + progress .read_rows , read_bytes + progress .read_bytes ,
87110 total_rows_to_read + progress .total_rows_to_read , written_rows + progress .written_rows ,
88111 written_bytes + progress .written_bytes ,elapsed_time + progress .elapsed_time ,
89- result_rows + progress .result_rows );
112+ result_rows + progress .result_rows , query_id + ", " + progress . query_id );
90113 }
91114
92115 public boolean isEmpty () {
@@ -322,6 +345,10 @@ public long getResultRows() {
322345 return progress .get ().getResultRows ();
323346 }
324347
348+ public String getQueryId () {
349+ return progress .get ().getQueryId ();
350+ }
351+
325352 public boolean isEmpty () {
326353 return progress .get ().isEmpty () && stats .get ().isEmpty ();
327354 }
0 commit comments