Differential D8880 Diff 32017 java/src/main/java/org/softwareheritage/graph/compress/ORCGraphDataset.java
Changeset View
Changeset View
Standalone View
Standalone View
java/src/main/java/org/softwareheritage/graph/compress/ORCGraphDataset.java
Show First 20 Lines • Show All 333 Lines • ▼ Show 20 Lines | public static class SwhOrcTable { | ||||
public void readBytes64Column(String longColumn, BytesCallback cb) throws IOException { | public void readBytes64Column(String longColumn, BytesCallback cb) throws IOException { | ||||
orcTable.readOrcTable((batch, columnMap) -> { | orcTable.readOrcTable((batch, columnMap) -> { | ||||
BytesColumnVector idVector = (BytesColumnVector) batch.cols[columnMap.get(getIdColumn())]; | BytesColumnVector idVector = (BytesColumnVector) batch.cols[columnMap.get(getIdColumn())]; | ||||
BytesColumnVector valueVector = (BytesColumnVector) batch.cols[columnMap.get(longColumn)]; | BytesColumnVector valueVector = (BytesColumnVector) batch.cols[columnMap.get(longColumn)]; | ||||
for (int row = 0; row < batch.size; row++) { | for (int row = 0; row < batch.size; row++) { | ||||
byte[] id = idToSwhid(ORCTable.getBytesRow(idVector, row)); | byte[] id = idToSwhid(ORCTable.getBytesRow(idVector, row)); | ||||
byte[] value = Base64.getEncoder().encode(ORCTable.getBytesRow(valueVector, row)); | byte[] value = ORCTable.getBytesRow(valueVector, row); | ||||
cb.onBytes(id, value); | if (value != null) { | ||||
byte[] encodedValue = Base64.getEncoder().encode(value); | |||||
cb.onBytes(id, encodedValue); | |||||
} | |||||
} | } | ||||
}, Set.of(getIdColumn(), longColumn)); | }, Set.of(getIdColumn(), longColumn)); | ||||
} | } | ||||
} | } | ||||
public static class SkippedContentOrcTable extends SwhOrcTable { | public static class SkippedContentOrcTable extends SwhOrcTable { | ||||
public SkippedContentOrcTable(File tableDir) { | public SkippedContentOrcTable(File tableDir) { | ||||
super(tableDir); | super(tableDir); | ||||
▲ Show 20 Lines • Show All 367 Lines • Show Last 20 Lines |