Akshat-Jain commented on code in PR #17466:
URL: https://github.com/apache/druid/pull/17466#discussion_r1841912390
##########
processing/src/main/java/org/apache/druid/query/rowsandcols/CursorFactoryRowsAndColumns.java:
##########
@@ -112,12 +112,8 @@ private static RowsAndColumns materialize(CursorFactory
cursorFactory)
cursor.advance();
}
- if (writer == null) {
- return new EmptyRowsAndColumns();
- } else {
- final byte[] bytes = writer.toByteArray();
- return new ColumnBasedFrameRowsAndColumns(Frame.wrap(bytes),
rowSignature);
- }
+ final byte[] bytes = writer.toByteArray();
Review Comment:
It's a spotbugs pattern named `RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE`:
https://spotbugs.readthedocs.io/en/stable/bugDescriptions.html#rcn-redundant-nullcheck-of-value-known-to-be-null-rcn-redundant-nullcheck-of-null-value
I'm not sure why it wasn't showing up in Java 8. But the change seems minor,
and is legit, so I ended up making it.
We also have other places in the code where we expect
`frameWriterFactory.newFrameWriter()` to return non-null. Example:
https://github.com/apache/druid/blob/75d9ece665460fdfab119576bae707ba7f60bbcd/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/querykit/common/OffsetLimitFrameProcessor.java#L149
--
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]