aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/core/yql_arrow_resolver.h
blob: cb98455e82a0985ebbd1239d25fd34db169a077e (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
#pragma once

#include <yql/essentials/ast/yql_expr.h>

#include <functional>
#include <variant>

namespace NYql {

class IArrowResolver : public TThrRefBase {
public:
    using TPtr = TIntrusiveConstPtr<IArrowResolver>;
    using TUnsupportedTypeCallback = std::function<void(std::variant<ETypeAnnotationKind, NUdf::EDataSlot>)>;

    enum EStatus {
        OK,
        NOT_FOUND,
        ERROR,
    };

    virtual ~IArrowResolver() = default;

    virtual EStatus LoadFunctionMetadata(const TPosition& pos, TStringBuf name, const TVector<const TTypeAnnotationNode*>& argTypes,
        const TTypeAnnotationNode* returnType, TExprContext& ctx) const = 0;

    virtual EStatus HasCast(const TPosition& pos, const TTypeAnnotationNode* from, const TTypeAnnotationNode* to, TExprContext& ctx) const = 0;

    virtual EStatus AreTypesSupported(const TPosition& pos, const TVector<const TTypeAnnotationNode*>& types, TExprContext& ctx,
        const TUnsupportedTypeCallback& onUnsupported = {}) const = 0;
};

}