LakshSingla commented on code in PR #14617:
URL: https://github.com/apache/druid/pull/14617#discussion_r1268041878
##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/sql/resources/SqlStatementResource.java:
##########
@@ -536,8 +536,8 @@ private Optional<ResultSetInformation> getSampleResults(
rows = 0L;
size = 0L;
for (PageInformation pageInformation : pageList.get()) {
- rows += pageInformation.getNumRows();
- size += pageInformation.getSizeInBytes();
+ rows += pageInformation.getNumRows() != null ?
pageInformation.getNumRows() : 0L;
Review Comment:
nit:
From the code, it seems like numRows can't be null, so can we modify the
`PageInformation` instead to remove the `Nullable` tag for `numRows`, convert
it to a long, and remove the check here?
Similarly, with this change, we aren't using the nullity of
`PageInformation::sizeOfBytes()` anywhere apart from this check, therefore can
we convert it to a primitive long, populate it as 0 instead of `null`, remove
the `Nullable` and clean up the special handling here?
Since we don't require any special ability of the boxed types, it seems
better to clean them up. WDYT?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]