Repository: ClickHouse/ClickHouse
File: src/Storages/StorageMergeTree.cpp (C++)

Code before:
    const String & date_column_name,
    const MergingParams & merging_params_,
    std::unique_ptr<MergeTreeSettings> storage_settings_)
    : MergeTreeData(
          table_id_,
          metadata_,
          context_,
          date_column_name,
          merging_params_,
          std::move(storage_settings_),
          false, /// require_part_metadata
          mode)
    , writer(*this)
    , merger_mutator(*this)
    , support_transaction(supportTransaction(getDisks(), log.load()))
{
    initializeDirectoriesAndFormatVersion(relative_data_path_, LoadingStrictnessLevel::ATTACH <= mode, date_column_name);

    loadDataParts(LoadingStrictnessLevel::FORCE_RESTORE <= mode, std::nullopt);

    if (mode < LoadingStrictnessLevel::ATTACH && !getDataPartsForInternalUsage().empty() && !isStaticStorage())
        throw Exception(ErrorCodes::INCORRECT_DATA,
                        "Data directory for table already containing data parts - probably "
                        "it was unclean DROP table or manual intervention. "
                        "You must either clear directory by hand or use ATTACH TABLE instead "
                        "of CREATE TABLE if you need to use that parts");

    increment.set(getMaxBlockNumber());

    loadMutations();
    loadDeduplicationLog();

    prewarmCaches(getActivePartsLoadingThreadPool().get(), getMarkCacheToPrewarm(0), getPrimaryIndexCacheToPrewarm(0));
}


void StorageMergeTree::startup()
{
    /// Do not schedule any background jobs if current storage has static data files.
    if (isStaticStorage())
        return;

    clearEmptyParts();

    /// Temporary directories contain incomplete results of merges (after forced restart)
    ///  and don't allow to reinitialize them, so delete each of them immediately
    clearOldTemporaryDirectories(0, {"tmp_", "delete_tmp_", "tmp-fetch_"});

    /// NOTE background task will also do the above cleanups periodically.
    time_after_previous_cleanup_parts.restart();
    time_after_previous_cleanup_temporary_directories.restart();

Review comment (suggestion):
Grammar issue: "if you need to use that parts" should be "if you need to use those parts" (plural form requires "those" not "that").
```suggestion
                        "of CREATE TABLE if you need to use those parts");
```

Code after:
    const String & date_column_name,
    const MergingParams & merging_params_,
    std::unique_ptr<MergeTreeSettings> storage_settings_)
    : MergeTreeData(
          table_id_,
          metadata_,
          context_,
          date_column_name,
          merging_params_,
          std::move(storage_settings_),
          false, /// require_part_metadata
          mode)
    , writer(*this)
    , merger_mutator(*this)
    , support_transaction(supportTransaction(getDisks(), log.load()))
{
    initializeDirectoriesAndFormatVersion(relative_data_path_, LoadingStrictnessLevel::ATTACH <= mode, date_column_name);

    loadDataParts(LoadingStrictnessLevel::FORCE_RESTORE <= mode, std::nullopt);

    if (mode < LoadingStrictnessLevel::ATTACH && !getDataPartsForInternalUsage().empty() && !isStaticStorage())
        throw Exception(ErrorCodes::INCORRECT_DATA,
                        "Data directory for table already containing data parts - probably "
                        "it was unclean DROP table or manual intervention. "
                        "You must either clear directory by hand or use ATTACH TABLE instead "
                        "of CREATE TABLE if you need to use those parts");

    increment.set(getMaxBlockNumber());

    loadMutations();
    loadDeduplicationLog();

    prewarmCaches(getActivePartsLoadingThreadPool().get(), getMarkCacheToPrewarm(0), getPrimaryIndexCacheToPrewarm(0));
}


void StorageMergeTree::startup()
{
    /// Do not schedule any background jobs if current storage has static data files.
    if (isStaticStorage())
        return;

    clearEmptyParts();

    /// Temporary directories contain incomplete results of merges (after forced restart)
    ///  and don't allow to reinitialize them, so delete each of them immediately
    clearOldTemporaryDirectories(0, {"tmp_", "delete_tmp_", "tmp-fetch_"});

    /// NOTE background task will also do the above cleanups periodically.
    time_after_previous_cleanup_parts.restart();
    time_after_previous_cleanup_temporary_directories.restart();