package
19.2.12+incompatible
Repository: https://github.com/cockroachdb/cockroach-gen.git
Documentation: pkg.go.dev

# README

Norm Layout

This directory contains definitions for the normalization rules, their custom helper functions, and their test files. There is a .opt file for each operator containing the rules that match that operator. For every .opt file, there is a test file in testdata that contains tests for each normalization rule. Custom match and replace functions which are only used in one .opt file are kept in the corresponding _funcs.go file. Functions which are used by multiple different rules or are general enough to be reusable belong in general_funcs.go.

# Functions

DerivePruneCols returns the subset of the given expression's output columns that are candidates for pruning.
DeriveRejectNullCols returns the set of columns that are candidates for NULL rejection filter pushdown.

# Variables

FoldFunctionWhitelist contains functions that are known to always produce the same result given the same set of arguments.

# Structs

CustomFuncs contains all the custom match and replace functions used by the normalization rules.
Factory constructs a normalized expression tree within the memo.

# Type aliases

AppliedRuleFunc defines the callback function for the NotifyOnAppliedRule event supported by the optimizer and factory.
MatchedRuleFunc defines the callback function for the NotifyOnMatchedRule event supported by the optimizer and factory.
ReplaceFunc is the callback function passed to the Factory.Replace method.