summaryrefslogtreecommitdiffstats
path: root/yql/essentials/public/udf/udf_value_utils.h
blob: f756cb7d1a24944ac1b1c1ba3f0be7207e4b8457 (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
#pragma once

#include "udf_value.h"

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

namespace NYql::NUdf {

template <bool IsNull>
constexpr TUnboxedValuePod CreateSingularUnboxedValuePod() {
    if constexpr (IsNull) {
        return TUnboxedValuePod();
    } else {
        return TUnboxedValuePod::Zero();
    }
}

template <bool IsNull>
constexpr TBlockItem CreateSingularBlockItem() {
    if constexpr (IsNull) {
        return TBlockItem();
    } else {
        return TBlockItem::Zero();
    }
}

} // namespace NYql::NUdf