extract_used_columns.h 1.2 KB

1234567891011121314151617181920212223242526272829
  1. #pragma once
  2. #include <yql/essentials/public/purecalc/common/names.h>
  3. #include <yql/essentials/core/yql_graph_transformer.h>
  4. #include <yql/essentials/core/yql_type_annotation.h>
  5. #include <util/generic/hash_set.h>
  6. #include <util/generic/string.h>
  7. namespace NYql {
  8. namespace NPureCalc {
  9. /**
  10. * Make transformation which builds sets of input columns from the given expression.
  11. *
  12. * @param destination a vector of string sets which will be populated with column names sets when
  13. * transformation pipeline is launched. This pointer should contain a valid
  14. * TVector<THashSet> instance. The transformation will overwrite its contents.
  15. * @param allColumns vector of sets with all available columns for each input.
  16. * @param nodeName name of the callable used to get input data, e.g. `Self`.
  17. * @return an extractor which scans an input structs contents and populates destination.
  18. */
  19. TAutoPtr<IGraphTransformer> MakeUsedColumnsExtractor(
  20. TVector<THashSet<TString>>* destination,
  21. const TVector<THashSet<TString>>& allColumns,
  22. const TString& nodeName = TString{PurecalcInputCallableName}
  23. );
  24. }
  25. }