public Optional<ViewDefinition> getViewDefinition(QualifiedObjectName viewName)
    {
        if (!viewDefinitions.containsKey(viewName)) {
            throw new PrestoException(VIEW_NOT_FOUND, format("View %s not found, the available view names are: %s", viewName, viewDefinitions.keySet()));
        }

        try {
            return viewDefinitions.get(viewName).get();
        }
        catch (InterruptedException ex) {
            Thread.currentThread().interrupt();
            throw new RuntimeException(ex);
        }
        catch (ExecutionException ex) {
            throwIfUnchecked(ex.getCause());
            throw new RuntimeException(ex.getCause());
        }
    }
@Test
    public void testGetViewDefinition()
    {
        Optional<ViewDefinition> viewDefinitionOptional = metadataHandle.getViewDefinition(QualifiedObjectName.valueOf("tpch.s1.t1"));
        assertTrue(viewDefinitionOptional.isPresent());
        ViewDefinition viewDefinition = viewDefinitionOptional.get();
        assertEquals("tpch", viewDefinition.getCatalog().get());
        assertEquals("s1", viewDefinition.getSchema().get());
        assertEquals("user", viewDefinition.getOwner().get());
        assertEquals("select a from t1", viewDefinition.getOriginalSql());
        assertFalse(viewDefinition.isRunAsInvoker());
    }