You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Yifan Cai (Jira)" <ji...@apache.org> on 2022/06/29 18:15:00 UTC

[jira] [Updated] (CASSANDRA-17695) Fix AbstractCell#toString throws MarshalException for cell in collection

     [ https://issues.apache.org/jira/browse/CASSANDRA-17695?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Yifan Cai updated CASSANDRA-17695:
----------------------------------
    Summary: Fix AbstractCell#toString throws MarshalException for cell in collection  (was: AbstractCell#toString throws MarshalException for cell in collection)

> Fix AbstractCell#toString throws MarshalException for cell in collection
> ------------------------------------------------------------------------
>
>                 Key: CASSANDRA-17695
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-17695
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Legacy/Core
>            Reporter: Yifan Cai
>            Assignee: Francisco Guerrero
>            Priority: Normal
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> 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
> {code:java}
> @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);
> }
> {code}
> 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.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org