summaryrefslogtreecommitdiffstats
path: root/yql/essentials/core/extract_predicate/extract_predicate_impl.h
blob: fd665cd7c93ac6333ca851c8d60bdb72fa80f582 (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 "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_;
};

} // namespace NYql::NDetail