public class LatticeSuggester
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
LatticeSuggester.BaseColRef
Reference to a base column.
|
private static class |
LatticeSuggester.ColRef
Column reference.
|
private static class |
LatticeSuggester.DerivedColRef
Reference to a derived column (that is, an expression).
|
(package private) static class |
LatticeSuggester.Frame
Information about the parent of fields from a relational expression.
|
private static class |
LatticeSuggester.Hop
A hop is a join condition.
|
private static class |
LatticeSuggester.MutableMeasure
An aggregate call.
|
private static class |
LatticeSuggester.Query
Holds state for a particular query graph.
|
private static class |
LatticeSuggester.StepRef
Use of a step within a query.
|
private static class |
LatticeSuggester.TableRef
Use of a table within a query.
|
Modifier and Type | Field and Description |
---|---|
private boolean |
evolve
Whether to try to extend an existing lattice when adding a lattice.
|
(package private) java.util.Map<java.lang.String,Lattice> |
latticeMap
Lattices, indexed by digest.
|
private java.util.Map<Lattice,Lattice> |
obsoleteLatticeMap
Lattices that have been made obsolete.
|
private static HepProgram |
PROGRAM |
(package private) LatticeSpace |
space |
Constructor and Description |
---|
LatticeSuggester(FrameworkConfig config)
Creates a LatticeSuggester.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<Lattice> |
addQuery(RelNode r)
Adds a query.
|
private static java.lang.String |
deriveAlias(LatticeSuggester.MutableMeasure measure,
LatticeSuggester.DerivedColRef derivedColRef)
Derives the alias of an expression that is the argument to a measure.
|
private Lattice |
findMatch(Lattice lattice,
MutableNode mutableNode)
Returns the best match for a lattice.
|
private LatticeSuggester.Frame |
frame(LatticeSuggester.Query q,
RelNode r) |
java.util.Set<Lattice> |
getLatticeSet()
Returns the minimal set of lattices necessary to cover all of the queries
seen.
|
private java.util.function.Function<Lattice.Column,Lattice.Column> |
mapper(Lattice lattice,
Lattice.Builder builder) |
private int |
matchQuality(Lattice lattice,
Lattice target) |
private static <E> java.util.Set<E> |
minus(java.util.Collection<E> c,
java.util.Collection<E> c2) |
final LatticeSpace space
private static final HepProgram PROGRAM
final java.util.Map<java.lang.String,Lattice> latticeMap
private final java.util.Map<Lattice,Lattice> obsoleteLatticeMap
private final boolean evolve
public LatticeSuggester(FrameworkConfig config)
public java.util.Set<Lattice> getLatticeSet()
public java.util.List<Lattice> addQuery(RelNode r)
It may fit within an existing lattice (or lattices). Or it may need a new lattice, or an extension to an existing lattice.
r
- Relational expression for a queryprivate static java.lang.String deriveAlias(LatticeSuggester.MutableMeasure measure, LatticeSuggester.DerivedColRef derivedColRef)
For example, if the measure is called "sum_profit" and the aggregate function is "sum", returns "profit".
private Lattice findMatch(Lattice lattice, MutableNode mutableNode)
private java.util.function.Function<Lattice.Column,Lattice.Column> mapper(Lattice lattice, Lattice.Builder builder)
private static <E> java.util.Set<E> minus(java.util.Collection<E> c, java.util.Collection<E> c2)
private LatticeSuggester.Frame frame(LatticeSuggester.Query q, RelNode r)
Copyright © 2012–2019 The Apache Software Foundation. All rights reserved.