diff --git a/lib/src/webdb.cc b/lib/src/webdb.cc index e728c7e31..1886d72e0 100644 --- a/lib/src/webdb.cc +++ b/lib/src/webdb.cc @@ -103,7 +103,7 @@ arrow::Result> WebDB::Connection::MaterializeQuer // Configure the output writer ArrowSchema raw_schema; - ClientProperties options; + ClientProperties options("UTC", ArrowOffsetSize::REGULAR, false, false, false, connection_.context); unordered_map> extension_type_cast; options.arrow_offset_size = ArrowOffsetSize::REGULAR; ArrowConverter::ToArrowSchema(&raw_schema, result->types, result->names, options); @@ -139,7 +139,7 @@ arrow::Result> WebDB::Connection::StreamQueryResu // Import the schema ArrowSchema raw_schema; - ClientProperties options; + ClientProperties options("UTC", ArrowOffsetSize::REGULAR, false, false, false, connection_.context); options.arrow_offset_size = ArrowOffsetSize::REGULAR; ArrowConverter::ToArrowSchema(&raw_schema, current_query_result_->types, current_query_result_->names, options); ARROW_ASSIGN_OR_RAISE(current_schema_, arrow::ImportSchema(&raw_schema)); @@ -251,7 +251,7 @@ arrow::Result> WebDB::Connection::FetchQueryResul // Serialize the record batch ArrowArray array; - ClientProperties arrow_options; + ClientProperties arrow_options("UTC", ArrowOffsetSize::REGULAR, false, false, false, connection_.context); unordered_map> extension_type_cast; arrow_options.arrow_offset_size = ArrowOffsetSize::REGULAR; ArrowConverter::ToArrowArray(*chunk, &array, arrow_options, extension_type_cast); diff --git a/patches/duckdb/add_constructor_client_properties.patch b/patches/duckdb/add_constructor_client_properties.patch deleted file mode 100644 index b3d7fc6f4..000000000 --- a/patches/duckdb/add_constructor_client_properties.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/src/include/duckdb/main/client_properties.hpp b/src/include/duckdb/main/client_properties.hpp -index a4038a7353..d3a269ea36 100644 ---- a/src/include/duckdb/main/client_properties.hpp -+++ b/src/include/duckdb/main/client_properties.hpp -@@ -26,6 +26,7 @@ struct ClientProperties { - arrow_use_list_view(arrow_use_list_view_p), produce_arrow_string_view(produce_arrow_string_view_p), - arrow_lossless_conversion(lossless_conversion), client_context(client_context) { - } -+ ClientProperties() {} - - string time_zone = "UTC"; - ArrowOffsetSize arrow_offset_size = ArrowOffsetSize::REGULAR; diff --git a/patches/duckdb/arrow_appender_opt_client_context.patch b/patches/duckdb/arrow_appender_opt_client_context.patch deleted file mode 100644 index 652c410c1..000000000 --- a/patches/duckdb/arrow_appender_opt_client_context.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/src/common/arrow/arrow_appender.cpp b/src/common/arrow/arrow_appender.cpp -index 83f190b570..60c4b36268 100644 ---- a/src/common/arrow/arrow_appender.cpp -+++ b/src/common/arrow/arrow_appender.cpp -@@ -40,8 +40,10 @@ void ArrowAppender::Append(DataChunk &input, const idx_t from, const idx_t to, c - for (idx_t i = 0; i < input.ColumnCount(); i++) { - if (root_data[i]->extension_data && root_data[i]->extension_data->duckdb_to_arrow) { - Vector input_data(root_data[i]->extension_data->GetInternalType()); -+ if (options.client_context) { - root_data[i]->extension_data->duckdb_to_arrow(*options.client_context, input.data[i], input_data, - input_size); -+ } - root_data[i]->append_vector(*root_data[i], input_data, from, to, input_size); - } else { - root_data[i]->append_vector(*root_data[i], input.data[i], from, to, input_size); diff --git a/patches/duckdb/arrow_converter_opt_client_context.patch b/patches/duckdb/arrow_converter_opt_client_context.patch deleted file mode 100644 index 1a6ba0f11..000000000 --- a/patches/duckdb/arrow_converter_opt_client_context.patch +++ /dev/null @@ -1,52 +0,0 @@ -diff --git a/src/common/arrow/arrow_converter.cpp b/src/common/arrow/arrow_converter.cpp -index 02b3999a06..54fb3009d1 100644 ---- a/src/common/arrow/arrow_converter.cpp -+++ b/src/common/arrow/arrow_converter.cpp -@@ -59,10 +59,10 @@ void InitializeChild(ArrowSchema &child, DuckDBArrowSchemaHolder &root_holder, c - } - - void SetArrowFormat(DuckDBArrowSchemaHolder &root_holder, ArrowSchema &child, const LogicalType &type, -- ClientProperties &options, ClientContext &context); -+ ClientProperties &options, optional_ptr context); - - void SetArrowMapFormat(DuckDBArrowSchemaHolder &root_holder, ArrowSchema &child, const LogicalType &type, -- ClientProperties &options, ClientContext &context) { -+ ClientProperties &options, optional_ptr context) { - child.format = "+m"; - //! Map has one child which is a struct - child.n_children = 1; -@@ -78,18 +78,21 @@ void SetArrowMapFormat(DuckDBArrowSchemaHolder &root_holder, ArrowSchema &child, - } - - bool SetArrowExtension(DuckDBArrowSchemaHolder &root_holder, ArrowSchema &child, const LogicalType &type, -- ClientContext &context) { -- auto &config = DBConfig::GetConfig(context); -+ optional_ptr context) { -+ if (!context) { -+ return false; -+ } -+ auto &config = DBConfig::GetConfig(*context); - if (config.HasArrowExtension(type)) { - auto arrow_extension = config.GetArrowExtension(type); -- arrow_extension.PopulateArrowSchema(root_holder, child, type, context, arrow_extension); -+ arrow_extension.PopulateArrowSchema(root_holder, child, type, *context, arrow_extension); - return true; - } - return false; - } - - void SetArrowFormat(DuckDBArrowSchemaHolder &root_holder, ArrowSchema &child, const LogicalType &type, -- ClientProperties &options, ClientContext &context) { -+ ClientProperties &options, optional_ptr context) { - if (type.HasAlias()) { - // If it is a json type, we only export it as json if arrow_lossless_conversion = True - if (!(type.IsJSONType() && !options.arrow_lossless_conversion)) { -@@ -403,7 +406,7 @@ void ArrowConverter::ToArrowSchema(ArrowSchema *out_schema, const vectorowned_column_names.push_back(AddName(names[col_idx])); - auto &child = root_holder->children[col_idx]; - InitializeChild(child, *root_holder, names[col_idx]); -- SetArrowFormat(*root_holder, child, types[col_idx], options, *options.client_context); -+ SetArrowFormat(*root_holder, child, types[col_idx], options, options.client_context); - } - - // Release ownership to caller