|
47 | 47 | #include <Disks/SingleDiskVolume.h> |
48 | 48 | #include <Disks/TemporaryFileOnDisk.h> |
49 | 49 | #include <Disks/createVolume.h> |
| 50 | +#include <Formats/FormatFactory.h> |
50 | 51 | #include <IO/Operators.h> |
51 | 52 | #include <IO/S3Common.h> |
52 | 53 | #include <IO/SharedThreadPools.h> |
@@ -6241,13 +6242,12 @@ void MergeTreeData::exportPartToTable(const PartitionCommand & command, ContextP |
6241 | 6242 | part_name, getStorageID().getFullTableName()); |
6242 | 6243 |
|
6243 | 6244 | { |
| 6245 | + const auto format_settings = getFormatSettings(query_context); |
6244 | 6246 | MergeTreeExportManifest manifest( |
6245 | 6247 | dest_storage->getStorageID(), |
6246 | 6248 | part, |
6247 | 6249 | query_context->getSettingsRef()[Setting::export_merge_tree_part_overwrite_file_if_exists], |
6248 | | - query_context->getSettingsRef()[Setting::output_format_parallel_formatting], |
6249 | | - query_context->getSettingsRef()[Setting::output_format_parquet_parallel_encoding], |
6250 | | - query_context->getSettingsRef()[Setting::max_threads]); |
| 6250 | + format_settings); |
6251 | 6251 |
|
6252 | 6252 | std::lock_guard lock(export_manifests_mutex); |
6253 | 6253 |
|
@@ -6293,17 +6293,13 @@ void MergeTreeData::exportPartToTableImpl( |
6293 | 6293 |
|
6294 | 6294 | try |
6295 | 6295 | { |
6296 | | - auto context_copy = Context::createCopy(local_context); |
6297 | | - context_copy->setSetting("output_format_parallel_formatting", manifest.parallel_formatting); |
6298 | | - context_copy->setSetting("output_format_parquet_parallel_encoding", manifest.parquet_parallel_encoding); |
6299 | | - context_copy->setSetting("max_threads", manifest.max_threads); |
6300 | | - |
6301 | 6296 | sink = destination_storage->import( |
6302 | 6297 | manifest.data_part->name + "_" + manifest.data_part->checksums.getTotalChecksumHex(), |
6303 | 6298 | block_with_partition_values, |
6304 | 6299 | destination_file_path, |
6305 | 6300 | manifest.overwrite_file_if_exists, |
6306 | | - context_copy); |
| 6301 | + manifest.format_settings, |
| 6302 | + local_context); |
6307 | 6303 | } |
6308 | 6304 | catch (const Exception & e) |
6309 | 6305 | { |
|
0 commit comments