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

}