use of com.facebook.presto.raptor.RaptorTableIdentity in project presto by prestodb.
the class TestRaptorMetadata method testTableIdentity.
@Test
public void testTableIdentity() throws Exception {
// Test TableIdentity round trip.
metadata.createTable(SESSION, getOrdersTable());
ConnectorTableHandle connectorTableHandle = metadata.getTableHandle(SESSION, DEFAULT_TEST_ORDERS);
TableIdentity tableIdentity = metadata.getTableIdentity(connectorTableHandle);
byte[] bytes = tableIdentity.serialize();
assertEquals(tableIdentity, metadata.deserializeTableIdentity(bytes));
// Test one hard coded serialized data for each version.
byte version = 1;
long tableId = 12345678L;
ByteArrayDataOutput dataOutput = newDataOutput();
dataOutput.writeByte(version);
dataOutput.writeLong(tableId);
byte[] testBytes = dataOutput.toByteArray();
TableIdentity testTableIdentity = metadata.deserializeTableIdentity(testBytes);
assertEquals(testTableIdentity, new RaptorTableIdentity(tableId));
}
Aggregations