aboutsummaryrefslogtreecommitdiffstats
path: root/ydb/library/yql/dq/common/dq_value.h
blob: e3dd676644b1a0c6241fa2b38b1590cbd5e9995c (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
#pragma once

#include <ydb/library/mkql_proto/protos/minikql.pb.h> 

namespace NYql::NDq {

class TMkqlValueRef {
public:
    TMkqlValueRef(const NKikimrMiniKQL::TType& type, const NKikimrMiniKQL::TValue& value)
        : Type(&type)
        , Value(&value) {}

    explicit TMkqlValueRef(const NKikimrMiniKQL::TParams& params)
        : TMkqlValueRef(params.GetType(), params.GetValue()) {}

    explicit TMkqlValueRef(const NKikimrMiniKQL::TResult& result)
        : TMkqlValueRef(result.GetType(), result.GetValue()) {}

    const NKikimrMiniKQL::TType& GetType() const { return *Type; }

    const NKikimrMiniKQL::TValue& GetValue() const { return *Value; }

private:
    const NKikimrMiniKQL::TType *Type;
    const NKikimrMiniKQL::TValue *Value;
};

}