aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/public/purecalc/common/transformations/replace_table_reads.h
blob: 33bc7174ac49ef54d55e1082a7016091a218f026 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#pragma once

#include <yql/essentials/public/purecalc/common/names.h>
#include <yql/essentials/public/purecalc/common/processor_mode.h>

#include <yql/essentials/core/yql_graph_transformer.h>

namespace NYql::NPureCalc {
    /**
     * SQL translation would generate a standard Read! call to read each input table. It will than generate
     * a Right! call to get the table data from a tuple returned by Read!. This transformation replaces any Right!
     * call with a call to special function used to get input data.
     *
     * Each table name must starts with the specified prefix and ends with an index of program input (e.g. `Input0`).
     * Name without numeric suffix is an alias for the first input.
     *
     * @param inputStructs types of each input.
     * @param useSystemColumns whether to allow special system columns in input structs.
     * @param callableName name of the special callable used to get input data (e.g. `Self`).
     * @param tablePrefix required prefix for all table names (e.g. `Input`).
     * @param return a graph transformer for replacing table reads.
     */
    TAutoPtr<IGraphTransformer> MakeTableReadsReplacer(
        const TVector<const TStructExprType*>& inputStructs,
        bool useSystemColumns,
        EProcessorMode processorMode,
        TString callableName = TString{PurecalcInputCallableName},
        TString tablePrefix = TString{PurecalcInputTablePrefix}
    );
}