yql_ytflow_integration.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #pragma once
  2. #include <yql/essentials/ast/yql_expr.h>
  3. #include <util/generic/maybe.h>
  4. namespace google::protobuf {
  5. class Any;
  6. } // namespace google::protobuf
  7. namespace NYql {
  8. class IYtflowIntegration {
  9. public:
  10. virtual ~IYtflowIntegration() = default;
  11. // Nothing if callable is not for reading,
  12. // false if callable is for reading and there are some errors (they are added to ctx),
  13. // true if callable is for reading and no issues occured.
  14. virtual TMaybe<bool> CanRead(const TExprNode& read, TExprContext& ctx) = 0;
  15. virtual TExprNode::TPtr WrapRead(const TExprNode::TPtr& read, TExprContext& ctx) = 0;
  16. // Nothing if callable is not for writing,
  17. // false if callable is for writing and there are some errors (they are added to ctx),
  18. // true if callable is for writing and no issues occured.
  19. virtual TMaybe<bool> CanWrite(const TExprNode& write, TExprContext& ctx) = 0;
  20. virtual TExprNode::TPtr WrapWrite(const TExprNode::TPtr& write, TExprContext& ctx) = 0;
  21. virtual TExprNode::TPtr GetReadWorld(const TExprNode& read, TExprContext& ctx) = 0;
  22. virtual TExprNode::TPtr GetWriteWorld(const TExprNode& write, TExprContext& ctx) = 0;
  23. virtual TExprNode::TPtr GetWriteContent(const TExprNode& write, TExprContext& ctx) = 0;
  24. virtual void FillSourceSettings(
  25. const TExprNode& source, ::google::protobuf::Any& settings, TExprContext& ctx) = 0;
  26. virtual void FillSinkSettings(
  27. const TExprNode& sink, ::google::protobuf::Any& settings, TExprContext& ctx) = 0;
  28. };
  29. } // namespace NYql