yql_ytflow_optimization.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #pragma once
  2. #include <yql/essentials/ast/yql_expr.h>
  3. namespace NYql {
  4. class IYtflowOptimization {
  5. public:
  6. virtual ~IYtflowOptimization() = default;
  7. /**
  8. Apply new members subset for YtflowReadWrap's underlying provider specific read callable
  9. Args:
  10. * read - provider specific read callable
  11. * members - expr list of atoms with new members
  12. * ctx - expr context
  13. Returns one of:
  14. * empty TPtr on error
  15. * original `read`, if no changes
  16. * new read with applied new members
  17. */
  18. virtual TExprNode::TPtr ApplyExtractMembers(
  19. const TExprNode::TPtr& read, const TExprNode::TPtr& members,
  20. TExprContext& ctx) = 0;
  21. /**
  22. Apply `unordered` setting for YtflowReadWrap's underlying provider specific read callable
  23. Args:
  24. * read - provider specific read callable
  25. * ctx - expr context
  26. Returns one of:
  27. * empty TPtr on error
  28. * original `read`, if no changes
  29. * new read with applied setting
  30. */
  31. virtual TExprNode::TPtr ApplyUnordered(
  32. const TExprNode::TPtr& read, TExprContext& ctx) = 0;
  33. /**
  34. Rewrite YtflowWriteWrap's underlying provider specific write callable
  35. Args:
  36. * write - provider specific write callable
  37. * ctx - expr context
  38. Returns one of:
  39. * empty TPtr on error
  40. * original `write`, if no changes
  41. * new write with trimmed content
  42. */
  43. virtual TExprNode::TPtr TrimWriteContent(
  44. const TExprNode::TPtr& write, TExprContext& ctx) = 0;
  45. };
  46. } // namespace NYql