381658 {
381659 auto file_path = deserializer.ReadProperty<string>(200, "file_path");
381660 auto use_tmp_file = deserializer.ReadProperty<bool>(201, "use_tmp_file");
381661 auto filename_pattern = deserializer.ReadProperty<FilenamePattern>(202, "filename_pattern");
381662 auto overwrite_mode = deserializer.ReadProperty<CopyOverwriteMode>(203, "overwrite_mode");
381663 auto per_thread_output = deserializer.ReadProperty<bool>(204, "per_thread_output");
381664 auto partition_output = deserializer.ReadProperty<bool>(205, "partition_output");
381665 auto partition_columns = deserializer.ReadProperty<vector<idx_t>>(206, "partition_columns");
381666 auto names = deserializer.ReadProperty<vector<string>>(207, "names");
381667 auto expected_types = deserializer.ReadProperty<vector<LogicalType>>(208, "expected_types");
381668 auto copy_info =
381669 unique_ptr_cast<ParseInfo, CopyInfo>(deserializer.ReadProperty<unique_ptr<ParseInfo>>(209, "copy_info"));
381670
381671
381672 auto &context = deserializer.Get<ClientContext &>();
381673 auto name = deserializer.ReadProperty<string>(210, "function_name");
381674
381675 auto &func_catalog_entry =
381677 if (func_catalog_entry.type != CatalogType::COPY_FUNCTION_ENTRY) {
381678 throw InternalException("DeserializeFunction - cant find catalog entry for function %s", name);
381679 }
381680 auto &function_entry = func_catalog_entry.Cast<CopyFunctionCatalogEntry>();
381681 auto function = function_entry.function;
381682
381683 unique_ptr<FunctionData> bind_data;
381684 auto has_serialize = deserializer.ReadProperty<bool>(211, "function_has_serialize");
381685 if (has_serialize) {
381686
381687 deserializer.ReadObject(212, "function_data",
381688 [&](Deserializer &obj) { bind_data = function.deserialize(obj, function); });
381689 }
381690
381691 auto default_extension = function.extension;
381692
381693 auto file_extension =
381694 deserializer.ReadPropertyWithExplicitDefault<string>(213, "file_extension", std::move(default_extension));
381695
381696 auto rotate = deserializer.ReadPropertyWithExplicitDefault(214, "rotate", false);
381697 auto return_type =
381698 deserializer.ReadPropertyWithExplicitDefault(215, "return_type", CopyFunctionReturnType::CHANGED_ROWS);
381699 auto write_partition_columns = deserializer.ReadPropertyWithExplicitDefault(216, "write_partition_columns", true);
381700 auto write_empty_file = deserializer.ReadPropertyWithExplicitDefault(217, "write_empty_file", true);
381701 auto preserve_order =
381702 deserializer.ReadPropertyWithExplicitDefault(218, "preserve_order", PreserveOrderType::AUTOMATIC);
381703 auto hive_file_pattern = deserializer.ReadPropertyWithExplicitDefault(219, "hive_file_pattern", true);
381704 auto file_size_bytes = deserializer.ReadPropertyWithExplicitDefault(220, "file_size_bytes", optional_idx());
381705
381706 if (!has_serialize) {
381707
381708 if (!function.copy_to_bind) {
381709 throw InternalException("Copy function \"%s\" has neither bind nor (de)serialize", function.name);
381710 }
381711
381712 CopyFunctionBindInput function_bind_input(*copy_info, function.function_info);
381713 auto names_to_write = GetNamesWithoutPartitions(names, partition_columns, write_partition_columns);
381714 auto types_to_write = GetTypesWithoutPartitions(expected_types, partition_columns, write_partition_columns);
381715 bind_data = function.copy_to_bind(context, function_bind_input, names_to_write, types_to_write);
381716 }
381717
381718 auto result = make_uniq<LogicalCopyToFile>(function, std::move(bind_data), std::move(copy_info));
381719 result->file_path = file_path;
381720 result->use_tmp_file = use_tmp_file;
381721 result->filename_pattern = filename_pattern;
381722 result->file_extension = file_extension;
381723 result->overwrite_mode = overwrite_mode;
381724 result->per_thread_output = per_thread_output;
381725 result->partition_output = partition_output;
381726 result->partition_columns = partition_columns;
381727 result->names = names;
381728 result->expected_types = expected_types;
381729 result->rotate = rotate;
381730 result->return_type = return_type;
381731 result->write_partition_columns = write_partition_columns;
381732 result->write_empty_file = write_empty_file;
381733 result->preserve_order = preserve_order;
381734 result->hive_file_pattern = hive_file_pattern;
381735 result->file_size_bytes = file_size_bytes;
381736
381737 return std::move(result);
381738}
DUCKDB_API optional_ptr< CatalogEntry > GetEntry(ClientContext &context, const string &schema, const EntryLookupInfo &lookup_info, OnEntryNotFound if_not_found)
Gets the "schema.name" entry of the specified type, if entry does not exist behavior depends on OnEnt...
Definition duckdb.cpp:8156