Skip to content

Commit

Permalink
fix column is decimalv3 cast to decimalv2 make be core (apache#26204)
Browse files Browse the repository at this point in the history
  • Loading branch information
amorynan authored Nov 1, 2023
1 parent d7ea4d3 commit f8a594c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion be/src/vec/sink/vmysql_result_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,15 @@ Status VMysqlResultWriter<is_binary_format>::append_block(Block& input_block) {
// from expr
DataTypeSerDeSPtr serde;
if (_output_vexpr_ctxs[i]->root()->type().is_decimal_v2_type()) {
serde = std::make_shared<DataTypeDecimalSerDe<vectorized::Decimal128>>(scale, 27);
if (_output_vexpr_ctxs[i]->root()->is_nullable()) {
auto nested_serde =
std::make_shared<DataTypeDecimalSerDe<vectorized::Decimal128>>(scale,
27);
serde = std::make_shared<DataTypeNullableSerDe>(nested_serde);
} else {
serde = std::make_shared<DataTypeDecimalSerDe<vectorized::Decimal128>>(scale,
27);
}
} else {
serde = block.get_by_position(i).type->get_serde();
}
Expand Down

0 comments on commit f8a594c

Please sign in to comment.