@@ -527,8 +527,7 @@ namespace
527527
528528 void setSchemaToLastFile (const ColumnsDescription & columns) override
529529 {
530- if (!getContext ()->getSettingsRef ()[Setting::schema_inference_use_cache_for_file]
531- || getContext ()->getSettingsRef ()[Setting::schema_inference_mode] != SchemaInferenceMode::UNION)
530+ if (!getContext ()->getSettingsRef ()[Setting::schema_inference_use_cache_for_file])
532531 return ;
533532
534533 // / For union mode, schema can be different for different files, so we need to
@@ -537,17 +536,6 @@ namespace
537536 StorageFile::getSchemaCache (getContext ()).addColumns (cache_key, columns);
538537 }
539538
540- void setResultingSchema (const ColumnsDescription & columns) override
541- {
542- if (!getContext ()->getSettingsRef ()[Setting::schema_inference_use_cache_for_file]
543- || getContext ()->getSettingsRef ()[Setting::schema_inference_mode] != SchemaInferenceMode::DEFAULT)
544- return ;
545-
546- // / For default mode we cache resulting schema for all paths.
547- auto cache_keys = getKeysForSchemaCache (paths, *format, format_settings, getContext ());
548- StorageFile::getSchemaCache (getContext ()).addManyColumns (cache_keys, columns);
549- }
550-
551539 String getLastFilePath () const override
552540 {
553541 if (current_index != 0 )
@@ -793,8 +781,7 @@ namespace
793781
794782 void setSchemaToLastFile (const ColumnsDescription & columns) override
795783 {
796- if (!getContext ()->getSettingsRef ()[Setting::schema_inference_use_cache_for_file]
797- || getContext ()->getSettingsRef ()[Setting::schema_inference_mode] != SchemaInferenceMode::UNION)
784+ if (!getContext ()->getSettingsRef ()[Setting::schema_inference_use_cache_for_file])
798785 return ;
799786
800787 // / For union mode, schema can be different for different files in archive, so we need to
@@ -804,22 +791,6 @@ namespace
804791 schema_cache.addColumns (cache_key, columns);
805792 }
806793
807- void setResultingSchema (const ColumnsDescription & columns) override
808- {
809- if (!getContext ()->getSettingsRef ()[Setting::schema_inference_use_cache_for_file]
810- || getContext ()->getSettingsRef ()[Setting::schema_inference_mode] != SchemaInferenceMode::DEFAULT)
811- return ;
812-
813- // / For default mode we cache resulting schema for all paths.
814- // / Also add schema for initial paths (maybe with globes) in cache,
815- // / so next time we won't iterate through files (that can be expensive).
816- for (const auto & archive : archive_info.paths_to_archives )
817- paths_for_schema_cache.emplace_back (fmt::format (" {}::{}" , archive, archive_info.path_in_archive ));
818- auto & schema_cache = StorageFile::getSchemaCache (getContext ());
819- auto cache_keys = getKeysForSchemaCache (paths_for_schema_cache, *format, format_settings, getContext ());
820- schema_cache.addManyColumns (cache_keys, columns);
821- }
822-
823794 void setFormatName (const String & format_name) override
824795 {
825796 format = format_name;
0 commit comments