aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/minikql/computation/mkql_block_reader.h
blob: e5a649b2adec4e70ff42a80f53055cbde64e01ef (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#pragma once

#include "mkql_block_item.h"
#include "mkql_computation_node_holders.h"

#include <yql/essentials/minikql/mkql_node.h>

#include <yql/essentials/public/udf/udf_types.h>
#include <yql/essentials/public/udf/arrow/block_reader.h>

#include <arrow/datum.h>

namespace NKikimr::NMiniKQL {

using NYql::NUdf::IBlockReader;
using NYql::NUdf::TOutputBuffer;

class IBlockItemConverter {
public:
    virtual ~IBlockItemConverter() = default;

    virtual NUdf::TUnboxedValuePod MakeValue(TBlockItem item, const THolderFactory& holderFactory) const = 0;
    virtual TBlockItem MakeItem(const NUdf::TUnboxedValuePod& value) const = 0;
};

using NYql::NUdf::MakeBlockReader;
using NYql::NUdf::TBlockItemSerializeProps;
using NYql::NUdf::UpdateBlockItemSerializeProps;

std::unique_ptr<IBlockItemConverter> MakeBlockItemConverter(const NYql::NUdf::ITypeInfoHelper& typeInfoHelper, const NYql::NUdf::TType* type,
    const NYql::NUdf::IPgBuilder& pgBuilder);

}