Package org.partiql.lang.planner.transforms.optimizations

Types

Link copied to clipboard
data class FieldEqualityPredicate(keyFieldName: String, equivalentValue: PartiqlPhysical.Expr)

The "filter scan to key lookup" pass identifies all equality expressions where either side is a primary key within the filter's predicate. This class represents the identified key field and the opposing value expression of each such equality expression. For example, given the filter predicate: foo.id = 42, the keyFieldName is id and the equivalentValue is (lit 42).

Functions

Link copied to clipboard
fun createFilterScanToKeyLookupPass(customProjectOperatorName: String, staticTypeResolver: StaticTypeResolver, createKeyValueConstructor: (StructType, List<FieldEqualityPredicate>) -> PartiqlPhysical.Expr): PartiQLPhysicalPass

If possible, changes a filter operator with a nested scan into an project operator that looks up a single record by its primary key.

Link copied to clipboard
fun createRemoveUselessAndsPass(): PartiQLPhysicalPass

Creates an instance of PartiQLPhysicalPass that removes useless "AND" expressions by, i.e.:

Link copied to clipboard
fun createRemoveUselessFiltersPass(): PartiQLPhysicalPass

Creates a pass that removes any (filter ...) where the predicate is simply (lit true).