aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/core/extract_predicate/extract_predicate_impl.h
blob: 68524c25d62ff4872d5dbc2a3af64d3308334133 (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
#pragma once

#include "extract_predicate.h"

namespace NYql::NDetail {

class TPredicateRangeExtractor : public IPredicateRangeExtractor {
public:
    explicit TPredicateRangeExtractor(const TPredicateExtractorSettings& settings = {})
        : Settings(settings)
    {}

    bool Prepare(const TExprNode::TPtr& filterLambdaNode, const TTypeAnnotationNode& rowType,
        THashSet<TString>& possibleIndexKeys, TExprContext& ctx, TTypeAnnotationContext& typesCtx) override final;

    TExprNode::TPtr GetPreparedRange() const {
        return Range;
    }

    TBuildResult BuildComputeNode(const TVector<TString>& indexKeys, TExprContext& ctx, TTypeAnnotationContext& typesCtx) const override final;
private:
    const TPredicateExtractorSettings Settings;
    TExprNode::TPtr FilterLambda;
    const TStructExprType* RowType = nullptr;
    TExprNode::TPtr Range;
};

}