dcapwell commented on PR #2310:
URL: https://github.com/apache/cassandra/pull/2310#issuecomment-1589645806

   > 
   
   ```
   Caused by: org.apache.cassandra.exceptions.InvalidRequestException: Key may 
not be empty
   ```
   
   I really hate our different rules for different columns 😢 ... its an easy 
fix, just had to add the following
   
   ```
   if (i < partitionColumns)
       types[i] = types[i].withoutEmptyData();
   ```
   
   ```
   java.lang.IllegalArgumentException: Invalid component representation: V@
   ```
   
   The property `"fromString(getString(bb)) != bb; %s"` failed...  I was able 
to create a simple unit test for this case/data
   
   ```
           DynamicCompositeType type = 
DynamicCompositeType.getInstance(ImmutableMap.of((byte) 'V', 
BytesType.instance));
   
           String cqlLiteral = "0x8056000000";
           ByteBuffer bb = type.asCQL3Type().fromCQLLiteral(cqlLiteral);
           type.validate(bb);
   
           String str = type.getString(bb);
           ByteBuffer read = type.fromString(str);
           Assertions.assertThat(read).isEqualTo(bb);
   ```
   
   Looks like `size=0`; which is valid for some types... fixed `fromString` to 
allow empty values and to delegate to the type to validate its valid


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