Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating to get arrow appender options from the client context #15

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions src/arrow_to_ipc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "duckdb/common/arrow/arrow_converter.hpp"
#include "duckdb/parser/parsed_data/create_table_function_info.hpp"
#include "duckdb/function/table/arrow.hpp"
#include "duckdb/common/arrow/arrow_options.hpp"
#include "duckdb/main/client_properties.hpp"
#endif

namespace duckdb {
Expand Down Expand Up @@ -72,10 +72,7 @@ unique_ptr<FunctionData> ToArrowIPCFunction::Bind(ClientContext &context, TableF

// Create the Arrow schema
ArrowSchema schema;
ArrowOptions options;
options.time_zone = context.GetClientProperties().time_zone;
options.offset_size = ArrowOffsetSize::REGULAR;
ArrowConverter::ToArrowSchema(&schema, input.input_table_types, input.input_table_names, options);
ArrowConverter::ToArrowSchema(&schema, input.input_table_types, input.input_table_names, context.GetClientProperties());
result->schema = arrow::ImportSchema(&schema).ValueOrDie();

return std::move(result);
Expand All @@ -91,9 +88,6 @@ OperatorResultType ToArrowIPCFunction::Function(ExecutionContext &context, Table
bool sending_schema = false;

bool caching_disabled = context.pipeline && !context.pipeline->GetSink();
ArrowOptions options;
options.offset_size = ArrowOffsetSize::REGULAR;
// bool caching_disabled = true;

if (!local_state.checked_schema) {
if (!global_state.sent_schema) {
Expand All @@ -113,7 +107,7 @@ OperatorResultType ToArrowIPCFunction::Function(ExecutionContext &context, Table
output.data[1].SetValue(0, Value::BOOLEAN(1));
} else {
if (!local_state.appender) {
local_state.appender = make_uniq<ArrowAppender>(input.GetTypes(), data.chunk_size, options);
local_state.appender = make_uniq<ArrowAppender>(input.GetTypes(), data.chunk_size, context.client.GetClientProperties());
}

// Append input chunk
Expand Down