Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

package org.apache.cassandra.cdc;

import java.nio.ByteBuffer;
import java.util.List;
import java.util.function.Function;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -155,10 +156,17 @@ public static CdcLogMode fromOption(String name)

private static String columnToString(Value fieldValue)
{
ByteBuffer value = fieldValue.getValue();
if (value == null)
{
// null value means the column is deleted; not a deserialization failure
return String.format("[%s : null]", fieldValue.columnName);
}

try
{
CqlField.CqlType type = typeLookup.apply(KeyspaceTypeKey.of(fieldValue.keyspace, fieldValue.columnType));
Object javaValue = type.deserializeToJavaType(fieldValue.getValue());
Object javaValue = type.deserializeToJavaType(value);
return String.format("[%s : %s]", fieldValue.columnName, javaValue);
}
catch (Throwable t)
Expand Down
Loading