public static ColumnSchema pbToColumnSchema(Common.ColumnSchemaPB pb) { Type type = Type.getTypeForDataType(pb.getType()); ColumnTypeAttributes typeAttributes = pb.hasTypeAttributes() ? pbToColumnTypeAttributes(pb.getTypeAttributes()) : null; Object defaultValue = pb.hasWriteDefaultValue() ? byteStringToObject(type, typeAttributes, pb.getWriteDefaultValue()) : null; ColumnSchema.Encoding encoding = ColumnSchema.Encoding.valueOf(pb.getEncoding().name()); ColumnSchema.CompressionAlgorithm compressionAlgorithm = ColumnSchema.CompressionAlgorithm.valueOf(pb.getCompression().name()); int desiredBlockSize = pb.getCfileBlockSize(); return new ColumnSchema.ColumnSchemaBuilder(pb.getName(), type) .key(pb.getIsKey()) .nullable(pb.getIsNullable()) .defaultValue(defaultValue) .encoding(encoding) .compressionAlgorithm(compressionAlgorithm) .desiredBlockSize(desiredBlockSize) .typeAttributes(typeAttributes) .build(); }