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

branch-2.1: [fix](serde)fix arrow serde with no value into column #48053 #48097

Open
wants to merge 1 commit into
base: branch-2.1
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
14 changes: 13 additions & 1 deletion be/src/vec/data_types/serde/data_type_date64_serde.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ Status DataTypeDate64SerDe::serialize_one_cell_to_json(const IColumn& column, in
auto result = check_column_const_set_readability(column, row_num);
ColumnPtr ptr = result.first;
row_num = result.second;

Int64 int_val = assert_cast<const ColumnInt64&>(*ptr).get_element(row_num);
if (options.date_olap_format) {
tm time_tm;
Expand Down Expand Up @@ -236,6 +235,19 @@ void DataTypeDate64SerDe::read_column_from_arrow(IColumn& column, const arrow::A
v.cast_to_date();
col_data.emplace_back(binary_cast<VecDateTimeValue, Int64>(v));
}
} else if (arrow_array->type()->id() == arrow::Type::STRING) {
// to be compatible with old version, we use string type for date.
auto concrete_array = dynamic_cast<const arrow::StringArray*>(arrow_array);
for (size_t value_i = start; value_i < end; ++value_i) {
Int64 val = 0;
auto val_str = concrete_array->GetString(value_i);
ReadBuffer rb(val_str.data(), val_str.size());
read_datetime_text_impl(val, rb, ctz);
col_data.emplace_back(val);
}
} else {
throw doris::Exception(doris::ErrorCode::INVALID_ARGUMENT,
"Unsupported Arrow Type: " + arrow_array->type()->name());
}
}

Expand Down
Loading