Skip to content

Commit

Permalink
[Improve](serde) support text serde for nested type-array/map pick from
Browse files Browse the repository at this point in the history
  • Loading branch information
amorynan authored Aug 25, 2023
1 parent e2b9458 commit 8930f42
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion be/src/vec/data_types/data_type_decimal.h
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ class DataTypeDecimal final : public IDataType {
void to_string(const IColumn& column, size_t row_num, BufferWritable& ostr) const override;
Status from_string(ReadBuffer& rb, IColumn* column) const override;
DataTypeSerDeSPtr get_serde() const override {
return std::make_shared<DataTypeDecimalSerDe<T>>(scale);
return std::make_shared<DataTypeDecimalSerDe<T>>(scale, precision);
};

/// Decimal specific
Expand Down
1 change: 1 addition & 0 deletions be/src/vec/data_types/serde/data_type_date64_serde.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

#include "gutil/casts.h"
#include "vec/columns/column_const.h"
#include "vec/io/io_helper.h"

namespace doris {
namespace vectorized {
Expand Down
1 change: 1 addition & 0 deletions be/src/vec/data_types/serde/data_type_datetimev2_serde.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

#include "gutil/casts.h"
#include "vec/columns/column_const.h"
#include "vec/io/io_helper.h"

namespace doris {
namespace vectorized {
Expand Down
1 change: 1 addition & 0 deletions be/src/vec/data_types/serde/data_type_datev2_serde.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

#include "gutil/casts.h"
#include "vec/columns/column_const.h"
#include "vec/io/io_helper.h"

namespace doris {
namespace vectorized {
Expand Down
1 change: 1 addition & 0 deletions be/src/vec/data_types/serde/data_type_decimal_serde.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "gutil/casts.h"
#include "vec/columns/column_decimal.h"
#include "vec/common/arithmetic_overflow.h"
#include "vec/io/io_helper.h"

namespace doris {

Expand Down
4 changes: 3 additions & 1 deletion be/src/vec/data_types/serde/data_type_decimal_serde.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ class DataTypeDecimalSerDe : public DataTypeSerDe {
__builtin_unreachable();
}

DataTypeDecimalSerDe(int scale_)
DataTypeDecimalSerDe(int scale_, int precision_)
: scale(scale_),
precision(precision_),
scale_multiplier(decimal_scale_multiplier<typename T::NativeType>(scale)) {}

void serialize_one_cell_to_text(const IColumn& column, int row_num, BufferWritable& bw,
Expand Down Expand Up @@ -105,6 +106,7 @@ class DataTypeDecimalSerDe : public DataTypeSerDe {
int row_idx, bool col_const) const;

int scale;
int precision;
const T::NativeType scale_multiplier;
mutable char buf[T::max_string_length()];
};
Expand Down
3 changes: 2 additions & 1 deletion be/src/vec/data_types/serde/data_type_jsonb_serde.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@

#include "data_type_jsonb_serde.h"

#include <arrow/array/builder_binary.h>
#include "arrow/array/builder_binary.h"
#include "runtime/jsonb_value.h"
namespace doris {
namespace vectorized {

Expand Down
3 changes: 3 additions & 0 deletions be/src/vec/data_types/serde/data_type_number_serde.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
#include <type_traits>

#include "gutil/casts.h"
#include "gutil/strings/numbers.h"
#include "util/mysql_global.h"
#include "vec/io/io_helper.h"

namespace doris {
namespace vectorized {
Expand Down
1 change: 1 addition & 0 deletions be/src/vec/data_types/serde/data_type_serde.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "vec/columns/column_nullable.h"
#include "vec/common/pod_array.h"
#include "vec/common/pod_array_fwd.h"
#include "vec/common/string_buffer.hpp"
#include "vec/core/types.h"

namespace arrow {
Expand Down

0 comments on commit 8930f42

Please sign in to comment.