presto-main/src/main/java/io/prestosql/execution/SqlQueryExecution.java/SqlQueryExecution/extractTableHandles
class SqlQueryExecution:    private static Multimap<CatalogName, ConnectorTableHandle> extractTableHandles(Analysis analysis)
    {
        ImmutableMultimap.Builder<CatalogName, ConnectorTableHandle> tableHandles = ImmutableMultimap.builder();

        for (TableHandle tableHandle : analysis.getTables()) {
            tableHandles.put(tableHandle.getCatalogName(), tableHandle.getConnectorHandle());
        }

        if (analysis.getInsert().isPresent()) {
            TableHandle target = analysis.getInsert().get().getTarget();
            tableHandles.put(target.getCatalogName(), target.getConnectorHandle());
        }

        return tableHandles.build();
    }