use of com.facebook.presto.verifier.checksum.SimpleColumnChecksum in project presto by prestodb.
the class TestStructuredColumnMismatchResolver method testMixed.
@Test
public void testMixed() {
ColumnMatchResult<?> resolvable1 = createMismatchedColumn(new ArrayType(new ArrayType(DOUBLE)), new ArrayColumnChecksum(binary(0xa), binary(0xc), 1), new ArrayColumnChecksum(binary(0xb), binary(0xc), 1));
ColumnMatchResult<?> resolvable2 = createMismatchedColumn(mapType(REAL, DOUBLE), new MapColumnChecksum(binary(0x1), binary(0xa), binary(0xa), binary(0xc), 1), new MapColumnChecksum(binary(0x4), binary(0xb), binary(0xb), binary(0xc), 1));
ColumnMatchResult<?> nonResolvable = createMismatchedColumn(VARCHAR, new SimpleColumnChecksum(binary(0xa)), new SimpleColumnChecksum(binary(0xb)));
assertResolved(resolvable1, resolvable2);
assertNotResolved(resolvable1, nonResolvable);
assertNotResolved(nonResolvable, resolvable2);
assertNotResolved(resolvable1, nonResolvable, resolvable2);
}
use of com.facebook.presto.verifier.checksum.SimpleColumnChecksum in project presto by prestodb.
the class TestIgnoredFunctionsMismatchResolver method testDefault.
@Test
public void testDefault() {
ColumnMatchResult<?> mismatchedColumn = createMismatchedColumn(VARCHAR, new SimpleColumnChecksum(binary(0xa)), new SimpleColumnChecksum(binary(0xb)));
// resolved
assertResolved(createBundle("CREATE TABLE test AS SELECT rand() x FROM source"), mismatchedColumn);
assertResolved(createBundle("CREATE TABLE test AS SELECT presto.default.rand() x FROM source"), mismatchedColumn);
assertResolved(createBundle("SELECT arbitrary(x) FROM source"), mismatchedColumn);
assertResolved(createBundle("INSERT INTO target SELECT presto.default.arbitrary(x) FROM source"), mismatchedColumn);
assertResolved(createBundle("SELECT arbitrary(rand()) FROM source"), mismatchedColumn);
assertResolved(createBundle("SELECT sum(rand()) FROM source"), mismatchedColumn);
// not resolved
assertNotResolved(createBundle("SELECT count() FROM source"), mismatchedColumn);
}
Aggregations