Skip to content

Commit 8464f2a

Browse files
authored
Merge 8047269 into d2a32a8
2 parents d2a32a8 + 8047269 commit 8464f2a

File tree

176 files changed

+3342
-970
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

176 files changed

+3342
-970
lines changed

ydb/core/external_sources/external_data_source.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ struct TExternalDataSource : public IExternalSource {
3636
ythrow TExternalSourceException() << "Only external table supports parameters";
3737
}
3838

39+
bool DataSourceMustHaveDataBaseName(const TProtoStringType& sourceType) const {
40+
return IsIn({"Greenplum", "PostgreSQL", "MySQL", "MsSQLServer", "ClickHouse"}, sourceType);
41+
}
42+
3943
virtual void ValidateExternalDataSource(const TString& externalDataSourceDescription) const override {
4044
NKikimrSchemeOp::TExternalDataSourceDescription proto;
4145
if (!proto.ParseFromString(externalDataSourceDescription)) {
@@ -49,6 +53,10 @@ struct TExternalDataSource : public IExternalSource {
4953
ythrow TExternalSourceException() << "Unsupported property: " << key;
5054
}
5155

56+
if (DataSourceMustHaveDataBaseName(proto.GetSourceType()) && !proto.GetProperties().GetProperties().contains("database_name")) {
57+
ythrow TExternalSourceException() << proto.GetSourceType() << " source must provide database_name";
58+
}
59+
5260
ValidateHostname(HostnamePatterns, proto.GetLocation());
5361
}
5462

ydb/core/external_sources/external_source_factory.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,13 @@ IExternalSourceFactory::TPtr CreateExternalSourceFactory(const std::vector<TStri
3636
NActors::TActorSystem* actorSystem,
3737
size_t pathsLimit,
3838
std::shared_ptr<NYql::ISecuredServiceAccountCredentialsFactory> credentialsFactory,
39-
bool enableInfer) {
39+
bool enableInfer,
40+
bool allowLocalFiles) {
4041
std::vector<TRegExMatch> hostnamePatternsRegEx(hostnamePatterns.begin(), hostnamePatterns.end());
4142
return MakeIntrusive<TExternalSourceFactory>(TMap<TString, IExternalSource::TPtr>{
4243
{
4344
ToString(NYql::EDatabaseType::ObjectStorage),
44-
CreateObjectStorageExternalSource(hostnamePatternsRegEx, actorSystem, pathsLimit, std::move(credentialsFactory), enableInfer)
45+
CreateObjectStorageExternalSource(hostnamePatternsRegEx, actorSystem, pathsLimit, std::move(credentialsFactory), enableInfer, allowLocalFiles)
4546
},
4647
{
4748
ToString(NYql::EDatabaseType::ClickHouse),

ydb/core/external_sources/external_source_factory.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ IExternalSourceFactory::TPtr CreateExternalSourceFactory(const std::vector<TStri
1515
NActors::TActorSystem* actorSystem = nullptr,
1616
size_t pathsLimit = 50000,
1717
std::shared_ptr<NYql::ISecuredServiceAccountCredentialsFactory> credentialsFactory = nullptr,
18-
bool enableInfer = false);
18+
bool enableInfer = false,
19+
bool allowLocalFiles = false);
1920

2021
}

ydb/core/external_sources/hive_metastore/ut/common.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ TString Exec(const TString& cmd) {
2525

2626
TString GetExternalPort(const TString& service, const TString& port) {
2727
auto dockerComposeBin = BinaryPath("library/recipes/docker_compose/bin/docker-compose");
28-
auto composeFileYml = ArcadiaSourceRoot() + "/ydb/core/external_sources/hive_metastore/ut/docker-compose.yml";
28+
auto composeFileYml = ArcadiaFromCurrentLocation(__SOURCE_FILE__, "docker-compose.yml");
2929
auto result = StringSplitter(Exec(dockerComposeBin + " -f " + composeFileYml + " port " + service + " " + port)).Split(':').ToList<TString>();
3030
return result ? Strip(result.back()) : TString{};
3131
}

ydb/core/external_sources/hive_metastore/ut/ya.make

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,19 @@ IF (AUTOCHECK)
2929
)
3030
ENDIF()
3131

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

3435
IF (OPENSOURCE)
35-
# Including of docker_compose/recipe.inc automatically converts these tests into LARGE,
36-
# which makes it impossible to run them during precommit checks on Github CI.
37-
# Next several lines forces these tests to be MEDIUM. To see discussion, visit YDBOPS-8928.
38-
SIZE(MEDIUM)
36+
IF (SANITIZER_TYPE)
37+
# Too huge for precommit check with sanitizers
38+
SIZE(LARGE)
39+
ELSE()
40+
# Including of docker_compose/recipe.inc automatically converts these tests into LARGE,
41+
# which makes it impossible to run them during precommit checks on Github CI.
42+
# Next several lines forces these tests to be MEDIUM. To see discussion, visit YDBOPS-8928.
43+
SIZE(MEDIUM)
44+
ENDIF()
3945
SET(TEST_TAGS_VALUE)
4046
SET(TEST_REQUIREMENTS_VALUE)
4147

0 commit comments

Comments
 (0)