Search in sources :

Example 1 with SystemTableHandle

use of com.facebook.presto.connector.system.SystemTableHandle in project presto by prestodb.

the class TestSystemTableHandle method testSystemSerialize.

@Test
public void testSystemSerialize() throws Exception {
    SystemTableHandle internalHandle = new SystemTableHandle(CONNECTOR_ID, "system_schema", "system_table");
    assertTrue(objectMapper.canSerialize(SystemTableHandle.class));
    String json = objectMapper.writeValueAsString(internalHandle);
    testJsonEquals(json, SCHEMA_AS_MAP);
}
Also used : SystemTableHandle(com.facebook.presto.connector.system.SystemTableHandle) Test(org.testng.annotations.Test)

Example 2 with SystemTableHandle

use of com.facebook.presto.connector.system.SystemTableHandle in project presto by prestodb.

the class TestSystemTableHandle method testSystemDeserialize.

@Test
public void testSystemDeserialize() throws Exception {
    String json = objectMapper.writeValueAsString(SCHEMA_AS_MAP);
    ConnectorTableHandle tableHandle = objectMapper.readValue(json, ConnectorTableHandle.class);
    assertEquals(tableHandle.getClass(), SystemTableHandle.class);
    SystemTableHandle systemHandle = (SystemTableHandle) tableHandle;
    assertEquals(systemHandle.getConnectorId(), CONNECTOR_ID);
    assertEquals(systemHandle.getSchemaTableName(), new SchemaTableName("system_schema", "system_table"));
}
Also used : SystemTableHandle(com.facebook.presto.connector.system.SystemTableHandle) SchemaTableName(com.facebook.presto.spi.SchemaTableName) ConnectorTableHandle(com.facebook.presto.spi.ConnectorTableHandle) Test(org.testng.annotations.Test)

Aggregations

SystemTableHandle (com.facebook.presto.connector.system.SystemTableHandle)2 Test (org.testng.annotations.Test)2 ConnectorTableHandle (com.facebook.presto.spi.ConnectorTableHandle)1 SchemaTableName (com.facebook.presto.spi.SchemaTableName)1