yql_arrow_resolver.h 1009 B

1234567891011121314151617181920212223242526272829303132
  1. #pragma once
  2. #include <yql/essentials/ast/yql_expr.h>
  3. #include <functional>
  4. #include <variant>
  5. namespace NYql {
  6. class IArrowResolver : public TThrRefBase {
  7. public:
  8. using TPtr = TIntrusiveConstPtr<IArrowResolver>;
  9. using TUnsupportedTypeCallback = std::function<void(std::variant<ETypeAnnotationKind, NUdf::EDataSlot>)>;
  10. enum EStatus {
  11. OK,
  12. NOT_FOUND,
  13. ERROR,
  14. };
  15. virtual ~IArrowResolver() = default;
  16. virtual EStatus LoadFunctionMetadata(const TPosition& pos, TStringBuf name, const TVector<const TTypeAnnotationNode*>& argTypes,
  17. const TTypeAnnotationNode* returnType, TExprContext& ctx) const = 0;
  18. virtual EStatus HasCast(const TPosition& pos, const TTypeAnnotationNode* from, const TTypeAnnotationNode* to, TExprContext& ctx) const = 0;
  19. virtual EStatus AreTypesSupported(const TPosition& pos, const TVector<const TTypeAnnotationNode*>& types, TExprContext& ctx,
  20. const TUnsupportedTypeCallback& onUnsupported = {}) const = 0;
  21. };
  22. }