aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/public/udf/udf_validate.h
blob: 6e9957ec251237afe344a71743f7b4e39346a7ba (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
34
35
#pragma once
#include <util/generic/string.h>
#include <util/generic/strbuf.h>
#include <library/cpp/deprecated/enum_codegen/enum_codegen.h>

namespace NYql {
namespace NUdf {

#define UDF_VALIDATE_MODE(XX) \
    XX(None, 0)                       \
    XX(Lazy, 1)                       \
    XX(Greedy, 2)                     \
    XX(Max, 3)                        \

#define UDF_VALIDATE_POLICY(XX) \
    XX(Fail, 0)                       \
    XX(Exception, 1)                  \
    XX(Max, 2)                        \

enum class EValidateMode : ui8 {
    UDF_VALIDATE_MODE(ENUM_VALUE_GEN)
};

enum class EValidatePolicy : ui8 {
    UDF_VALIDATE_POLICY(ENUM_VALUE_GEN)
};

TString ValidateModeAvailables();
TStringBuf ValidateModeAsStr(EValidateMode validateMode);
EValidateMode ValidateModeByStr(const TString& verifyModeStr);
TStringBuf ValidatePolicyAsStr(EValidatePolicy verifyPolicy);
EValidatePolicy ValidatePolicyByStr(const TString& verifyPolicy);

} // namspace NUdf
} // namspace NYql