duckdb 1.3.1-dev6.0 → 1.3.2-dev0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/duckdb/extension/core_functions/aggregate/distributive/arg_min_max.cpp +27 -39
- package/src/duckdb/extension/core_functions/aggregate/holistic/quantile.cpp +2 -3
- package/src/duckdb/extension/core_functions/include/core_functions/aggregate/quantile_sort_tree.hpp +1 -1
- package/src/duckdb/extension/core_functions/lambda_functions.cpp +16 -14
- package/src/duckdb/extension/core_functions/scalar/list/list_filter.cpp +3 -2
- package/src/duckdb/extension/core_functions/scalar/list/list_reduce.cpp +46 -10
- package/src/duckdb/extension/core_functions/scalar/list/list_transform.cpp +3 -2
- package/src/duckdb/extension/core_functions/scalar/random/random.cpp +3 -1
- package/src/duckdb/extension/icu/icu-datefunc.cpp +5 -3
- package/src/duckdb/extension/icu/icu-strptime.cpp +6 -1
- package/src/duckdb/extension/icu/icu-timezone.cpp +4 -0
- package/src/duckdb/extension/icu/icu_extension.cpp +7 -2
- package/src/duckdb/extension/icu/include/icu-datefunc.hpp +1 -1
- package/src/duckdb/extension/icu/include/icu-helpers.hpp +1 -1
- package/src/duckdb/extension/icu/third_party/icu/common/uloc.cpp +5 -5
- package/src/duckdb/extension/json/include/json_common.hpp +19 -0
- package/src/duckdb/extension/json/include/json_deserializer.hpp +1 -4
- package/src/duckdb/extension/json/include/json_functions.hpp +4 -4
- package/src/duckdb/extension/json/json_functions/json_serialize_sql.cpp +38 -17
- package/src/duckdb/extension/json/json_functions/json_table_in_out.cpp +11 -7
- package/src/duckdb/extension/json/json_functions.cpp +4 -4
- package/src/duckdb/extension/json/json_reader.cpp +1 -1
- package/src/duckdb/extension/parquet/column_reader.cpp +7 -1
- package/src/duckdb/extension/parquet/include/parquet_bss_decoder.hpp +2 -2
- package/src/duckdb/extension/parquet/include/parquet_dbp_encoder.hpp +2 -2
- package/src/duckdb/extension/parquet/include/parquet_reader.hpp +2 -1
- package/src/duckdb/extension/parquet/include/parquet_statistics.hpp +1 -1
- package/src/duckdb/extension/parquet/include/parquet_writer.hpp +3 -0
- package/src/duckdb/extension/parquet/include/writer/parquet_write_operators.hpp +3 -1
- package/src/duckdb/extension/parquet/include/writer/templated_column_writer.hpp +1 -1
- package/src/duckdb/extension/parquet/parquet_crypto.cpp +9 -5
- package/src/duckdb/extension/parquet/parquet_extension.cpp +26 -0
- package/src/duckdb/extension/parquet/parquet_float16.cpp +4 -2
- package/src/duckdb/extension/parquet/parquet_metadata.cpp +3 -3
- package/src/duckdb/extension/parquet/parquet_multi_file_info.cpp +12 -0
- package/src/duckdb/extension/parquet/parquet_reader.cpp +5 -4
- package/src/duckdb/extension/parquet/parquet_statistics.cpp +13 -3
- package/src/duckdb/extension/parquet/parquet_writer.cpp +1 -1
- package/src/duckdb/extension/parquet/reader/decimal_column_reader.cpp +1 -1
- package/src/duckdb/extension/parquet/reader/string_column_reader.cpp +1 -1
- package/src/duckdb/extension/parquet/reader/struct_column_reader.cpp +13 -4
- package/src/duckdb/extension/parquet/serialize_parquet.cpp +2 -0
- package/src/duckdb/src/catalog/catalog.cpp +10 -4
- package/src/duckdb/src/catalog/catalog_entry/duck_table_entry.cpp +4 -10
- package/src/duckdb/src/catalog/catalog_entry/schema_catalog_entry.cpp +1 -2
- package/src/duckdb/src/catalog/catalog_entry/sequence_catalog_entry.cpp +1 -1
- package/src/duckdb/src/catalog/catalog_entry/table_catalog_entry.cpp +2 -2
- package/src/duckdb/src/catalog/catalog_entry/type_catalog_entry.cpp +1 -1
- package/src/duckdb/src/catalog/catalog_search_path.cpp +7 -1
- package/src/duckdb/src/catalog/catalog_set.cpp +21 -1
- package/src/duckdb/src/common/adbc/adbc.cpp +1 -1
- package/src/duckdb/src/common/arrow/arrow_appender.cpp +17 -5
- package/src/duckdb/src/common/arrow/arrow_converter.cpp +23 -15
- package/src/duckdb/src/common/box_renderer.cpp +1 -2
- package/src/duckdb/src/common/enum_util.cpp +4 -3
- package/src/duckdb/src/common/local_file_system.cpp +13 -12
- package/src/duckdb/src/common/multi_file/multi_file_column_mapper.cpp +35 -12
- package/src/duckdb/src/common/multi_file/multi_file_reader.cpp +13 -3
- package/src/duckdb/src/common/string_util.cpp +7 -5
- package/src/duckdb/src/common/tree_renderer/graphviz_tree_renderer.cpp +4 -4
- package/src/duckdb/src/common/tree_renderer/html_tree_renderer.cpp +4 -4
- package/src/duckdb/src/common/tree_renderer/json_tree_renderer.cpp +4 -4
- package/src/duckdb/src/common/tree_renderer/text_tree_renderer.cpp +4 -4
- package/src/duckdb/src/common/types/row/tuple_data_segment.cpp +1 -1
- package/src/duckdb/src/common/types/uuid.cpp +5 -1
- package/src/duckdb/src/common/types.cpp +28 -0
- package/src/duckdb/src/common/virtual_file_system.cpp +5 -0
- package/src/duckdb/src/execution/column_binding_resolver.cpp +49 -30
- package/src/duckdb/src/execution/index/fixed_size_allocator.cpp +4 -0
- package/src/duckdb/src/execution/join_hashtable.cpp +10 -7
- package/src/duckdb/src/execution/operator/aggregate/physical_streaming_window.cpp +3 -3
- package/src/duckdb/src/execution/operator/csv_scanner/encode/csv_encoder.cpp +1 -1
- package/src/duckdb/src/execution/operator/csv_scanner/scanner/column_count_scanner.cpp +2 -1
- package/src/duckdb/src/execution/operator/csv_scanner/scanner/skip_scanner.cpp +1 -4
- package/src/duckdb/src/execution/operator/csv_scanner/scanner/string_value_scanner.cpp +53 -1
- package/src/duckdb/src/execution/operator/csv_scanner/sniffer/dialect_detection.cpp +58 -59
- package/src/duckdb/src/execution/operator/join/physical_hash_join.cpp +10 -5
- package/src/duckdb/src/execution/operator/persistent/physical_batch_copy_to_file.cpp +4 -0
- package/src/duckdb/src/execution/operator/persistent/physical_copy_to_file.cpp +18 -8
- package/src/duckdb/src/execution/operator/persistent/physical_export.cpp +1 -1
- package/src/duckdb/src/execution/operator/schema/physical_attach.cpp +1 -0
- package/src/duckdb/src/execution/physical_plan_generator.cpp +5 -5
- package/src/duckdb/src/function/cast/vector_cast_helpers.cpp +2 -1
- package/src/duckdb/src/function/function.cpp +4 -0
- package/src/duckdb/src/function/scalar/operator/arithmetic.cpp +6 -0
- package/src/duckdb/src/function/scalar/struct/remap_struct.cpp +10 -1
- package/src/duckdb/src/function/table/copy_csv.cpp +1 -0
- package/src/duckdb/src/function/table/version/pragma_version.cpp +3 -3
- package/src/duckdb/src/include/duckdb/catalog/catalog.hpp +1 -0
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/duck_table_entry.hpp +1 -1
- package/src/duckdb/src/include/duckdb/catalog/catalog_search_path.hpp +1 -1
- package/src/duckdb/src/include/duckdb/catalog/catalog_set.hpp +2 -0
- package/src/duckdb/src/include/duckdb/common/file_buffer.hpp +2 -2
- package/src/duckdb/src/include/duckdb/common/helper.hpp +9 -9
- package/src/duckdb/src/include/duckdb/common/hive_partitioning.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/multi_file/multi_file_column_mapper.hpp +3 -5
- package/src/duckdb/src/include/duckdb/common/multi_file/multi_file_reader.hpp +7 -0
- package/src/duckdb/src/include/duckdb/common/multi_file/multi_file_states.hpp +3 -0
- package/src/duckdb/src/include/duckdb/common/shadow_forbidden_functions.hpp +40 -0
- package/src/duckdb/src/include/duckdb/common/string.hpp +25 -2
- package/src/duckdb/src/include/duckdb/common/types/hugeint.hpp +20 -24
- package/src/duckdb/src/include/duckdb/common/types/uhugeint.hpp +20 -24
- package/src/duckdb/src/include/duckdb/common/types.hpp +3 -0
- package/src/duckdb/src/include/duckdb/common/unique_ptr.hpp +34 -8
- package/src/duckdb/src/include/duckdb/execution/column_binding_resolver.hpp +1 -0
- package/src/duckdb/src/include/duckdb/execution/join_hashtable.hpp +3 -2
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/column_count_scanner.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/encode/csv_encoder.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/sniffer/csv_sniffer.hpp +15 -3
- package/src/duckdb/src/include/duckdb/function/cast/vector_cast_helpers.hpp +2 -2
- package/src/duckdb/src/include/duckdb/function/copy_function.hpp +7 -3
- package/src/duckdb/src/include/duckdb/function/function.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/function_binder.hpp +2 -1
- package/src/duckdb/src/include/duckdb/function/function_serialization.hpp +20 -12
- package/src/duckdb/src/include/duckdb/function/lambda_functions.hpp +4 -3
- package/src/duckdb/src/include/duckdb/function/scalar_function.hpp +3 -1
- package/src/duckdb/src/include/duckdb/logging/log_type.hpp +17 -0
- package/src/duckdb/src/include/duckdb/main/attached_database.hpp +1 -0
- package/src/duckdb/src/include/duckdb/main/client_properties.hpp +22 -6
- package/src/duckdb/src/include/duckdb/main/config.hpp +2 -0
- package/src/duckdb/src/include/duckdb/main/database_manager.hpp +4 -1
- package/src/duckdb/src/include/duckdb/main/extension_entries.hpp +27 -13
- package/src/duckdb/src/include/duckdb/main/secret/secret_manager.hpp +1 -0
- package/src/duckdb/src/include/duckdb/main/settings.hpp +11 -0
- package/src/duckdb/src/include/duckdb/optimizer/topn_optimizer.hpp +7 -1
- package/src/duckdb/src/include/duckdb/original/std/locale.hpp +10 -0
- package/src/duckdb/src/include/duckdb/original/std/memory.hpp +12 -0
- package/src/duckdb/src/include/duckdb/original/std/sstream.hpp +11 -0
- package/src/duckdb/src/include/duckdb/planner/expression_binder.hpp +5 -3
- package/src/duckdb/src/include/duckdb/storage/buffer/buffer_pool.hpp +4 -2
- package/src/duckdb/src/logging/log_manager.cpp +1 -0
- package/src/duckdb/src/logging/log_types.cpp +40 -0
- package/src/duckdb/src/main/attached_database.cpp +4 -0
- package/src/duckdb/src/main/client_context.cpp +1 -0
- package/src/duckdb/src/main/config.cpp +1 -0
- package/src/duckdb/src/main/database.cpp +1 -0
- package/src/duckdb/src/main/database_manager.cpp +19 -2
- package/src/duckdb/src/main/extension/extension_helper.cpp +4 -3
- package/src/duckdb/src/main/query_profiler.cpp +2 -2
- package/src/duckdb/src/main/query_result.cpp +1 -1
- package/src/duckdb/src/main/secret/secret_manager.cpp +2 -0
- package/src/duckdb/src/main/settings/autogenerated_settings.cpp +7 -0
- package/src/duckdb/src/main/settings/custom_settings.cpp +106 -34
- package/src/duckdb/src/optimizer/optimizer.cpp +1 -1
- package/src/duckdb/src/optimizer/topn_optimizer.cpp +18 -8
- package/src/duckdb/src/parallel/executor.cpp +5 -0
- package/src/duckdb/src/parser/parsed_data/create_sequence_info.cpp +1 -1
- package/src/duckdb/src/parser/transform/expression/transform_interval.cpp +5 -1
- package/src/duckdb/src/planner/binder/expression/bind_function_expression.cpp +21 -24
- package/src/duckdb/src/planner/binder/expression/bind_lambda.cpp +10 -8
- package/src/duckdb/src/planner/binder/expression/bind_operator_expression.cpp +3 -2
- package/src/duckdb/src/planner/binder/statement/bind_copy.cpp +0 -4
- package/src/duckdb/src/planner/binder/tableref/bind_basetableref.cpp +3 -0
- package/src/duckdb/src/planner/binder/tableref/bind_table_function.cpp +3 -0
- package/src/duckdb/src/planner/expression/bound_cast_expression.cpp +3 -0
- package/src/duckdb/src/planner/expression/bound_columnref_expression.cpp +1 -1
- package/src/duckdb/src/planner/expression/bound_function_expression.cpp +0 -1
- package/src/duckdb/src/planner/expression/bound_reference_expression.cpp +1 -1
- package/src/duckdb/src/planner/expression_binder.cpp +4 -2
- package/src/duckdb/src/planner/logical_operator.cpp +2 -1
- package/src/duckdb/src/planner/subquery/flatten_dependent_join.cpp +4 -1
- package/src/duckdb/src/storage/buffer/block_handle.cpp +8 -0
- package/src/duckdb/src/storage/buffer/buffer_pool.cpp +44 -18
- package/src/duckdb/src/storage/caching_file_system.cpp +7 -7
- package/src/duckdb/src/storage/standard_buffer_manager.cpp +4 -3
- package/src/duckdb/src/storage/storage_info.cpp +2 -0
- package/src/duckdb/src/storage/wal_replay.cpp +9 -4
- package/src/duckdb/third_party/fmt/include/fmt/format.h +8 -1
- package/src/duckdb/third_party/fsst/libfsst.cpp +4 -3
- package/src/duckdb/third_party/httplib/httplib.hpp +25 -22
- package/src/duckdb/third_party/hyperloglog/sds.cpp +7 -3
- package/src/duckdb/third_party/libpg_query/src_common_keywords.cpp +8 -1
- package/src/duckdb/third_party/re2/re2/filtered_re2.h +8 -2
- package/src/duckdb/third_party/re2/re2/pod_array.h +7 -1
- package/src/duckdb/third_party/re2/re2/re2.cc +6 -2
- package/src/duckdb/third_party/re2/re2/set.cc +1 -1
- package/src/duckdb/third_party/re2/re2/set.h +7 -1
- package/src/duckdb/ub_src_logging.cpp +4 -4
@@ -650,12 +650,13 @@ CatalogException Catalog::CreateMissingEntryException(CatalogEntryRetriever &ret
|
|
650
650
|
auto &context = retriever.GetContext();
|
651
651
|
auto entries = SimilarEntriesInSchemas(context, lookup_info, schemas);
|
652
652
|
|
653
|
+
auto &config = DBConfig::GetConfig(context);
|
654
|
+
auto max_schema_count = config.GetSetting<CatalogErrorMaxSchemasSetting>(context);
|
655
|
+
|
653
656
|
reference_set_t<SchemaCatalogEntry> unseen_schemas;
|
654
657
|
auto &db_manager = DatabaseManager::Get(context);
|
655
|
-
auto databases = db_manager.GetDatabases(context);
|
656
|
-
auto &config = DBConfig::GetConfig(context);
|
658
|
+
auto databases = db_manager.GetDatabases(context, max_schema_count);
|
657
659
|
|
658
|
-
auto max_schema_count = config.GetSetting<CatalogErrorMaxSchemasSetting>(context);
|
659
660
|
for (auto database : databases) {
|
660
661
|
if (unseen_schemas.size() >= max_schema_count) {
|
661
662
|
break;
|
@@ -669,7 +670,8 @@ CatalogException Catalog::CreateMissingEntryException(CatalogEntryRetriever &ret
|
|
669
670
|
unseen_schemas.insert(current_schema.get());
|
670
671
|
}
|
671
672
|
}
|
672
|
-
|
673
|
+
|
674
|
+
// Check if the entry exists in any extension.
|
673
675
|
string extension_name;
|
674
676
|
auto type = lookup_info.GetCatalogType();
|
675
677
|
auto &entry_name = lookup_info.GetEntryName();
|
@@ -732,6 +734,7 @@ CatalogException Catalog::CreateMissingEntryException(CatalogEntryRetriever &ret
|
|
732
734
|
static constexpr const double UNSEEN_PENALTY = 0.2;
|
733
735
|
auto unseen_entries = SimilarEntriesInSchemas(context, lookup_info, unseen_schemas);
|
734
736
|
set<string> suggestions;
|
737
|
+
|
735
738
|
if (!unseen_entries.empty() && (unseen_entries[0].score == 1.0 || unseen_entries[0].score - UNSEEN_PENALTY >
|
736
739
|
(entries.empty() ? 0.0 : entries[0].score))) {
|
737
740
|
// the closest matching entry requires qualification as it is not in the default search path
|
@@ -1201,6 +1204,9 @@ void Catalog::Initialize(optional_ptr<ClientContext> context, bool load_builtin)
|
|
1201
1204
|
Initialize(load_builtin);
|
1202
1205
|
}
|
1203
1206
|
|
1207
|
+
void Catalog::FinalizeLoad(optional_ptr<ClientContext> context) {
|
1208
|
+
}
|
1209
|
+
|
1204
1210
|
void Catalog::OnDetach(ClientContext &context) {
|
1205
1211
|
}
|
1206
1212
|
|
@@ -160,7 +160,7 @@ unique_ptr<CatalogEntry> DuckTableEntry::AlterEntry(CatalogTransaction transacti
|
|
160
160
|
}
|
161
161
|
|
162
162
|
// We add foreign key constraints without a client context during checkpoint loading.
|
163
|
-
return AddForeignKeyConstraint(
|
163
|
+
return AddForeignKeyConstraint(foreign_key_constraint_info);
|
164
164
|
}
|
165
165
|
|
166
166
|
unique_ptr<CatalogEntry> DuckTableEntry::AlterEntry(ClientContext &context, AlterInfo &info) {
|
@@ -219,7 +219,7 @@ unique_ptr<CatalogEntry> DuckTableEntry::AlterEntry(ClientContext &context, Alte
|
|
219
219
|
case AlterTableType::FOREIGN_KEY_CONSTRAINT: {
|
220
220
|
auto &foreign_key_constraint_info = table_info.Cast<AlterForeignKeyInfo>();
|
221
221
|
if (foreign_key_constraint_info.type == AlterForeignKeyType::AFT_ADD) {
|
222
|
-
return AddForeignKeyConstraint(
|
222
|
+
return AddForeignKeyConstraint(foreign_key_constraint_info);
|
223
223
|
} else {
|
224
224
|
return DropForeignKeyConstraint(context, foreign_key_constraint_info);
|
225
225
|
}
|
@@ -1101,8 +1101,7 @@ unique_ptr<CatalogEntry> DuckTableEntry::SetColumnComment(ClientContext &context
|
|
1101
1101
|
return make_uniq<DuckTableEntry>(catalog, schema, *bound_create_info, storage);
|
1102
1102
|
}
|
1103
1103
|
|
1104
|
-
unique_ptr<CatalogEntry> DuckTableEntry::AddForeignKeyConstraint(
|
1105
|
-
AlterForeignKeyInfo &info) {
|
1104
|
+
unique_ptr<CatalogEntry> DuckTableEntry::AddForeignKeyConstraint(AlterForeignKeyInfo &info) {
|
1106
1105
|
D_ASSERT(info.type == AlterForeignKeyType::AFT_ADD);
|
1107
1106
|
auto create_info = make_uniq<CreateTableInfo>(schema, name);
|
1108
1107
|
create_info->temporary = temporary;
|
@@ -1123,12 +1122,7 @@ unique_ptr<CatalogEntry> DuckTableEntry::AddForeignKeyConstraint(optional_ptr<Cl
|
|
1123
1122
|
make_uniq<ForeignKeyConstraint>(info.pk_columns, info.fk_columns, std::move(fk_info)));
|
1124
1123
|
|
1125
1124
|
unique_ptr<BoundCreateTableInfo> bound_create_info;
|
1126
|
-
|
1127
|
-
auto binder = Binder::CreateBinder(*context);
|
1128
|
-
bound_create_info = binder->BindCreateTableInfo(std::move(create_info), schema);
|
1129
|
-
} else {
|
1130
|
-
bound_create_info = Binder::BindCreateTableCheckpoint(std::move(create_info), schema);
|
1131
|
-
}
|
1125
|
+
bound_create_info = Binder::BindCreateTableCheckpoint(std::move(create_info), schema);
|
1132
1126
|
return make_uniq<DuckTableEntry>(catalog, schema, *bound_create_info, storage);
|
1133
1127
|
}
|
1134
1128
|
|
@@ -108,7 +108,7 @@ unique_ptr<CreateInfo> SequenceCatalogEntry::GetInfo() const {
|
|
108
108
|
string SequenceCatalogEntry::ToSQL() const {
|
109
109
|
auto seq_data = GetData();
|
110
110
|
|
111
|
-
|
111
|
+
duckdb::stringstream ss;
|
112
112
|
ss << "CREATE SEQUENCE ";
|
113
113
|
ss << name;
|
114
114
|
ss << " INCREMENT BY " << seq_data.increment;
|
@@ -79,7 +79,7 @@ unique_ptr<CreateInfo> TableCatalogEntry::GetInfo() const {
|
|
79
79
|
}
|
80
80
|
|
81
81
|
string TableCatalogEntry::ColumnsToSQL(const ColumnList &columns, const vector<unique_ptr<Constraint>> &constraints) {
|
82
|
-
|
82
|
+
duckdb::stringstream ss;
|
83
83
|
|
84
84
|
ss << "(";
|
85
85
|
|
@@ -185,7 +185,7 @@ string TableCatalogEntry::ColumnNamesToSQL(const ColumnList &columns) {
|
|
185
185
|
return "";
|
186
186
|
}
|
187
187
|
|
188
|
-
|
188
|
+
duckdb::stringstream ss;
|
189
189
|
ss << "(";
|
190
190
|
|
191
191
|
for (auto &column : columns.Logical()) {
|
@@ -149,10 +149,16 @@ string CatalogSearchPath::GetSetName(CatalogSetPathType set_type) {
|
|
149
149
|
}
|
150
150
|
|
151
151
|
void CatalogSearchPath::Set(vector<CatalogSearchEntry> new_paths, CatalogSetPathType set_type) {
|
152
|
-
if (set_type
|
152
|
+
if (set_type == CatalogSetPathType::SET_SCHEMA && new_paths.size() != 1) {
|
153
153
|
throw CatalogException("%s can set only 1 schema. This has %d", GetSetName(set_type), new_paths.size());
|
154
154
|
}
|
155
155
|
for (auto &path : new_paths) {
|
156
|
+
if (set_type == CatalogSetPathType::SET_DIRECTLY) {
|
157
|
+
if (path.catalog.empty() || path.schema.empty()) {
|
158
|
+
throw InternalException("SET_WITHOUT_VERIFICATION requires a fully qualified set path");
|
159
|
+
}
|
160
|
+
continue;
|
161
|
+
}
|
156
162
|
auto schema_entry = Catalog::GetSchema(context, path.catalog, path.schema, OnEntryNotFound::RETURN_NULL);
|
157
163
|
if (schema_entry) {
|
158
164
|
// we are setting a schema - update the catalog and schema
|
@@ -674,7 +674,7 @@ void CatalogSet::CreateDefaultEntries(CatalogTransaction transaction, unique_loc
|
|
674
674
|
}
|
675
675
|
|
676
676
|
void CatalogSet::Scan(CatalogTransaction transaction, const std::function<void(CatalogEntry &)> &callback) {
|
677
|
-
//
|
677
|
+
// Lock the catalog set.
|
678
678
|
unique_lock<mutex> lock(catalog_lock);
|
679
679
|
CreateDefaultEntries(transaction, lock);
|
680
680
|
|
@@ -687,10 +687,30 @@ void CatalogSet::Scan(CatalogTransaction transaction, const std::function<void(C
|
|
687
687
|
}
|
688
688
|
}
|
689
689
|
|
690
|
+
void CatalogSet::ScanWithReturn(CatalogTransaction transaction, const std::function<bool(CatalogEntry &)> &callback) {
|
691
|
+
// Lock the catalog set.
|
692
|
+
unique_lock<mutex> lock(catalog_lock);
|
693
|
+
CreateDefaultEntries(transaction, lock);
|
694
|
+
|
695
|
+
for (auto &kv : map.Entries()) {
|
696
|
+
auto &entry = *kv.second;
|
697
|
+
auto &entry_for_transaction = GetEntryForTransaction(transaction, entry);
|
698
|
+
if (!entry_for_transaction.deleted) {
|
699
|
+
if (!callback(entry_for_transaction)) {
|
700
|
+
return;
|
701
|
+
}
|
702
|
+
}
|
703
|
+
}
|
704
|
+
}
|
705
|
+
|
690
706
|
void CatalogSet::Scan(ClientContext &context, const std::function<void(CatalogEntry &)> &callback) {
|
691
707
|
Scan(catalog.GetCatalogTransaction(context), callback);
|
692
708
|
}
|
693
709
|
|
710
|
+
void CatalogSet::ScanWithReturn(ClientContext &context, const std::function<bool(CatalogEntry &)> &callback) {
|
711
|
+
ScanWithReturn(catalog.GetCatalogTransaction(context), callback);
|
712
|
+
}
|
713
|
+
|
694
714
|
void CatalogSet::ScanWithPrefix(CatalogTransaction transaction, const std::function<void(CatalogEntry &)> &callback,
|
695
715
|
const string &prefix) {
|
696
716
|
// lock the catalog set
|
@@ -1067,7 +1067,7 @@ AdbcStatusCode StatementSetOption(struct AdbcStatement *statement, const char *k
|
|
1067
1067
|
return ADBC_STATUS_INVALID_ARGUMENT;
|
1068
1068
|
}
|
1069
1069
|
}
|
1070
|
-
|
1070
|
+
duckdb::stringstream ss;
|
1071
1071
|
ss << "Statement Set Option " << key << " is not yet accepted by DuckDB";
|
1072
1072
|
SetError(error, ss.str());
|
1073
1073
|
return ADBC_STATUS_INVALID_ARGUMENT;
|
@@ -215,13 +215,25 @@ static void InitializeFunctionPointers(ArrowAppendData &append_data, const Logic
|
|
215
215
|
case LogicalTypeId::DECIMAL:
|
216
216
|
switch (type.InternalType()) {
|
217
217
|
case PhysicalType::INT16:
|
218
|
-
|
218
|
+
if (append_data.options.arrow_output_version > 14) {
|
219
|
+
InitializeAppenderForType<ArrowScalarData<int32_t, int16_t>>(append_data);
|
220
|
+
} else {
|
221
|
+
InitializeAppenderForType<ArrowScalarData<hugeint_t, int16_t>>(append_data);
|
222
|
+
}
|
219
223
|
break;
|
220
224
|
case PhysicalType::INT32:
|
221
|
-
|
225
|
+
if (append_data.options.arrow_output_version > 14) {
|
226
|
+
InitializeAppenderForType<ArrowScalarData<int32_t>>(append_data);
|
227
|
+
} else {
|
228
|
+
InitializeAppenderForType<ArrowScalarData<hugeint_t, int32_t>>(append_data);
|
229
|
+
}
|
222
230
|
break;
|
223
231
|
case PhysicalType::INT64:
|
224
|
-
|
232
|
+
if (append_data.options.arrow_output_version > 14) {
|
233
|
+
InitializeAppenderForType<ArrowScalarData<int64_t>>(append_data);
|
234
|
+
} else {
|
235
|
+
InitializeAppenderForType<ArrowScalarData<hugeint_t, int64_t>>(append_data);
|
236
|
+
}
|
225
237
|
break;
|
226
238
|
case PhysicalType::INT128:
|
227
239
|
InitializeAppenderForType<ArrowScalarData<hugeint_t>>(append_data);
|
@@ -231,7 +243,7 @@ static void InitializeFunctionPointers(ArrowAppendData &append_data, const Logic
|
|
231
243
|
}
|
232
244
|
break;
|
233
245
|
case LogicalTypeId::VARCHAR:
|
234
|
-
if (append_data.options.produce_arrow_string_view) {
|
246
|
+
if (append_data.options.produce_arrow_string_view && append_data.options.arrow_output_version >= 14) {
|
235
247
|
InitializeAppenderForType<ArrowVarcharToStringViewData>(append_data);
|
236
248
|
} else {
|
237
249
|
if (append_data.options.arrow_offset_size == ArrowOffsetSize::LARGE) {
|
@@ -278,7 +290,7 @@ static void InitializeFunctionPointers(ArrowAppendData &append_data, const Logic
|
|
278
290
|
InitializeAppenderForType<ArrowFixedSizeListData>(append_data);
|
279
291
|
break;
|
280
292
|
case LogicalTypeId::LIST: {
|
281
|
-
if (append_data.options.arrow_use_list_view) {
|
293
|
+
if (append_data.options.arrow_use_list_view && append_data.options.arrow_output_version >= 14) {
|
282
294
|
if (append_data.options.arrow_offset_size == ArrowOffsetSize::LARGE) {
|
283
295
|
InitializeAppenderForType<ArrowListViewData<>>(append_data);
|
284
296
|
} else {
|
@@ -173,7 +173,8 @@ void SetArrowFormat(DuckDBArrowSchemaHolder &root_holder, ArrowSchema &child, co
|
|
173
173
|
if (options.arrow_lossless_conversion) {
|
174
174
|
SetArrowExtension(root_holder, child, type, context);
|
175
175
|
} else {
|
176
|
-
if (options.produce_arrow_string_view) {
|
176
|
+
if (options.produce_arrow_string_view && options.arrow_output_version >= 14) {
|
177
|
+
// List views are only introduced in arrow format v1.4
|
177
178
|
child.format = "vu";
|
178
179
|
} else {
|
179
180
|
if (options.arrow_offset_size == ArrowOffsetSize::LARGE) {
|
@@ -186,7 +187,8 @@ void SetArrowFormat(DuckDBArrowSchemaHolder &root_holder, ArrowSchema &child, co
|
|
186
187
|
break;
|
187
188
|
}
|
188
189
|
case LogicalTypeId::VARCHAR:
|
189
|
-
if (options.produce_arrow_string_view) {
|
190
|
+
if (options.produce_arrow_string_view && options.arrow_output_version >= 14) {
|
191
|
+
// List views are only introduced in arrow format v1.4
|
190
192
|
child.format = "vu";
|
191
193
|
} else {
|
192
194
|
if (options.arrow_offset_size == ArrowOffsetSize::LARGE) {
|
@@ -233,19 +235,24 @@ void SetArrowFormat(DuckDBArrowSchemaHolder &root_holder, ArrowSchema &child, co
|
|
233
235
|
break;
|
234
236
|
case LogicalTypeId::DECIMAL: {
|
235
237
|
uint8_t width, scale, bit_width;
|
236
|
-
|
237
|
-
|
238
|
-
case PhysicalType::INT32:
|
239
|
-
bit_width = 32;
|
240
|
-
break;
|
241
|
-
case PhysicalType::INT64:
|
242
|
-
bit_width = 64;
|
243
|
-
break;
|
244
|
-
case PhysicalType::INT128:
|
238
|
+
if (options.arrow_output_version <= 14) {
|
239
|
+
// Before version 1.4 all decimals were int128
|
245
240
|
bit_width = 128;
|
246
|
-
|
247
|
-
|
248
|
-
|
241
|
+
} else {
|
242
|
+
switch (type.InternalType()) {
|
243
|
+
case PhysicalType::INT16:
|
244
|
+
case PhysicalType::INT32:
|
245
|
+
bit_width = 32;
|
246
|
+
break;
|
247
|
+
case PhysicalType::INT64:
|
248
|
+
bit_width = 64;
|
249
|
+
break;
|
250
|
+
case PhysicalType::INT128:
|
251
|
+
bit_width = 128;
|
252
|
+
break;
|
253
|
+
default:
|
254
|
+
throw NotImplementedException("Unsupported internal type For DUCKDB Decimal -> Arrow ");
|
255
|
+
}
|
249
256
|
}
|
250
257
|
|
251
258
|
type.GetDecimalProperties(width, scale);
|
@@ -279,7 +286,8 @@ void SetArrowFormat(DuckDBArrowSchemaHolder &root_holder, ArrowSchema &child, co
|
|
279
286
|
break;
|
280
287
|
}
|
281
288
|
case LogicalTypeId::LIST: {
|
282
|
-
if (options.arrow_use_list_view) {
|
289
|
+
if (options.arrow_use_list_view && options.arrow_output_version >= 14) {
|
290
|
+
// List views are only introduced in arrow format v1.4
|
283
291
|
if (options.arrow_offset_size == ArrowOffsetSize::LARGE) {
|
284
292
|
child.format = "+vL";
|
285
293
|
} else {
|
@@ -3,10 +3,9 @@
|
|
3
3
|
#include "duckdb/common/printer.hpp"
|
4
4
|
#include "duckdb/common/types/column/column_data_collection.hpp"
|
5
5
|
#include "duckdb/common/vector_operations/vector_operations.hpp"
|
6
|
+
#include "duckdb/original/std/sstream.hpp"
|
6
7
|
#include "utf8proc_wrapper.hpp"
|
7
8
|
|
8
|
-
#include <sstream>
|
9
|
-
|
10
9
|
namespace duckdb {
|
11
10
|
|
12
11
|
const idx_t BoxRenderer::SPLIT_COLUMN = idx_t(-1);
|
@@ -1719,19 +1719,20 @@ const StringUtil::EnumStringLiteral *GetFileBufferTypeValues() {
|
|
1719
1719
|
static constexpr StringUtil::EnumStringLiteral values[] {
|
1720
1720
|
{ static_cast<uint32_t>(FileBufferType::BLOCK), "BLOCK" },
|
1721
1721
|
{ static_cast<uint32_t>(FileBufferType::MANAGED_BUFFER), "MANAGED_BUFFER" },
|
1722
|
-
{ static_cast<uint32_t>(FileBufferType::TINY_BUFFER), "TINY_BUFFER" }
|
1722
|
+
{ static_cast<uint32_t>(FileBufferType::TINY_BUFFER), "TINY_BUFFER" },
|
1723
|
+
{ static_cast<uint32_t>(FileBufferType::EXTERNAL_FILE), "EXTERNAL_FILE" }
|
1723
1724
|
};
|
1724
1725
|
return values;
|
1725
1726
|
}
|
1726
1727
|
|
1727
1728
|
template<>
|
1728
1729
|
const char* EnumUtil::ToChars<FileBufferType>(FileBufferType value) {
|
1729
|
-
return StringUtil::EnumToString(GetFileBufferTypeValues(),
|
1730
|
+
return StringUtil::EnumToString(GetFileBufferTypeValues(), 4, "FileBufferType", static_cast<uint32_t>(value));
|
1730
1731
|
}
|
1731
1732
|
|
1732
1733
|
template<>
|
1733
1734
|
FileBufferType EnumUtil::FromString<FileBufferType>(const char *value) {
|
1734
|
-
return static_cast<FileBufferType>(StringUtil::StringToEnum(GetFileBufferTypeValues(),
|
1735
|
+
return static_cast<FileBufferType>(StringUtil::StringToEnum(GetFileBufferTypeValues(), 4, "FileBufferType", value));
|
1735
1736
|
}
|
1736
1737
|
|
1737
1738
|
const StringUtil::EnumStringLiteral *GetFileCompressionTypeValues() {
|
@@ -696,7 +696,7 @@ bool LocalFileSystem::ListFilesExtended(const string &directory,
|
|
696
696
|
}
|
697
697
|
|
698
698
|
// RAII wrapper around DIR to automatically free on exceptions in callback
|
699
|
-
|
699
|
+
duckdb::unique_ptr<DIR, std::function<void(DIR *)>> dir_unique_ptr(dir, [](DIR *d) { closedir(d); });
|
700
700
|
|
701
701
|
struct dirent *ent;
|
702
702
|
// loop over all files in the directory
|
@@ -838,13 +838,13 @@ static string AdditionalLockInfo(const std::wstring path) {
|
|
838
838
|
|
839
839
|
status = RmStartSession(&session, 0, session_key);
|
840
840
|
if (status != ERROR_SUCCESS) {
|
841
|
-
return
|
841
|
+
return string();
|
842
842
|
}
|
843
843
|
|
844
844
|
PCWSTR path_ptr = path.c_str();
|
845
845
|
status = RmRegisterResources(session, 1, &path_ptr, 0, NULL, 0, NULL);
|
846
846
|
if (status != ERROR_SUCCESS) {
|
847
|
-
return
|
847
|
+
return string();
|
848
848
|
}
|
849
849
|
UINT process_info_size_needed, process_info_size;
|
850
850
|
|
@@ -852,7 +852,7 @@ static string AdditionalLockInfo(const std::wstring path) {
|
|
852
852
|
process_info_size = 0;
|
853
853
|
status = RmGetList(session, &process_info_size_needed, &process_info_size, NULL, &reason);
|
854
854
|
if (status != ERROR_MORE_DATA || process_info_size_needed == 0) {
|
855
|
-
return
|
855
|
+
return string();
|
856
856
|
}
|
857
857
|
|
858
858
|
// allocate
|
@@ -866,8 +866,7 @@ static string AdditionalLockInfo(const std::wstring path) {
|
|
866
866
|
return "";
|
867
867
|
}
|
868
868
|
|
869
|
-
string conflict_string
|
870
|
-
|
869
|
+
string conflict_string;
|
871
870
|
for (UINT process_idx = 0; process_idx < process_info_size; process_idx++) {
|
872
871
|
string process_name = WindowsUtil::UnicodeToUTF8(process_info[process_idx].strAppName);
|
873
872
|
auto pid = process_info[process_idx].Process.dwProcessId;
|
@@ -886,7 +885,10 @@ static string AdditionalLockInfo(const std::wstring path) {
|
|
886
885
|
}
|
887
886
|
|
888
887
|
RmEndSession(session);
|
889
|
-
|
888
|
+
if (conflict_string.empty()) {
|
889
|
+
return string();
|
890
|
+
}
|
891
|
+
return "File is already open in " + conflict_string;
|
890
892
|
}
|
891
893
|
|
892
894
|
bool LocalFileSystem::IsPrivateFile(const string &path_p, FileOpener *opener) {
|
@@ -950,12 +952,11 @@ unique_ptr<FileHandle> LocalFileSystem::OpenFile(const string &path_p, FileOpenF
|
|
950
952
|
}
|
951
953
|
auto error = LocalFileSystem::GetLastErrorAsString();
|
952
954
|
|
953
|
-
auto
|
954
|
-
if (!
|
955
|
-
|
956
|
-
} else {
|
957
|
-
throw IOException("Cannot open file \"%s\": %s", path.c_str(), error);
|
955
|
+
auto extended_error = AdditionalLockInfo(unicode_path);
|
956
|
+
if (!extended_error.empty()) {
|
957
|
+
extended_error = "\n" + extended_error;
|
958
958
|
}
|
959
|
+
throw IOException("Cannot open file \"%s\": %s%s", path.c_str(), error, extended_error);
|
959
960
|
}
|
960
961
|
auto handle = make_uniq<WindowsFileHandle>(*this, path.c_str(), hFile, flags);
|
961
962
|
if (flags.OpenForAppending()) {
|
@@ -18,11 +18,10 @@ MultiFileColumnMapper::MultiFileColumnMapper(ClientContext &context, MultiFileRe
|
|
18
18
|
const vector<MultiFileColumnDefinition> &global_columns,
|
19
19
|
const vector<ColumnIndex> &global_column_ids,
|
20
20
|
optional_ptr<TableFilterSet> filters, MultiFileList &multi_file_list,
|
21
|
-
const MultiFileReaderBindData &bind_data,
|
22
21
|
const virtual_column_map_t &virtual_columns)
|
23
22
|
: context(context), multi_file_reader(multi_file_reader), multi_file_list(multi_file_list),
|
24
23
|
reader_data(reader_data), global_columns(global_columns), global_column_ids(global_column_ids),
|
25
|
-
global_filters(filters),
|
24
|
+
global_filters(filters), virtual_columns(virtual_columns) {
|
26
25
|
}
|
27
26
|
|
28
27
|
struct MultiFileIndexMapping {
|
@@ -297,6 +296,19 @@ ColumnMapResult MapColumnList(ClientContext &context, const MultiFileColumnDefin
|
|
297
296
|
result.column_map = Value::STRUCT(std::move(child_list));
|
298
297
|
}
|
299
298
|
}
|
299
|
+
if (is_selected && child_map.default_value) {
|
300
|
+
// we have default values at a previous level wrap it in a "list"
|
301
|
+
child_list_t<LogicalType> default_type_list;
|
302
|
+
default_type_list.emplace_back("list", child_map.default_value->return_type);
|
303
|
+
vector<unique_ptr<Expression>> default_expressions;
|
304
|
+
child_map.default_value->alias = "list";
|
305
|
+
default_expressions.push_back(std::move(child_map.default_value));
|
306
|
+
auto default_type = LogicalType::STRUCT(std::move(default_type_list));
|
307
|
+
auto struct_pack_fun = StructPackFun::GetFunction();
|
308
|
+
auto bind_data = make_uniq<VariableReturnBindData>(default_type);
|
309
|
+
result.default_value = make_uniq<BoundFunctionExpression>(std::move(default_type), std::move(struct_pack_fun),
|
310
|
+
std::move(default_expressions), std::move(bind_data));
|
311
|
+
}
|
300
312
|
result.column_index = make_uniq<ColumnIndex>(local_id.GetId(), std::move(child_indexes));
|
301
313
|
result.mapping = std::move(mapping);
|
302
314
|
return result;
|
@@ -347,7 +359,7 @@ ColumnMapResult MapColumnMap(ClientContext &context, const MultiFileColumnDefini
|
|
347
359
|
|
348
360
|
auto nested_mapper = mapper.Create(local_key_value.children);
|
349
361
|
child_list_t<Value> column_mapping;
|
350
|
-
unique_ptr<Expression
|
362
|
+
vector<unique_ptr<Expression>> default_expressions;
|
351
363
|
unordered_map<idx_t, const_reference<ColumnIndex>> selected_children;
|
352
364
|
if (global_index.HasChildren()) {
|
353
365
|
//! FIXME: is this expected for maps??
|
@@ -378,6 +390,10 @@ ColumnMapResult MapColumnMap(ClientContext &context, const MultiFileColumnDefini
|
|
378
390
|
// found a column mapping for the component - emplace it
|
379
391
|
column_mapping.emplace_back(name, std::move(map_result.column_map));
|
380
392
|
}
|
393
|
+
if (map_result.default_value) {
|
394
|
+
map_result.default_value->alias = name;
|
395
|
+
default_expressions.push_back(std::move(map_result.default_value));
|
396
|
+
}
|
381
397
|
}
|
382
398
|
|
383
399
|
ColumnMapResult result;
|
@@ -393,6 +409,18 @@ ColumnMapResult MapColumnMap(ClientContext &context, const MultiFileColumnDefini
|
|
393
409
|
result.column_map = Value::STRUCT(std::move(child_list));
|
394
410
|
}
|
395
411
|
}
|
412
|
+
if (!default_expressions.empty()) {
|
413
|
+
// we have default values at a previous level wrap it in a "list"
|
414
|
+
child_list_t<LogicalType> default_type_list;
|
415
|
+
for (auto &expr : default_expressions) {
|
416
|
+
default_type_list.emplace_back(expr->GetAlias(), expr->return_type);
|
417
|
+
}
|
418
|
+
auto default_type = LogicalType::STRUCT(std::move(default_type_list));
|
419
|
+
auto struct_pack_fun = StructPackFun::GetFunction();
|
420
|
+
auto bind_data = make_uniq<VariableReturnBindData>(default_type);
|
421
|
+
result.default_value = make_uniq<BoundFunctionExpression>(std::move(default_type), std::move(struct_pack_fun),
|
422
|
+
std::move(default_expressions), std::move(bind_data));
|
423
|
+
}
|
396
424
|
vector<ColumnIndex> map_indexes;
|
397
425
|
map_indexes.emplace_back(0, std::move(child_indexes));
|
398
426
|
|
@@ -563,11 +591,6 @@ unique_ptr<Expression> ConstructMapExpression(ClientContext &context, idx_t loca
|
|
563
591
|
}
|
564
592
|
return expr;
|
565
593
|
}
|
566
|
-
// struct column - generate a remap_struct - but only if we have any columns to remap
|
567
|
-
if (mapping.column_map.IsNull()) {
|
568
|
-
// no columns to map - emit the default value directly
|
569
|
-
return std::move(mapping.default_value);
|
570
|
-
}
|
571
594
|
// generate the remap_struct function call
|
572
595
|
vector<unique_ptr<Expression>> children;
|
573
596
|
children.push_back(std::move(expr));
|
@@ -719,10 +742,10 @@ ResultColumnMapping MultiFileColumnMapper::CreateColumnMappingByMapper(const Col
|
|
719
742
|
return result;
|
720
743
|
}
|
721
744
|
|
722
|
-
ResultColumnMapping MultiFileColumnMapper::CreateColumnMapping() {
|
745
|
+
ResultColumnMapping MultiFileColumnMapper::CreateColumnMapping(MultiFileColumnMappingMode mapping_mode) {
|
723
746
|
auto &reader = *reader_data.reader;
|
724
747
|
auto &local_columns = reader.GetColumns();
|
725
|
-
switch (
|
748
|
+
switch (mapping_mode) {
|
726
749
|
case MultiFileColumnMappingMode::BY_NAME: {
|
727
750
|
// we have expected types: create a map of name -> (local) column id
|
728
751
|
NameMapper name_map(*this, local_columns);
|
@@ -1083,9 +1106,9 @@ unique_ptr<TableFilterSet> MultiFileColumnMapper::CreateFilters(map<idx_t, refer
|
|
1083
1106
|
return result;
|
1084
1107
|
}
|
1085
1108
|
|
1086
|
-
ReaderInitializeType MultiFileColumnMapper::CreateMapping() {
|
1109
|
+
ReaderInitializeType MultiFileColumnMapper::CreateMapping(MultiFileColumnMappingMode mapping_mode) {
|
1087
1110
|
// copy global columns and inject any different defaults
|
1088
|
-
auto result = CreateColumnMapping();
|
1111
|
+
auto result = CreateColumnMapping(mapping_mode);
|
1089
1112
|
//! Evaluate the filters against the column(s) that are constant for this file (not present in the local schema)
|
1090
1113
|
//! If any of these fail, the file can be skipped entirely
|
1091
1114
|
map<idx_t, reference<TableFilter>> remaining_filters;
|
@@ -371,13 +371,23 @@ MultiFileReader::InitializeGlobalState(ClientContext &context, const MultiFileOp
|
|
371
371
|
return nullptr;
|
372
372
|
}
|
373
373
|
|
374
|
+
ReaderInitializeType
|
375
|
+
MultiFileReader::CreateMapping(ClientContext &context, MultiFileReaderData &reader_data,
|
376
|
+
const vector<MultiFileColumnDefinition> &global_columns,
|
377
|
+
const vector<ColumnIndex> &global_column_ids, optional_ptr<TableFilterSet> filters,
|
378
|
+
MultiFileList &multi_file_list, const MultiFileReaderBindData &bind_data,
|
379
|
+
const virtual_column_map_t &virtual_columns, MultiFileColumnMappingMode mapping_mode) {
|
380
|
+
MultiFileColumnMapper column_mapper(context, *this, reader_data, global_columns, global_column_ids, filters,
|
381
|
+
multi_file_list, virtual_columns);
|
382
|
+
return column_mapper.CreateMapping(mapping_mode);
|
383
|
+
}
|
384
|
+
|
374
385
|
ReaderInitializeType MultiFileReader::CreateMapping(
|
375
386
|
ClientContext &context, MultiFileReaderData &reader_data, const vector<MultiFileColumnDefinition> &global_columns,
|
376
387
|
const vector<ColumnIndex> &global_column_ids, optional_ptr<TableFilterSet> filters, MultiFileList &multi_file_list,
|
377
388
|
const MultiFileReaderBindData &bind_data, const virtual_column_map_t &virtual_columns) {
|
378
|
-
|
379
|
-
|
380
|
-
return column_mapper.CreateMapping();
|
389
|
+
return CreateMapping(context, reader_data, global_columns, global_column_ids, filters, multi_file_list, bind_data,
|
390
|
+
virtual_columns, bind_data.mapping);
|
381
391
|
}
|
382
392
|
|
383
393
|
string GetExtendedMultiFileError(const MultiFileBindData &bind_data, const Expression &expr, BaseFileReader &reader,
|
@@ -7,6 +7,7 @@
|
|
7
7
|
#include "duckdb/common/helper.hpp"
|
8
8
|
#include "duckdb/common/exception/parser_exception.hpp"
|
9
9
|
#include "duckdb/common/random_engine.hpp"
|
10
|
+
#include "duckdb/original/std/sstream.hpp"
|
10
11
|
#include "jaro_winkler.hpp"
|
11
12
|
#include "utf8proc_wrapper.hpp"
|
12
13
|
|
@@ -14,7 +15,6 @@
|
|
14
15
|
#include <cctype>
|
15
16
|
#include <iomanip>
|
16
17
|
#include <memory>
|
17
|
-
#include <sstream>
|
18
18
|
#include <stdarg.h>
|
19
19
|
#include <string.h>
|
20
20
|
#include <stack>
|
@@ -27,7 +27,7 @@ namespace duckdb {
|
|
27
27
|
|
28
28
|
string StringUtil::GenerateRandomName(idx_t length) {
|
29
29
|
RandomEngine engine;
|
30
|
-
|
30
|
+
duckdb::stringstream ss;
|
31
31
|
for (idx_t i = 0; i < length; i++) {
|
32
32
|
ss << "0123456789abcdef"[engine.NextRandomInteger(0, 15)];
|
33
33
|
}
|
@@ -105,7 +105,7 @@ string StringUtil::Repeat(const string &str, idx_t n) {
|
|
105
105
|
namespace string_util_internal {
|
106
106
|
|
107
107
|
inline void SkipSpaces(const string &str, idx_t &index) {
|
108
|
-
while (index < str.size() &&
|
108
|
+
while (index < str.size() && StringUtil::CharacterIsSpace(str[index])) {
|
109
109
|
index++;
|
110
110
|
}
|
111
111
|
}
|
@@ -136,7 +136,9 @@ inline string TakePossiblyQuotedItem(const string &str, idx_t &index, char delim
|
|
136
136
|
ConsumeLetter(str, index, quote);
|
137
137
|
} else {
|
138
138
|
TakeWhile(
|
139
|
-
str, index,
|
139
|
+
str, index,
|
140
|
+
[delimiter, quote](char c) { return c != delimiter && c != quote && !StringUtil::CharacterIsSpace(c); },
|
141
|
+
entry);
|
140
142
|
}
|
141
143
|
|
142
144
|
return entry;
|
@@ -342,7 +344,7 @@ idx_t StringUtil::CIFind(vector<string> &vector, const string &search_string) {
|
|
342
344
|
}
|
343
345
|
|
344
346
|
vector<string> StringUtil::Split(const string &str, char delimiter) {
|
345
|
-
|
347
|
+
duckdb::stringstream ss(str);
|
346
348
|
vector<string> lines;
|
347
349
|
string temp;
|
348
350
|
while (getline(ss, temp, delimiter)) {
|
@@ -16,25 +16,25 @@
|
|
16
16
|
namespace duckdb {
|
17
17
|
|
18
18
|
string GRAPHVIZTreeRenderer::ToString(const LogicalOperator &op) {
|
19
|
-
|
19
|
+
duckdb::stringstream ss;
|
20
20
|
Render(op, ss);
|
21
21
|
return ss.str();
|
22
22
|
}
|
23
23
|
|
24
24
|
string GRAPHVIZTreeRenderer::ToString(const PhysicalOperator &op) {
|
25
|
-
|
25
|
+
duckdb::stringstream ss;
|
26
26
|
Render(op, ss);
|
27
27
|
return ss.str();
|
28
28
|
}
|
29
29
|
|
30
30
|
string GRAPHVIZTreeRenderer::ToString(const ProfilingNode &op) {
|
31
|
-
|
31
|
+
duckdb::stringstream ss;
|
32
32
|
Render(op, ss);
|
33
33
|
return ss.str();
|
34
34
|
}
|
35
35
|
|
36
36
|
string GRAPHVIZTreeRenderer::ToString(const Pipeline &op) {
|
37
|
-
|
37
|
+
duckdb::stringstream ss;
|
38
38
|
Render(op, ss);
|
39
39
|
return ss.str();
|
40
40
|
}
|