Skip to content

Commit 2fea358

Browse files
authored
Merge branch 'antalya-25.8' into frontport/antalya-25.8/fix_remote_calls
2 parents ac8c26a + cfa1468 commit 2fea358

File tree

83 files changed

+3215
-588
lines changed

Some content is hidden

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

83 files changed

+3215
-588
lines changed

src/Analyzer/FunctionSecretArgumentsFinderTreeNode.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,14 @@ class FunctionTreeNodeImpl : public AbstractFunction
7171
{
7272
public:
7373
explicit ArgumentsTreeNode(const QueryTreeNodes * arguments_) : arguments(arguments_) {}
74-
size_t size() const override { return arguments ? arguments->size() : 0; }
75-
std::unique_ptr<Argument> at(size_t n) const override { return std::make_unique<ArgumentTreeNode>(arguments->at(n).get()); }
74+
size_t size() const override
75+
{ /// size withous skipped indexes
76+
return arguments ? arguments->size() - skippedSize() : 0;
77+
}
78+
std::unique_ptr<Argument> at(size_t n) const override
79+
{ /// n is relative index, some can be skipped
80+
return std::make_unique<ArgumentTreeNode>(arguments->at(getRealIndex(n)).get());
81+
}
7682
private:
7783
const QueryTreeNodes * arguments = nullptr;
7884
};

src/Core/Settings.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6986,6 +6986,15 @@ Enable PRQL - an alternative to SQL.
69866986
)", EXPERIMENTAL) \
69876987
DECLARE(Bool, enable_adaptive_memory_spill_scheduler, false, R"(
69886988
Trigger processor to spill data into external storage adpatively. grace join is supported at present.
6989+
)", EXPERIMENTAL) \
6990+
DECLARE(String, object_storage_cluster, "", R"(
6991+
Cluster to make distributed requests to object storages with alternative syntax.
6992+
)", EXPERIMENTAL) \
6993+
DECLARE(UInt64, object_storage_max_nodes, 0, R"(
6994+
Limit for hosts used for request in object storage cluster table functions - azureBlobStorageCluster, s3Cluster, hdfsCluster, etc.
6995+
Possible values:
6996+
- Positive integer.
6997+
- 0 — All hosts in cluster.
69896998
)", EXPERIMENTAL) \
69906999
DECLARE(Bool, allow_experimental_delta_kernel_rs, true, R"(
69917000
Allow experimental delta-kernel-rs implementation.

src/Core/SettingsChangesHistory.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ const VersionToSettingsChangesMap & getSettingsChangesHistory()
4242
addSettingsChanges(settings_changes_history, "25.8.9.2000",
4343
{
4444
{"object_storage_cluster_join_mode", "allow", "allow", "New setting"},
45+
{"object_storage_cluster", "", "", "Antalya: New setting"},
46+
{"object_storage_max_nodes", 0, 0, "Antalya: New setting"},
4547
});
4648
addSettingsChanges(settings_changes_history, "25.8",
4749
{
@@ -137,6 +139,15 @@ const VersionToSettingsChangesMap & getSettingsChangesHistory()
137139
{"allow_experimental_insert_into_iceberg", false, false, "New setting."},
138140
/// RELEASE CLOSED
139141
});
142+
addSettingsChanges(settings_changes_history, "25.6.5.2000",
143+
{
144+
{"allow_experimental_database_iceberg", false, true, "Turned ON by default for Antalya"},
145+
{"allow_experimental_database_unity_catalog", false, true, "Turned ON by default for Antalya"},
146+
{"allow_experimental_database_glue_catalog", false, true, "Turned ON by default for Antalya"},
147+
{"output_format_parquet_enum_as_byte_array", true, true, "Enable writing Enum as byte array in Parquet by default"},
148+
{"object_storage_cluster", "", "", "New setting"},
149+
{"object_storage_max_nodes", 0, 0, "New setting"},
150+
});
140151
addSettingsChanges(settings_changes_history, "25.6",
141152
{
142153
/// RELEASE CLOSED

src/Databases/DataLake/DatabaseDataLake.cpp

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <Storages/ConstraintsDescription.h>
2323
#include <Storages/StorageNull.h>
2424
#include <Storages/ObjectStorage/DataLakes/DataLakeConfiguration.h>
25+
#include <Storages/ObjectStorage/StorageObjectStorageCluster.h>
2526

2627
#include <Interpreters/evaluateConstantExpression.h>
2728
#include <Interpreters/Context.h>
@@ -47,6 +48,7 @@ namespace DatabaseDataLakeSetting
4748
extern const DatabaseDataLakeSettingsString oauth_server_uri;
4849
extern const DatabaseDataLakeSettingsBool oauth_server_use_request_body;
4950
extern const DatabaseDataLakeSettingsBool vended_credentials;
51+
extern const DatabaseDataLakeSettingsString object_storage_cluster;
5052
extern const DatabaseDataLakeSettingsString aws_access_key_id;
5153
extern const DatabaseDataLakeSettingsString aws_secret_access_key;
5254
extern const DatabaseDataLakeSettingsString region;
@@ -176,7 +178,7 @@ std::shared_ptr<DataLake::ICatalog> DatabaseDataLake::getCatalog() const
176178
return catalog_impl;
177179
}
178180

179-
std::shared_ptr<StorageObjectStorageConfiguration> DatabaseDataLake::getConfiguration(
181+
StorageObjectStorageConfigurationPtr DatabaseDataLake::getConfiguration(
180182
DatabaseDataLakeStorageType type,
181183
DataLakeStorageSettingsPtr storage_settings) const
182184
{
@@ -423,24 +425,25 @@ StoragePtr DatabaseDataLake::tryGetTableImpl(const String & name, ContextPtr con
423425

424426
/// with_table_structure = false: because there will be
425427
/// no table structure in table definition AST.
426-
StorageObjectStorageConfiguration::initialize(*configuration, args, context_copy, /* with_table_structure */false);
428+
configuration->initialize(args, context_copy, /* with_table_structure */false);
427429

428-
return std::make_shared<StorageObjectStorage>(
430+
auto cluster_name = settings[DatabaseDataLakeSetting::object_storage_cluster].value;
431+
432+
return std::make_shared<StorageObjectStorageCluster>(
433+
cluster_name,
429434
configuration,
430435
configuration->createObjectStorage(context_copy, /* is_readonly */ false),
431-
context_copy,
432436
StorageID(getDatabaseName(), name),
433437
/* columns */columns,
434438
/* constraints */ConstraintsDescription{},
439+
/* partition_by */nullptr,
440+
context_copy,
435441
/* comment */"",
436442
getFormatSettings(context_copy),
437443
LoadingStrictnessLevel::CREATE,
438444
getCatalog(),
439445
/* if_not_exists*/true,
440446
/* is_datalake_query*/true,
441-
/* distributed_processing */false,
442-
/* partition_by */nullptr,
443-
/* is_table_function */false,
444447
/* lazy_init */true);
445448
}
446449

src/Databases/DataLake/DatabaseDataLake.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class DatabaseDataLake final : public IDatabase, WithContext
8888
void validateSettings();
8989
std::shared_ptr<DataLake::ICatalog> getCatalog() const;
9090

91-
std::shared_ptr<StorageObjectStorageConfiguration> getConfiguration(
91+
StorageObjectStorageConfigurationPtr getConfiguration(
9292
DatabaseDataLakeStorageType type,
9393
DataLakeStorageSettingsPtr storage_settings) const;
9494

src/Databases/DataLake/GlueCatalog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ bool GlueCatalog::classifyTimestampTZ(const String & column_name, const TableMet
451451
auto storage_settings = std::make_shared<DB::DataLakeStorageSettings>();
452452
storage_settings->loadFromSettingsChanges(settings.allChanged());
453453
auto configuration = std::make_shared<DB::StorageS3IcebergConfiguration>(storage_settings);
454-
DB::StorageObjectStorageConfiguration::initialize(*configuration, args, getContext(), false);
454+
configuration->initialize(args, getContext(), false);
455455

456456
auto object_storage = configuration->createObjectStorage(getContext(), true);
457457
const auto & read_settings = getContext()->getReadSettings();

src/Databases/DataLake/ICatalog.cpp

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,19 @@ void TableMetadata::setLocation(const std::string & location_)
8484
auto pos_to_path = location_.substr(pos_to_bucket).find('/');
8585

8686
if (pos_to_path == std::string::npos)
87-
throw DB::Exception(DB::ErrorCodes::NOT_IMPLEMENTED, "Unexpected location format: {}", location_);
88-
89-
pos_to_path = pos_to_bucket + pos_to_path;
87+
{ // empty path
88+
location_without_path = location_;
89+
path.clear();
90+
bucket = location_.substr(pos_to_bucket);
91+
}
92+
else
93+
{
94+
pos_to_path = pos_to_bucket + pos_to_path;
9095

91-
location_without_path = location_.substr(0, pos_to_path);
92-
path = location_.substr(pos_to_path + 1);
93-
bucket = location_.substr(pos_to_bucket, pos_to_path - pos_to_bucket);
96+
location_without_path = location_.substr(0, pos_to_path);
97+
path = location_.substr(pos_to_path + 1);
98+
bucket = location_.substr(pos_to_bucket, pos_to_path - pos_to_bucket);
99+
}
94100

95101
LOG_TEST(getLogger("TableMetadata"),
96102
"Parsed location without path: {}, path: {}",

src/Databases/DataLake/RestCatalog.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ DB::ReadWriteBufferFromHTTPPtr RestCatalog::createReadBuffer(
272272
{
273273
const auto & context = getContext();
274274

275-
Poco::URI url(base_url / endpoint);
275+
Poco::URI url(base_url / endpoint, false);
276276
if (!params.empty())
277277
url.setQueryParameters(params);
278278

@@ -511,7 +511,9 @@ DB::Names RestCatalog::parseTables(DB::ReadBuffer & buf, const std::string & bas
511511
for (size_t i = 0; i < identifiers_object->size(); ++i)
512512
{
513513
const auto current_table_json = identifiers_object->get(static_cast<int>(i)).extract<Poco::JSON::Object::Ptr>();
514-
const auto table_name = current_table_json->get("name").extract<String>();
514+
const auto table_name_raw = current_table_json->get("name").extract<String>();
515+
std::string table_name;
516+
Poco::URI::encode(table_name_raw, "/", table_name);
515517

516518
tables.push_back(base_namespace + "." + table_name);
517519
if (limit && tables.size() >= limit)
@@ -700,7 +702,7 @@ void RestCatalog::sendRequest(const String & endpoint, Poco::JSON::Object::Ptr r
700702
};
701703
}
702704

703-
Poco::URI url(endpoint);
705+
Poco::URI url(endpoint, false);
704706
auto wb = DB::BuilderRWBufferFromHTTP(url)
705707
.withConnectionGroup(DB::HTTPConnectionGroupType::HTTP)
706708
.withMethod(method)

src/Disks/DiskType.cpp

Lines changed: 44 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace ErrorCodes
1212
extern const int LOGICAL_ERROR;
1313
}
1414

15-
MetadataStorageType metadataTypeFromString(const String & type)
15+
MetadataStorageType metadataTypeFromString(const std::string & type)
1616
{
1717
auto check_type = Poco::toLower(type);
1818
if (check_type == "local")
@@ -60,25 +60,49 @@ std::string DataSourceDescription::toString() const
6060
case DataSourceType::RAM:
6161
return "memory";
6262
case DataSourceType::ObjectStorage:
63-
{
64-
switch (object_storage_type)
65-
{
66-
case ObjectStorageType::S3:
67-
return "s3";
68-
case ObjectStorageType::HDFS:
69-
return "hdfs";
70-
case ObjectStorageType::Azure:
71-
return "azure_blob_storage";
72-
case ObjectStorageType::Local:
73-
return "local_blob_storage";
74-
case ObjectStorageType::Web:
75-
return "web";
76-
case ObjectStorageType::None:
77-
return "none";
78-
case ObjectStorageType::Max:
79-
throw Exception(ErrorCodes::LOGICAL_ERROR, "Unexpected object storage type: Max");
80-
}
81-
}
63+
return DB::toString(object_storage_type);
8264
}
8365
}
66+
67+
ObjectStorageType objectStorageTypeFromString(const std::string & type)
68+
{
69+
auto check_type = Poco::toLower(type);
70+
if (check_type == "s3")
71+
return ObjectStorageType::S3;
72+
if (check_type == "hdfs")
73+
return ObjectStorageType::HDFS;
74+
if (check_type == "azure_blob_storage" || check_type == "azure")
75+
return ObjectStorageType::Azure;
76+
if (check_type == "local_blob_storage" || check_type == "local")
77+
return ObjectStorageType::Local;
78+
if (check_type == "web")
79+
return ObjectStorageType::Web;
80+
if (check_type == "none")
81+
return ObjectStorageType::None;
82+
83+
throw Exception(ErrorCodes::UNKNOWN_ELEMENT_IN_CONFIG,
84+
"Unknown object storage type: {}", type);
85+
}
86+
87+
std::string toString(ObjectStorageType type)
88+
{
89+
switch (type)
90+
{
91+
case ObjectStorageType::S3:
92+
return "s3";
93+
case ObjectStorageType::HDFS:
94+
return "hdfs";
95+
case ObjectStorageType::Azure:
96+
return "azure_blob_storage";
97+
case ObjectStorageType::Local:
98+
return "local_blob_storage";
99+
case ObjectStorageType::Web:
100+
return "web";
101+
case ObjectStorageType::None:
102+
return "none";
103+
case ObjectStorageType::Max:
104+
throw Exception(ErrorCodes::LOGICAL_ERROR, "Unexpected object storage type: Max");
105+
}
106+
}
107+
84108
}

src/Disks/DiskType.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@ enum class MetadataStorageType : uint8_t
3636
Memory,
3737
};
3838

39-
MetadataStorageType metadataTypeFromString(const String & type);
40-
String toString(DataSourceType data_source_type);
39+
MetadataStorageType metadataTypeFromString(const std::string & type);
40+
41+
ObjectStorageType objectStorageTypeFromString(const std::string & type);
42+
std::string toString(ObjectStorageType type);
4143

4244
struct DataSourceDescription
4345
{

0 commit comments

Comments
 (0)