Details
-
Bug
-
Status: Resolved
-
Normal
-
Resolution: Fixed
-
None
-
Degradation - Other Exception
-
Low
-
Low Hanging Fruit
-
Unit Test
-
All
-
None
-
Description
AbstractCell#toString is broken when calling on some cells in multi-cell collections.
With the following types are unmarshallable: [date, duration, smallint, time, tinyint].
The test to discover the unmarshallable types is
@Test public void testUnmarshallableInMulticellCollection() { List<CQL3Type.Native> unmarshallableTypes = new ArrayList<>(); for (CQL3Type.Native nativeType : CQL3Type.Native.values()) { ColumnMetadata c = fakeColumn("c", MapType.getInstance(Int32Type.instance, nativeType.getType(), true)); BufferCell cell = BufferCell.tombstone(c, 0, 4, CellPath.create(ByteBufferUtil.bytes(4))); try { cell.toString(); } catch (MarshalException m) { unmarshallableTypes.add(nativeType); } } System.out.println("Unmarshallable types: " + unmarshallableTypes); }
At the first sight, the error is caused by trying to deserialize the values of the tombstone cells. The values are empty, hence the failure.