From f45e930aa011c212c132d31fe6ba3e75fad47e9e Mon Sep 17 00:00:00 2001 From: Andrew Tolbert Date: Thu, 17 Dec 2015 21:02:49 -0600 Subject: [PATCH] [#17] Relax component == key count assertion if using shortKeys. --- src/main/java/com/csforge/sstable/JsonTransformer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/csforge/sstable/JsonTransformer.java b/src/main/java/com/csforge/sstable/JsonTransformer.java index 2b44001..4d13799 100644 --- a/src/main/java/com/csforge/sstable/JsonTransformer.java +++ b/src/main/java/com/csforge/sstable/JsonTransformer.java @@ -80,7 +80,7 @@ private void serializePartitionKey(DecoratedKey key) { if (keyValidator instanceof CompositeType) { // if a composite type, the partition has multiple keys. CompositeType compositeType = (CompositeType) keyValidator; - assert compositeType.getComponents().size() == metadata.partitionKeyColumns().size(); + assert shortKeys || compositeType.getComponents().size() == metadata.partitionKeyColumns().size(); ByteBuffer keyBytes = key.getKey().duplicate(); // Skip static data if it exists. if (keyBytes.remaining() >= 2) {