replace_table_reads.h 1.4 KB

123456789101112131415161718192021222324252627282930
  1. #pragma once
  2. #include <yql/essentials/public/purecalc/common/names.h>
  3. #include <yql/essentials/public/purecalc/common/processor_mode.h>
  4. #include <yql/essentials/core/yql_graph_transformer.h>
  5. namespace NYql::NPureCalc {
  6. /**
  7. * SQL translation would generate a standard Read! call to read each input table. It will than generate
  8. * a Right! call to get the table data from a tuple returned by Read!. This transformation replaces any Right!
  9. * call with a call to special function used to get input data.
  10. *
  11. * Each table name must starts with the specified prefix and ends with an index of program input (e.g. `Input0`).
  12. * Name without numeric suffix is an alias for the first input.
  13. *
  14. * @param inputStructs types of each input.
  15. * @param useSystemColumns whether to allow special system columns in input structs.
  16. * @param callableName name of the special callable used to get input data (e.g. `Self`).
  17. * @param tablePrefix required prefix for all table names (e.g. `Input`).
  18. * @param return a graph transformer for replacing table reads.
  19. */
  20. TAutoPtr<IGraphTransformer> MakeTableReadsReplacer(
  21. const TVector<const TStructExprType*>& inputStructs,
  22. bool useSystemColumns,
  23. EProcessorMode processorMode,
  24. TString callableName = TString{PurecalcInputCallableName},
  25. TString tablePrefix = TString{PurecalcInputTablePrefix}
  26. );
  27. }