Search in sources :

Example 1 with InformationSchemaTableHandle

use of com.facebook.presto.connector.informationSchema.InformationSchemaTableHandle in project presto by prestodb.

the class TestInformationSchemaTableHandle method testInformationSchemaSerialize.

@Test
public void testInformationSchemaSerialize() throws Exception {
    InformationSchemaTableHandle informationSchemaTableHandle = new InformationSchemaTableHandle("information_schema_catalog", "information_schema_schema", "information_schema_table");
    assertTrue(objectMapper.canSerialize(InformationSchemaTableHandle.class));
    String json = objectMapper.writeValueAsString(informationSchemaTableHandle);
    testJsonEquals(json, SCHEMA_AS_MAP);
}
Also used : InformationSchemaTableHandle(com.facebook.presto.connector.informationSchema.InformationSchemaTableHandle) Test(org.testng.annotations.Test)

Example 2 with InformationSchemaTableHandle

use of com.facebook.presto.connector.informationSchema.InformationSchemaTableHandle in project presto by prestodb.

the class TestInformationSchemaTableHandle method testInformationSchemaDeserialize.

@Test
public void testInformationSchemaDeserialize() throws Exception {
    String json = objectMapper.writeValueAsString(SCHEMA_AS_MAP);
    ConnectorTableHandle tableHandle = objectMapper.readValue(json, ConnectorTableHandle.class);
    assertEquals(tableHandle.getClass(), InformationSchemaTableHandle.class);
    InformationSchemaTableHandle informationSchemaHandle = (InformationSchemaTableHandle) tableHandle;
    assertEquals(informationSchemaHandle.getCatalogName(), "information_schema_catalog");
    assertEquals(informationSchemaHandle.getSchemaName(), "information_schema_schema");
    assertEquals(informationSchemaHandle.getTableName(), "information_schema_table");
}
Also used : InformationSchemaTableHandle(com.facebook.presto.connector.informationSchema.InformationSchemaTableHandle) ConnectorTableHandle(com.facebook.presto.spi.ConnectorTableHandle) Test(org.testng.annotations.Test)

Aggregations

InformationSchemaTableHandle (com.facebook.presto.connector.informationSchema.InformationSchemaTableHandle)2 Test (org.testng.annotations.Test)2 ConnectorTableHandle (com.facebook.presto.spi.ConnectorTableHandle)1