Skip to content

Commit

Permalink
Merge pull request #9353 from uzhastik/24_3_merge
Browse files Browse the repository at this point in the history
24 3 merge v2
  • Loading branch information
maximyurchuk authored Sep 17, 2024
2 parents 9883bf0 + 7a2500b commit c0e2d53
Show file tree
Hide file tree
Showing 174 changed files with 3,349 additions and 988 deletions.
8 changes: 8 additions & 0 deletions ydb/core/external_sources/external_data_source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ struct TExternalDataSource : public IExternalSource {
ythrow TExternalSourceException() << "Only external table supports parameters";
}

bool DataSourceMustHaveDataBaseName(const TProtoStringType& sourceType) const {
return IsIn({"Greenplum", "PostgreSQL", "MySQL", "MsSQLServer", "ClickHouse"}, sourceType);
}

virtual void ValidateExternalDataSource(const TString& externalDataSourceDescription) const override {
NKikimrSchemeOp::TExternalDataSourceDescription proto;
if (!proto.ParseFromString(externalDataSourceDescription)) {
Expand All @@ -49,6 +53,10 @@ struct TExternalDataSource : public IExternalSource {
ythrow TExternalSourceException() << "Unsupported property: " << key;
}

if (DataSourceMustHaveDataBaseName(proto.GetSourceType()) && !proto.GetProperties().GetProperties().contains("database_name")) {
ythrow TExternalSourceException() << proto.GetSourceType() << " source must provide database_name";
}

ValidateHostname(HostnamePatterns, proto.GetLocation());
}

Expand Down
5 changes: 3 additions & 2 deletions ydb/core/external_sources/external_source_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@ IExternalSourceFactory::TPtr CreateExternalSourceFactory(const std::vector<TStri
NActors::TActorSystem* actorSystem,
size_t pathsLimit,
std::shared_ptr<NYql::ISecuredServiceAccountCredentialsFactory> credentialsFactory,
bool enableInfer) {
bool enableInfer,
bool allowLocalFiles) {
std::vector<TRegExMatch> hostnamePatternsRegEx(hostnamePatterns.begin(), hostnamePatterns.end());
return MakeIntrusive<TExternalSourceFactory>(TMap<TString, IExternalSource::TPtr>{
{
ToString(NYql::EDatabaseType::ObjectStorage),
CreateObjectStorageExternalSource(hostnamePatternsRegEx, actorSystem, pathsLimit, std::move(credentialsFactory), enableInfer)
CreateObjectStorageExternalSource(hostnamePatternsRegEx, actorSystem, pathsLimit, std::move(credentialsFactory), enableInfer, allowLocalFiles)
},
{
ToString(NYql::EDatabaseType::ClickHouse),
Expand Down
3 changes: 2 additions & 1 deletion ydb/core/external_sources/external_source_factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ IExternalSourceFactory::TPtr CreateExternalSourceFactory(const std::vector<TStri
NActors::TActorSystem* actorSystem = nullptr,
size_t pathsLimit = 50000,
std::shared_ptr<NYql::ISecuredServiceAccountCredentialsFactory> credentialsFactory = nullptr,
bool enableInfer = false);
bool enableInfer = false,
bool allowLocalFiles = false);

}
2 changes: 1 addition & 1 deletion ydb/core/external_sources/hive_metastore/ut/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ TString Exec(const TString& cmd) {

TString GetExternalPort(const TString& service, const TString& port) {
auto dockerComposeBin = BinaryPath("library/recipes/docker_compose/bin/docker-compose");
auto composeFileYml = ArcadiaSourceRoot() + "/ydb/core/external_sources/hive_metastore/ut/docker-compose.yml";
auto composeFileYml = ArcadiaFromCurrentLocation(__SOURCE_FILE__, "docker-compose.yml");
auto result = StringSplitter(Exec(dockerComposeBin + " -f " + composeFileYml + " port " + service + " " + port)).Split(':').ToList<TString>();
return result ? Strip(result.back()) : TString{};
}
Expand Down
14 changes: 10 additions & 4 deletions ydb/core/external_sources/hive_metastore/ut/ya.make
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,19 @@ IF (AUTOCHECK)
)
ENDIF()

ENV(COMPOSE_HTTP_TIMEOUT=1200) # during parallel tests execution there could be huge disk io, which triggers timeouts in docker-compose
INCLUDE(${ARCADIA_ROOT}/library/recipes/docker_compose/recipe.inc)

IF (OPENSOURCE)
# Including of docker_compose/recipe.inc automatically converts these tests into LARGE,
# which makes it impossible to run them during precommit checks on Github CI.
# Next several lines forces these tests to be MEDIUM. To see discussion, visit YDBOPS-8928.
SIZE(MEDIUM)
IF (SANITIZER_TYPE)
# Too huge for precommit check with sanitizers
SIZE(LARGE)
ELSE()
# Including of docker_compose/recipe.inc automatically converts these tests into LARGE,
# which makes it impossible to run them during precommit checks on Github CI.
# Next several lines forces these tests to be MEDIUM. To see discussion, visit YDBOPS-8928.
SIZE(MEDIUM)
ENDIF()
SET(TEST_TAGS_VALUE)
SET(TEST_REQUIREMENTS_VALUE)

Expand Down
Loading

0 comments on commit c0e2d53

Please sign in to comment.