Files
doris/be/src/vec/jsonb/serialize.h
zclllyybb 25358564ca [Fix](compile) Fix gcc compile on master (#33864)
This is imported by #33511. wrongly used

ColumnStr<T> ();

which violate C++20 standard(see https://wg21.cmeerw.net/cwg/issue2237) but still supported by clang up until now(see llvm/llvm-project#58112)
2024-04-19 23:41:37 +08:00

48 lines
1.9 KiB
C++

// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
#pragma once
#include <cstddef>
#include <unordered_map>
#include "olap/tablet_schema.h"
#include "runtime/descriptors.h"
#include "vec/columns/column_string.h"
#include "vec/core/block.h"
namespace doris {
class TabletSchema;
class TupleDescriptor;
} // namespace doris
namespace doris::vectorized {
// use jsonb codec to store row format
class JsonbSerializeUtil {
public:
static void block_to_jsonb(const TabletSchema& schema, const Block& block, ColumnString& dst,
int num_cols, const DataTypeSerDeSPtrs& serdes);
// batch rows
static void jsonb_to_block(const DataTypeSerDeSPtrs& serdes, const ColumnString& jsonb_column,
const std::unordered_map<uint32_t, uint32_t>& col_id_to_idx,
Block& dst, const std::vector<std::string>& default_values);
// single row
static void jsonb_to_block(const DataTypeSerDeSPtrs& serdes, const char* data, size_t size,
const std::unordered_map<uint32_t, uint32_t>& col_id_to_idx,
Block& dst, const std::vector<std::string>& default_values);
};
} // namespace doris::vectorized