Skip to content

Commit fec06ec

Browse files
authored
Merge branch 'antalya-25.3' into feature/antalya-25.3/fix_remote_calls
2 parents 1d20683 + 7de1214 commit fec06ec

File tree

103 files changed

+2865
-577
lines changed

Some content is hidden

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

103 files changed

+2865
-577
lines changed

.github/workflows/release_branches.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ on: # yamllint disable-line rule:truthy
2323
- '*'
2424
push:
2525
branches:
26-
- 'antalya'
26+
- 'antalya*'
2727
tags:
2828
- '*'
2929
workflow_dispatch:

programs/server/Server.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,10 @@
157157
# include <azure/core/diagnostics/logger.hpp>
158158
#endif
159159

160+
#if USE_PARQUET
161+
# include <Processors/Formats/Impl/ParquetFileMetaDataCache.h>
162+
#endif
163+
160164

161165
#include <incbin.h>
162166
/// A minimal file used when the server is run without installation
@@ -316,6 +320,7 @@ namespace ServerSetting
316320
extern const ServerSettingsUInt64 page_cache_max_size;
317321
extern const ServerSettingsDouble page_cache_free_memory_ratio;
318322
extern const ServerSettingsUInt64 page_cache_lookahead_blocks;
323+
extern const ServerSettingsUInt64 input_format_parquet_metadata_cache_max_size;
319324
}
320325

321326
}
@@ -2376,6 +2381,7 @@ try
23762381
dns_cache_updater->start();
23772382

23782383
auto replicas_reconnector = ReplicasReconnector::init(global_context);
2384+
ParquetFileMetaDataCache::instance()->setMaxSizeInBytes(server_settings[ServerSetting::input_format_parquet_metadata_cache_max_size]);
23792385

23802386
/// Set current database name before loading tables and databases because
23812387
/// system logs may copy global context.

src/Access/Common/AccessType.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ enum class AccessType : uint8_t
182182
M(SYSTEM_DROP_SCHEMA_CACHE, "SYSTEM DROP SCHEMA CACHE, DROP SCHEMA CACHE", GLOBAL, SYSTEM_DROP_CACHE) \
183183
M(SYSTEM_DROP_FORMAT_SCHEMA_CACHE, "SYSTEM DROP FORMAT SCHEMA CACHE, DROP FORMAT SCHEMA CACHE", GLOBAL, SYSTEM_DROP_CACHE) \
184184
M(SYSTEM_DROP_S3_CLIENT_CACHE, "SYSTEM DROP S3 CLIENT, DROP S3 CLIENT CACHE", GLOBAL, SYSTEM_DROP_CACHE) \
185+
M(SYSTEM_DROP_PARQUET_METADATA_CACHE, "SYSTEM DROP PARQUET METADATA CACHE", GLOBAL, SYSTEM_DROP_CACHE) \
185186
M(SYSTEM_DROP_CACHE, "DROP CACHE", GROUP, SYSTEM) \
186187
M(SYSTEM_RELOAD_CONFIG, "RELOAD CONFIG", GLOBAL, SYSTEM_RELOAD) \
187188
M(SYSTEM_RELOAD_USERS, "RELOAD USERS", GLOBAL, SYSTEM_RELOAD) \

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/Common/ProfileEvents.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,8 @@ The server successfully detected this situation and will download merged part fr
968968
M(FilterTransformPassedRows, "Number of rows that passed the filter in the query", ValueType::Number) \
969969
M(FilterTransformPassedBytes, "Number of bytes that passed the filter in the query", ValueType::Bytes) \
970970
M(QueryPreempted, "How many times tasks are paused and waiting due to 'priority' setting", ValueType::Number) \
971-
971+
M(ParquetMetaDataCacheHits, "Number of times the read from filesystem cache hit the cache.", ValueType::Number) \
972+
M(ParquetMetaDataCacheMisses, "Number of times the read from filesystem cache miss the cache.", ValueType::Number) \
972973

973974
#ifdef APPLY_FOR_EXTERNAL_EVENTS
974975
#define APPLY_FOR_EVENTS(M) APPLY_FOR_BUILTIN_EVENTS(M) APPLY_FOR_EXTERNAL_EVENTS(M)

src/Core/Block.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ const ColumnWithTypeAndName & Block::safeGetByPosition(size_t position) const
290290
}
291291

292292

293-
const ColumnWithTypeAndName * Block::findByName(const std::string & name, bool case_insensitive) const
293+
const ColumnWithTypeAndName * Block::findByName(const std::string_view & name, bool case_insensitive) const
294294
{
295295
if (case_insensitive)
296296
{
@@ -310,6 +310,11 @@ const ColumnWithTypeAndName * Block::findByName(const std::string & name, bool c
310310
return &data[it->second];
311311
}
312312

313+
const ColumnWithTypeAndName * Block::findByName(const std::string & name, bool case_insensitive) const
314+
{
315+
return findByName(std::string_view{name}, case_insensitive);
316+
}
317+
313318
std::optional<ColumnWithTypeAndName> Block::findSubcolumnByName(const std::string & name) const
314319
{
315320
auto [name_in_storage, subcolumn_name] = Nested::splitName(name);

src/Core/Block.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#include <initializer_list>
99
#include <vector>
10+
#include <Common/StringHashForHeterogeneousLookup.h>
1011

1112

1213
class SipHash;
@@ -30,7 +31,7 @@ class Block
3031
{
3132
private:
3233
using Container = ColumnsWithTypeAndName;
33-
using IndexByName = std::unordered_map<String, size_t>;
34+
using IndexByName = std::unordered_map<String, size_t, StringHashForHeterogeneousLookup, StringHashForHeterogeneousLookup::transparent_key_equal>;
3435

3536
Container data;
3637
IndexByName index_by_name;
@@ -70,6 +71,14 @@ class Block
7071
const_cast<const Block *>(this)->findByName(name, case_insensitive));
7172
}
7273

74+
ColumnWithTypeAndName* findByName(const std::string_view & name, bool case_insensitive = false)
75+
{
76+
return const_cast<ColumnWithTypeAndName *>(
77+
const_cast<const Block *>(this)->findByName(name, case_insensitive));
78+
}
79+
80+
const ColumnWithTypeAndName * findByName(const std::string_view & name, bool case_insensitive) const;
81+
7382
const ColumnWithTypeAndName * findByName(const std::string & name, bool case_insensitive = false) const;
7483
std::optional<ColumnWithTypeAndName> findSubcolumnByName(const std::string & name) const;
7584
std::optional<ColumnWithTypeAndName> findColumnOrSubcolumnByName(const std::string & name) const;

src/Core/FormatFactorySettings.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1301,7 +1301,7 @@ Set the quoting rule for identifiers in SHOW CREATE query
13011301
DECLARE(IdentifierQuotingStyle, show_create_query_identifier_quoting_style, IdentifierQuotingStyle::Backticks, R"(
13021302
Set the quoting style for identifiers in SHOW CREATE query
13031303
)", 0) \
1304-
1304+
DECLARE(Bool, input_format_parquet_use_metadata_cache, true, R"(Enable parquet file metadata caching)", 0) \
13051305
// End of FORMAT_FACTORY_SETTINGS
13061306

13071307
#define OBSOLETE_FORMAT_SETTINGS(M, ALIAS) \

src/Core/ServerSettings.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,9 +1019,8 @@ namespace DB
10191019
<wait_dictionaries_load_at_startup>true</wait_dictionaries_load_at_startup>
10201020
```
10211021
)", 0) \
1022-
DECLARE(Bool, storage_shared_set_join_use_inner_uuid, false, "If enabled, an inner UUID is generated during the creation of SharedSet and SharedJoin. ClickHouse Cloud only", 0)
1023-
1024-
1022+
DECLARE(Bool, storage_shared_set_join_use_inner_uuid, false, "If enabled, an inner UUID is generated during the creation of SharedSet and SharedJoin. ClickHouse Cloud only", 0) \
1023+
DECLARE(UInt64, input_format_parquet_metadata_cache_max_size, 500000000, "Maximum size of parquet file metadata cache", 0) \
10251024
// clang-format on
10261025

10271026
/// If you add a setting which can be updated at runtime, please update 'changeable_settings' map in dumpToSystemServerSettingsColumns below

src/Core/Settings.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6111,6 +6111,15 @@ Enable PRQL - an alternative to SQL.
61116111
)", EXPERIMENTAL) \
61126112
DECLARE(Bool, enable_adaptive_memory_spill_scheduler, false, R"(
61136113
Trigger processor to spill data into external storage adpatively. grace join is supported at present.
6114+
)", EXPERIMENTAL) \
6115+
DECLARE(String, object_storage_cluster, "", R"(
6116+
Cluster to make distributed requests to object storages with alternative syntax.
6117+
)", EXPERIMENTAL) \
6118+
DECLARE(UInt64, object_storage_max_nodes, 0, R"(
6119+
Limit for hosts used for request in object storage cluster table functions - azureBlobStorageCluster, s3Cluster, hdfsCluster, etc.
6120+
Possible values:
6121+
- Positive integer.
6122+
- 0 — All hosts in cluster.
61146123
)", EXPERIMENTAL) \
61156124
\
61166125
/** Experimental tsToGrid aggregate function. */ \

0 commit comments

Comments
 (0)