fake_spec.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #pragma once
  2. #include <yql/essentials/public/purecalc/purecalc.h>
  3. namespace NYql {
  4. namespace NPureCalc {
  5. class TFakeInputSpec: public TInputSpecBase {
  6. public:
  7. TVector<NYT::TNode> Schemas = {NYT::TNode::CreateList()};
  8. public:
  9. const TVector<NYT::TNode>& GetSchemas() const override {
  10. return Schemas;
  11. }
  12. };
  13. class TFakeOutputSpec: public TOutputSpecBase {
  14. public:
  15. NYT::TNode Schema = NYT::TNode::CreateList();
  16. public:
  17. const NYT::TNode& GetSchema() const override {
  18. return Schema;
  19. }
  20. };
  21. template <>
  22. struct TInputSpecTraits<TFakeInputSpec> {
  23. static const constexpr bool IsPartial = false;
  24. static const constexpr bool SupportPullStreamMode = false;
  25. static const constexpr bool SupportPullListMode = false;
  26. static const constexpr bool SupportPushStreamMode = false;
  27. using TConsumerType = void;
  28. };
  29. template <>
  30. struct TOutputSpecTraits<TFakeOutputSpec> {
  31. static const constexpr bool IsPartial = false;
  32. static const constexpr bool SupportPullStreamMode = false;
  33. static const constexpr bool SupportPullListMode = false;
  34. static const constexpr bool SupportPushStreamMode = false;
  35. using TPullStreamReturnType = void;
  36. using TPullListReturnType = void;
  37. };
  38. NYT::TNode MakeFakeSchema(bool pg = false);
  39. TFakeInputSpec FakeIS(ui32 inputsNumber = 1, bool pg = false);
  40. TFakeOutputSpec FakeOS(bool pg = false);
  41. }
  42. }