public abstract class PathPredicateBinaryExprTreeAssembler extends DefaultBinaryExprTreeAssembler
visits
(traverses) the given predicate expression syntax tree depth-first using an
adapted shunting-yard algorithm and assembles a resulting binary tree
structure. In typical usage scenarios, a single expression tree is assembled
once, and then used to evaluate any number of graph edge or other results
based on a given context.
The adapted shunting-yard algorithm in general uses a stack of operators and operands, and as new binary tree nodes are detected and created they are pushed onto the operand stack based on operator precedence. The resulting binary expression tree reflects the syntax of the underlying query expression including the precedence of its operators.
The use of binary expression tree evaluation for post processing of graph edge results is necessary in columnar data stores, as an entity with multiple properties is necessarily persisted across multiple columns. And while these data stores provide many useful column oriented filters, the capability to select an entity based on complex criteria which spans several columns is generally not supported, as such filters are column oriented. Yet even for simple queries (e.g. "where entity.c1 = 'foo' and entity.c2 = 'bar'") column c1 and its value exists in one cell and column c2 exists in another table cell. Since columnar data store filters cannot generally span columns, both cells must be returned and the results post processed within the context of the binary expression tree.
Subclasses may provide alternate implementations of ExprAssembler
which create binary expression tree nodes with specific evaluation behavior.
Expr,
CompositeColumnKeyFactory| Modifier and Type | Field and Description |
|---|---|
protected CompositeColumnKeyFactory |
columnKeyFactory |
protected org.plasma.sdo.PlasmaType |
edgeType |
contextExpression, contextProperty, contextQueryProperty, contextType, predicates, rootType| Constructor and Description |
|---|
PathPredicateBinaryExprTreeAssembler(org.plasma.query.model.Where predicate,
org.plasma.sdo.PlasmaType edgeType,
org.plasma.sdo.PlasmaType rootType,
StoreMappingContext mappingContext)
Constructs an assembler based on the given predicate and graph edge type.
|
| Modifier and Type | Method and Description |
|---|---|
void |
end(org.plasma.query.model.Property property)
Process the traversal end event for a query
property within an
expression setting up context
information for the endpoint property and its type, as well as physical
column qualifier name bytes which are set into the
DefaultBinaryExprTreeAssembler.contextQueryProperty physical name bytes. |
createLogicalBinaryExpr, createPredicateBinaryExpr, createRelationalBinaryExpr, end, getResult, log, serialize, traversegetChildExpressionCount, getChildExpressions, getLogicalOperatorCount, hasChildExpressions, hasWildcardend, end, end, end, end, end, end, end, end, end, end, end, end, end, end, end, end, end, end, end, end, end, end, getContext, start, start, start, start, start, start, start, start, start, start, start, start, start, start, start, start, start, start, start, start, start, start, start, start, startprotected CompositeColumnKeyFactory columnKeyFactory
protected org.plasma.sdo.PlasmaType edgeType
public PathPredicateBinaryExprTreeAssembler(org.plasma.query.model.Where predicate,
org.plasma.sdo.PlasmaType edgeType,
org.plasma.sdo.PlasmaType rootType,
StoreMappingContext mappingContext)
predicate - the predicateedgeType - the graph edge type which is the type for the reference property
within the graph which represents an edgerootType - the graph root typepublic void end(org.plasma.query.model.Property property)
property within an
expression setting up context
information for the endpoint property and its type, as well as physical
column qualifier name bytes which are set into the
DefaultBinaryExprTreeAssembler.contextQueryProperty physical name bytes. for the current
expression.end in interface org.plasma.query.visitor.QueryVisitorend in class DefaultBinaryExprTreeAssemblerDefaultQueryVisitor.end(org.plasma.query.model.Property)Copyright © 2021. All Rights Reserved.