asolimando commented on a change in pull request #2592:
URL: https://github.com/apache/calcite/pull/2592#discussion_r735857510
##########
File path:
cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraEnumerator.java
##########
@@ -81,11 +84,12 @@
* @param index Index of the field within the Row object
*/
private Object currentRowField(int index) {
+ assert current != null;
final Object o = current.get(index,
CassandraSchema.CODEC_REGISTRY.codecFor(
- current.getColumnDefinitions().getType(index)));
+ current.getColumnDefinitions().get(index).getType()));
- return convertToEnumeratorObject(o);
+ return convertToEnumeratorObject(Objects.requireNonNull(o, "o"));
Review comment:
Nulls are totally legal here, otherwise you can't read a null value from
Cassandra at all, good catch!
I got sidetracked by the missing `@Nullable` annotation here.
I have added it here and in `convertToEnumeratorObject` (both the argument
and the return type are nullable).
I have also added a null value in one of the test cases to make sure we can
read nulls.
--
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]