aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/core/dq_integration/yql_dq_integration.cpp
blob: ff1d0cfb843a525749ccfab058e9cb2e942b0e89 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include "yql_dq_integration.h"

#include <yql/essentials/core/yql_type_annotation.h>

namespace NYql {

std::unordered_set<IDqIntegration*> GetUniqueIntegrations(const TTypeAnnotationContext& typesCtx) {
    std::unordered_set<IDqIntegration*> uniqueIntegrations(typesCtx.DataSources.size() + typesCtx.DataSinks.size());
    for (const auto& provider : typesCtx.DataSources) {
        if (auto* dqIntegration = provider->GetDqIntegration()) {
            uniqueIntegrations.emplace(dqIntegration);
        }
    }

    for (const auto& provider : typesCtx.DataSinks) {
        if (auto* dqIntegration = provider->GetDqIntegration()) {
            uniqueIntegrations.emplace(dqIntegration);
        }
    }

    return uniqueIntegrations;
}

} // namespace NYql