Skip to content

Commit bc7f70e

Browse files
committed
Merge pull request #1009 from Altinity/simple_export_part
simple export part
1 parent 0904ede commit bc7f70e

File tree

62 files changed

+1130
-128
lines changed

Some content is hidden

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

62 files changed

+1130
-128
lines changed

src/Access/Common/AccessType.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ enum class AccessType : uint8_t
210210
enabled implicitly by the grant ALTER_TABLE */\
211211
M(ALTER_SETTINGS, "ALTER SETTING, ALTER MODIFY SETTING, MODIFY SETTING, RESET SETTING", TABLE, ALTER_TABLE) /* allows to execute ALTER MODIFY SETTING */\
212212
M(ALTER_MOVE_PARTITION, "ALTER MOVE PART, MOVE PARTITION, MOVE PART", TABLE, ALTER_TABLE) \
213+
M(ALTER_EXPORT_PART, "ALTER EXPORT PART, EXPORT PART", TABLE, ALTER_TABLE) \
213214
M(ALTER_FETCH_PARTITION, "ALTER FETCH PART, FETCH PARTITION", TABLE, ALTER_TABLE) \
214215
M(ALTER_FREEZE_PARTITION, "FREEZE PARTITION, UNFREEZE", TABLE, ALTER_TABLE) \
215216
M(ALTER_UNLOCK_SNAPSHOT, "UNLOCK SNAPSHOT", TABLE, ALTER_TABLE) \

src/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ add_headers_and_sources(dbms Storages/ObjectStorage/Azure)
130130
add_headers_and_sources(dbms Storages/ObjectStorage/S3)
131131
add_headers_and_sources(dbms Storages/ObjectStorage/HDFS)
132132
add_headers_and_sources(dbms Storages/ObjectStorage/Local)
133+
add_headers_and_sources(dbms Storages/ObjectStorage/MergeTree)
133134
add_headers_and_sources(dbms Storages/ObjectStorage/DataLakes)
134135
add_headers_and_sources(dbms Storages/ObjectStorage/DataLakes/Iceberg)
135136
add_headers_and_sources(dbms Storages/ObjectStorage/DataLakes/DeltaLake)

src/Core/ServerSettings.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ namespace DB
112112
DECLARE(UInt64, max_unexpected_parts_loading_thread_pool_size, 8, R"(The number of threads to load inactive set of data parts (Unexpected ones) at startup.)", 0) \
113113
DECLARE(UInt64, max_parts_cleaning_thread_pool_size, 128, R"(The number of threads for concurrent removal of inactive data parts.)", 0) \
114114
DECLARE(UInt64, max_mutations_bandwidth_for_server, 0, R"(The maximum read speed of all mutations on server in bytes per second. Zero means unlimited.)", 0) \
115+
DECLARE(UInt64, max_exports_bandwidth_for_server, 0, R"(The maximum read speed of all exports on server in bytes per second. Zero means unlimited.)", 0) \
115116
DECLARE(UInt64, max_merges_bandwidth_for_server, 0, R"(The maximum read speed of all merges on server in bytes per second. Zero means unlimited.)", 0) \
116117
DECLARE(UInt64, max_replicated_fetches_network_bandwidth_for_server, 0, R"(The maximum speed of data exchange over the network in bytes per second for replicated fetches. Zero means unlimited.)", 0) \
117118
DECLARE(UInt64, max_replicated_sends_network_bandwidth_for_server, 0, R"(The maximum speed of data exchange over the network in bytes per second for replicated sends. Zero means unlimited.)", 0) \

src/Core/Settings.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7030,6 +7030,9 @@ Use Shuffle aggregation strategy instead of PartialAggregation + Merge in distri
70307030
DECLARE_WITH_ALIAS(Bool, allow_experimental_time_series_aggregate_functions, false, R"(
70317031
Experimental timeSeries* aggregate functions for Prometheus-like timeseries resampling, rate, delta calculation.
70327032
)", EXPERIMENTAL, allow_experimental_ts_to_grid_aggregate_function) \
7033+
DECLARE_WITH_ALIAS(Bool, allow_experimental_export_merge_tree_part, false, R"(
7034+
Experimental export merge tree part.
7035+
)", EXPERIMENTAL, allow_experimental_export_merge_tree_part) \
70337036
\
70347037
DECLARE(String, promql_database, "", R"(
70357038
Specifies the database name used by the 'promql' dialect. Empty string means the current database.

src/Core/SettingsChangesHistory.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,15 @@ const VersionToSettingsChangesMap & getSettingsChangesHistory()
132132
{"distributed_plan_force_shuffle_aggregation", 0, 0, "New experimental setting"},
133133
{"allow_experimental_insert_into_iceberg", false, false, "New setting."},
134134
/// RELEASE CLOSED
135+
{"allow_experimental_database_iceberg", false, true, "Turned ON by default for Antalya"},
136+
{"allow_experimental_database_unity_catalog", false, true, "Turned ON by default for Antalya"},
137+
{"allow_experimental_database_glue_catalog", false, true, "Turned ON by default for Antalya"},
138+
{"output_format_parquet_enum_as_byte_array", true, true, "Enable writing Enum as byte array in Parquet by default"},
139+
{"lock_object_storage_task_distribution_ms", 0, 0, "New setting."},
140+
{"object_storage_cluster", "", "", "New setting"},
141+
{"object_storage_max_nodes", 0, 0, "New setting"},
142+
{"object_storage_remote_initiator", false, false, "New setting."},
143+
{"allow_experimental_export_merge_tree_part", false, false, "New setting."},
135144
});
136145
addSettingsChanges(settings_changes_history, "25.6",
137146
{

src/Databases/DatabaseReplicated.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2245,7 +2245,8 @@ bool DatabaseReplicated::shouldReplicateQuery(const ContextPtr & query_context,
22452245
if (const auto * alter = query_ptr->as<const ASTAlterQuery>())
22462246
{
22472247
if (alter->isAttachAlter() || alter->isFetchAlter() || alter->isDropPartitionAlter()
2248-
|| is_keeper_map_table(query_ptr) || alter->isFreezeAlter() || alter->isUnlockSnapshot())
2248+
|| is_keeper_map_table(query_ptr) || alter->isFreezeAlter() || alter->isUnlockSnapshot()
2249+
|| alter->isExportPartAlter())
22492250
return false;
22502251

22512252
if (has_many_shards() || !is_replicated_table(query_ptr))

src/Disks/ObjectStorages/IObjectStorage.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ struct RelativePathWithMetadata
129129
virtual ~RelativePathWithMetadata() = default;
130130

131131
virtual std::string getFileName() const { return std::filesystem::path(relative_path).filename(); }
132+
virtual std::string getFileNameWithoutExtension() const { return std::filesystem::path(relative_path).stem(); }
133+
132134
virtual std::string getPath() const { return relative_path; }
133135
virtual bool isArchive() const { return false; }
134136
virtual std::string getPathToArchive() const { throw Exception(ErrorCodes::LOGICAL_ERROR, "Not an archive"); }

src/Interpreters/Context.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ namespace ServerSetting
324324
extern const ServerSettingsUInt64 max_local_write_bandwidth_for_server;
325325
extern const ServerSettingsUInt64 max_merges_bandwidth_for_server;
326326
extern const ServerSettingsUInt64 max_mutations_bandwidth_for_server;
327+
extern const ServerSettingsUInt64 max_exports_bandwidth_for_server;
327328
extern const ServerSettingsUInt64 max_remote_read_network_bandwidth_for_server;
328329
extern const ServerSettingsUInt64 max_remote_write_network_bandwidth_for_server;
329330
extern const ServerSettingsUInt64 max_replicated_fetches_network_bandwidth_for_server;
@@ -544,6 +545,8 @@ struct ContextSharedPart : boost::noncopyable
544545
mutable ThrottlerPtr mutations_throttler; /// A server-wide throttler for mutations
545546
mutable ThrottlerPtr merges_throttler; /// A server-wide throttler for merges
546547

548+
mutable ThrottlerPtr exports_throttler; /// A server-wide throttler for exports
549+
547550
MultiVersion<Macros> macros; /// Substitutions extracted from config.
548551
std::unique_ptr<DDLWorker> ddl_worker TSA_GUARDED_BY(mutex); /// Process ddl commands from zk.
549552
LoadTaskPtr ddl_worker_startup_task; /// To postpone `ddl_worker->startup()` after all tables startup
@@ -1051,6 +1054,9 @@ struct ContextSharedPart : boost::noncopyable
10511054

10521055
if (auto bandwidth = server_settings[ServerSetting::max_merges_bandwidth_for_server])
10531056
merges_throttler = std::make_shared<Throttler>(bandwidth, ProfileEvents::MergesThrottlerBytes, ProfileEvents::MergesThrottlerSleepMicroseconds);
1057+
1058+
if (auto bandwidth = server_settings[ServerSetting::max_exports_bandwidth_for_server])
1059+
exports_throttler = std::make_shared<Throttler>(bandwidth, ProfileEvents::ExportsThrottlerBytes, ProfileEvents::ExportsThrottlerSleepMicroseconds);
10541060
}
10551061
};
10561062

@@ -4148,6 +4154,11 @@ ThrottlerPtr Context::getMergesThrottler() const
41484154
return shared->merges_throttler;
41494155
}
41504156

4157+
ThrottlerPtr Context::getExportsThrottler() const
4158+
{
4159+
return shared->exports_throttler;
4160+
}
4161+
41514162
void Context::reloadRemoteThrottlerConfig(size_t read_bandwidth, size_t write_bandwidth) const
41524163
{
41534164
if (read_bandwidth)

src/Interpreters/Context.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1659,6 +1659,7 @@ class Context: public ContextData, public std::enable_shared_from_this<Context>
16591659

16601660
ThrottlerPtr getMutationsThrottler() const;
16611661
ThrottlerPtr getMergesThrottler() const;
1662+
ThrottlerPtr getExportsThrottler() const;
16621663

16631664
void reloadRemoteThrottlerConfig(size_t read_bandwidth, size_t write_bandwidth) const;
16641665
void reloadLocalThrottlerConfig(size_t read_bandwidth, size_t write_bandwidth) const;

src/Interpreters/DDLWorker.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,8 @@ bool DDLWorker::taskShouldBeExecutedOnLeader(const ASTPtr & ast_ddl, const Stora
752752
alter->isFreezeAlter() ||
753753
alter->isUnlockSnapshot() ||
754754
alter->isMovePartitionToDiskOrVolumeAlter() ||
755-
alter->isCommentAlter())
755+
alter->isCommentAlter() ||
756+
alter->isExportPartAlter())
756757
return false;
757758
}
758759

0 commit comments

Comments
 (0)