Skip to content

Commit

Permalink
update ip
Browse files Browse the repository at this point in the history
  • Loading branch information
amorynan committed Nov 5, 2024
1 parent 77e21a0 commit 48311fd
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 23 deletions.
20 changes: 0 additions & 20 deletions be/src/vec/data_types/serde/data_type_ipv4_serde.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,26 +92,6 @@ Status DataTypeIPv4SerDe::deserialize_one_cell_from_json(IColumn& column, Slice&
return Status::OK();
}

void DataTypeIPv4SerDe::read_one_cell_from_jsonb(IColumn& column, const JsonbValue* arg) const {
if (arg->isInt32()) {
// old value format
assert_cast<ColumnIPv4&>(column).insert_value(
static_cast<const JsonbInt32Val*>(arg)->val());
return;
}
const auto jsonb_ipv4 = static_cast<const JsonbInt64Val*>(arg)->val();
const IPv4* ip_val = reinterpret_cast<const IPv4*>(&jsonb_ipv4);
assert_cast<ColumnIPv4&>(column).insert_value(*ip_val);
}

void DataTypeIPv4SerDe::write_one_cell_to_jsonb(const IColumn& column,
JsonbWriterT<JsonbOutStream>& result,
Arena* mem_pool, int col_id, int row_num) const {
result.writeKey(col_id);
IPv4 data = assert_cast<const ColumnIPv4&>(column).get_element(row_num);
result.writeInt64(int64_t(data));
}

Status DataTypeIPv4SerDe::write_column_to_pb(const IColumn& column, PValues& result, int start,
int end) const {
const auto& column_data = assert_cast<const ColumnIPv4&>(column).get_data();
Expand Down
3 changes: 0 additions & 3 deletions be/src/vec/data_types/serde/data_type_ipv4_serde.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ class DataTypeIPv4SerDe : public DataTypeNumberSerDe<IPv4> {
const cctz::time_zone& ctz) const override;
void read_column_from_arrow(IColumn& column, const arrow::Array* arrow_array, int start,
int end, const cctz::time_zone& ctz) const override;
void read_one_cell_from_jsonb(IColumn& column, const JsonbValue* arg) const override;
void write_one_cell_to_jsonb(const IColumn& column, JsonbWriterT<JsonbOutStream>& result,
Arena* mem_pool, int unique_id, int row_num) const override;

private:
template <bool is_binary_format>
Expand Down

0 comments on commit 48311fd

Please sign in to comment.