use of com.facebook.presto.sql.tree.Identifier in project presto by prestodb.
the class TestChecksumValidator method testRow.
@Test
public void testRow() {
List<Column> columns = ImmutableList.of(ROW_COLUMN);
ChecksumResult controlChecksum = new ChecksumResult(ROW_COLUMN_CHECKSUMS.size(), ROW_COLUMN_CHECKSUMS);
assertTrue(checksumValidator.getMismatchedColumns(columns, controlChecksum, controlChecksum).isEmpty());
// Mismatched different elements
ChecksumResult testChecksum = new ChecksumResult(ROW_COLUMN_CHECKSUMS.size(), merge(ROW_COLUMN_CHECKSUMS, ImmutableMap.<String, Object>builder().put("row.i$checksum", new SqlVarbinary(new byte[] { 0x1a })).put("row.r.b$checksum", new SqlVarbinary(new byte[] { 0x1d })).build()));
Column aFieldColumn = Column.create("row.i", new DereferenceExpression(ROW_COLUMN.getExpression(), new Identifier("i")), INTEGER);
Column rbFieldColumn = Column.create("row.r.b", new DereferenceExpression(new DereferenceExpression(ROW_COLUMN.getExpression(), new Identifier("r")), new Identifier("b")), BIGINT);
assertMismatchedColumns(columns, controlChecksum, testChecksum, aFieldColumn, rbFieldColumn);
}
Aggregations