dcapwell commented on code in PR #3731:
URL: https://github.com/apache/cassandra/pull/3731#discussion_r1876543417


##########
src/java/org/apache/cassandra/db/filter/RowFilter.java:
##########
@@ -705,7 +705,7 @@ public boolean isSatisfiedBy(TableMetadata metadata, 
DecoratedKey partitionKey,
                 if (column.type.isCounter())
                 {
                     ByteBuffer foundValue = getValue(metadata, partitionKey, 
row);
-                    if (foundValue == null)
+                    if (foundValue == null || foundValue.remaining() == 0)

Review Comment:
   this patch is missing 
`org.apache.cassandra.db.filter.RowFilter.MapElementExpression#isSatisfiedBy` 
as well.
   
   Rather than updating every code path, why not push this logic into 
`getValue`?
   
   In `getValue` we can do
   
   ```
   default:
                       Cell<?> cell = row.getCell(column);
                       if (cell == null) return null;
                       ByteBuffer bb = cell.buffer();
                       return bb.hasRemaining() ? bb : null;
   ```
   
   with that one change all 4 code paths impacted are now seeing `null` (which 
they already handle)



-- 
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]

Reply via email to