You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "Jackie-Jiang (via GitHub)" <gi...@apache.org> on 2024/05/21 19:20:31 UTC

[PR] Add back 'numRowsResultSet' to BrokerResponse, and retain it when result table is hidden [pinot]

Jackie-Jiang opened a new pull request, #13198:
URL: https://github.com/apache/pinot/pull/13198

   This field was removed in #13179 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [PR] Add back 'numRowsResultSet' to BrokerResponse, and retain it when result table is hidden [pinot]

Posted by "klsince (via GitHub)" <gi...@apache.org>.
klsince commented on code in PR #13198:
URL: https://github.com/apache/pinot/pull/13198#discussion_r1608900537


##########
pinot-common/src/main/java/org/apache/pinot/common/response/broker/BrokerResponseNativeV2.java:
##########
@@ -83,6 +84,16 @@ public ResultTable getResultTable() {
   @Override
   public void setResultTable(@Nullable ResultTable resultTable) {
     _resultTable = resultTable;
+    // NOTE: Update _numRowsResultSet when setting non-null result table. We might set null result table when user wants
+    //       to hide the result but only show the stats, in which case we should not update _numRowsResultSet.
+    if (resultTable != null) {
+      _numRowsResultSet = resultTable.getRows().size();
+    }
+  }
+
+  @Override
+  public int getNumRowsResultSet() {
+    return _numRowsResultSet;

Review Comment:
   add setNumRowsResultSet() as well?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [PR] Add back 'numRowsResultSet' to BrokerResponse, and retain it when result table is hidden [pinot]

Posted by "Jackie-Jiang (via GitHub)" <gi...@apache.org>.
Jackie-Jiang commented on code in PR #13198:
URL: https://github.com/apache/pinot/pull/13198#discussion_r1608948748


##########
pinot-common/src/main/java/org/apache/pinot/common/response/broker/BrokerResponseNativeV2.java:
##########
@@ -83,6 +84,16 @@ public ResultTable getResultTable() {
   @Override
   public void setResultTable(@Nullable ResultTable resultTable) {
     _resultTable = resultTable;
+    // NOTE: Update _numRowsResultSet when setting non-null result table. We might set null result table when user wants
+    //       to hide the result but only show the stats, in which case we should not update _numRowsResultSet.
+    if (resultTable != null) {
+      _numRowsResultSet = resultTable.getRows().size();
+    }
+  }
+
+  @Override
+  public int getNumRowsResultSet() {
+    return _numRowsResultSet;

Review Comment:
   I added it for V1 response for JSON ser/de purpose, which is not supported in V2 response as of now



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [PR] Add back 'numRowsResultSet' to BrokerResponse, and retain it when result table is hidden [pinot]

Posted by "Jackie-Jiang (via GitHub)" <gi...@apache.org>.
Jackie-Jiang commented on code in PR #13198:
URL: https://github.com/apache/pinot/pull/13198#discussion_r1608948106


##########
pinot-common/src/main/java/org/apache/pinot/common/response/broker/BrokerResponseNativeV2.java:
##########
@@ -83,6 +84,16 @@ public ResultTable getResultTable() {
   @Override
   public void setResultTable(@Nullable ResultTable resultTable) {
     _resultTable = resultTable;
+    // NOTE: Update _numRowsResultSet when setting non-null result table. We might set null result table when user wants
+    //       to hide the result but only show the stats, in which case we should not update _numRowsResultSet.
+    if (resultTable != null) {
+      _numRowsResultSet = resultTable.getRows().size();
+    }
+  }
+
+  @Override
+  public int getNumRowsResultSet() {
+    return _numRowsResultSet;

Review Comment:
   I didn't add it intentionally because we want to always set it along with the result table



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [PR] Add back 'numRowsResultSet' to BrokerResponse, and retain it when result table is hidden [pinot]

Posted by "Jackie-Jiang (via GitHub)" <gi...@apache.org>.
Jackie-Jiang merged PR #13198:
URL: https://github.com/apache/pinot/pull/13198


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org