@Override
    public Collection<LocalDataQueryResultRow> getRows(final ShowComputeNodesStatement sqlStatement, final ContextManager contextManager) {
        String modeType = contextManager.getComputeNodeInstanceContext().getModeConfiguration().getType();
        return "Standalone".equals(modeType)
                ? Collections.singleton(buildRow(contextManager.getComputeNodeInstanceContext().getInstance(), modeType))
                : contextManager.getComputeNodeInstanceContext().getAllClusterInstances().stream().map(each -> buildRow(each, modeType)).collect(Collectors.toList());
    }
@Test
    void assertExecuteWithClusterMode() {
        ShowComputeNodesExecutor executor = new ShowComputeNodesExecutor();
        ContextManager contextManager = mock(ContextManager.class);
        ComputeNodeInstanceContext computeNodeInstanceContext = createClusterInstanceContext();
        when(contextManager.getComputeNodeInstanceContext()).thenReturn(computeNodeInstanceContext);
        Collection<LocalDataQueryResultRow> actual = executor.getRows(mock(ShowComputeNodesStatement.class), contextManager);
        assertThat(actual.size(), is(1));
        LocalDataQueryResultRow row = actual.iterator().next();
        assertThat(row.getCell(1), is("foo"));
        assertThat(row.getCell(2), is("PROXY"));
        assertThat(row.getCell(3), is("127.0.0.1"));
        assertThat(row.getCell(4), is("3309"));
        assertThat(row.getCell(5), is("OK"));
        assertThat(row.getCell(6), is("Cluster"));
        assertThat(row.getCell(7), is("1"));
        assertThat(row.getCell(8), is(""));
        assertThat(row.getCell(9), is("foo_version"));
    }