mirror of
https://github.com/MarginaliaSearch/MarginaliaSearch.git
synced 2025-10-05 21:22:39 +02:00
(converter) Amend existing modifications to use gamma coded positions lists
... instead of serialized RoaringBitmaps as was the initial take on the problem.
This commit is contained in:
@@ -138,6 +138,15 @@ public final class ParquetWriter<T> implements Closeable {
|
||||
SimpleWriteSupport.this.writeList(name, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeBinarySerializableList(String name, List<? extends BinarySerializable> value) {
|
||||
if (value.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
SimpleWriteSupport.this.writeBinarySerializableList(name, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeList(String name, TIntList value) {
|
||||
if (value.isEmpty()) {
|
||||
@@ -209,6 +218,18 @@ public final class ParquetWriter<T> implements Closeable {
|
||||
recordConsumer.endField(name, fieldIndex);
|
||||
}
|
||||
|
||||
private void writeBinarySerializableList(String name, List<? extends BinarySerializable> values) {
|
||||
int fieldIndex = schema.getFieldIndex(name);
|
||||
PrimitiveType type = schema.getType(fieldIndex).asPrimitiveType();
|
||||
recordConsumer.startField(name, fieldIndex);
|
||||
|
||||
for (var value : values) {
|
||||
writeValue(type, value.bytes());
|
||||
}
|
||||
|
||||
recordConsumer.endField(name, fieldIndex);
|
||||
}
|
||||
|
||||
private void writeList(String name, TIntList values) {
|
||||
int fieldIndex = schema.getFieldIndex(name);
|
||||
PrimitiveType type = schema.getType(fieldIndex).asPrimitiveType();
|
||||
|
@@ -9,5 +9,6 @@ public interface ValueWriter {
|
||||
void write(String name, Object value);
|
||||
void writeList(String name, List<?> value);
|
||||
void writeList(String name, TLongList value);
|
||||
void writeBinarySerializableList(String name, List<? extends BinarySerializable> value);
|
||||
void writeList(String name, TIntList value);
|
||||
}
|
||||
|
Reference in New Issue
Block a user