Class ViewExpression
- java.lang.Object
-
- com.apple.foundationdb.record.query.plan.temp.view.ViewExpression
-
public class ViewExpression extends Object
An abstraction that represents a stream of values that can be represented as tuple-encoding keys and binary values in FoundationDB.Visually, a view expression is quite similar to a query in a declarative language like SQL. A view expression is composed of several clauses, including:
- A root
Source
, which defines the stream of values from which the expression'sElement
s are generated. - A projection, which is a collection of
Element
s that generate values. -
A sort order, which is an ordered list of
Element
s that define the order of the stream. By definition, the sort order is the lexicographic order of the elements when packed together as tuple. - A predicate, in the form of a
QueryPredicate
Because view expressions are quite general but are closely tied to the semantics of the tuple layer, they are very useful for planning tasks such as incremental index selection. To see how an index is represented as a view expression, see
fromIndexDefinition(String, Collection, KeyExpression)
. - A root
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ViewExpression.Builder
A builder class for constructing an (immutable) view expression.
-
Constructor Summary
Constructors Constructor Description ViewExpression(List<Element> select, QueryPredicate predicate, Source rootSource, List<Element> orderBy)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ViewExpression.Builder
builder()
static ViewExpression
fromIndexDefinition(String indexType, Collection<String> recordTypes, KeyExpression rootExpression)
Generate a view expression that represents the structure of an index defined using aKeyExpression
.List<Element>
getOrderBy()
-
-
-
Method Detail
-
fromIndexDefinition
public static ViewExpression fromIndexDefinition(@Nonnull String indexType, @Nonnull Collection<String> recordTypes, @Nonnull KeyExpression rootExpression)
Generate a view expression that represents the structure of an index defined using aKeyExpression
.- Parameters:
indexType
- the type of the index as specified in the meta-datarecordTypes
- the set of record types used to generate the indexrootExpression
- the root key expression of the index as specified in the meta-data- Returns:
- a view expression representing the given index structure
-
builder
public static ViewExpression.Builder builder()
-
-