use of org.apache.beam.sdk.io.gcp.bigtable.RowUtils.VALUE in project beam by apache.
the class BigtableTableTestUtils method setFixedTimestamp.
// There is no possibility to insert a value with fixed timestamp so we have to replace it
// for the testing purpose.
static com.google.bigtable.v2.Row setFixedTimestamp(com.google.bigtable.v2.Row row) {
Family family = row.getFamilies(0);
List<Column> columnsReplaced = family.getColumnsList().stream().map(column -> {
Cell cell = column.getCells(0);
return column(column.getQualifier().toStringUtf8(), cell.getValue().toByteArray());
}).collect(toList());
Family familyReplaced = Family.newBuilder().setName(family.getName()).addAllColumns(columnsReplaced).build();
return com.google.bigtable.v2.Row.newBuilder().setKey(row.getKey()).addFamilies(familyReplaced).build();
}
Aggregations