Package org.umlg.sqlg.sql.parse
Class SchemaTableTree
java.lang.Object
org.umlg.sqlg.sql.parse.SchemaTableTree
Date: 2015/01/08
Time: 7:06 AM
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
ConstructorDescriptionSchemaTableTree
(SqlgGraph sqlgGraph, SchemaTableTree parent, SchemaTable schemaTable, int stepDepth, List<org.apache.tinkerpop.gremlin.process.traversal.step.util.HasContainer> hasContainers, List<AndOrHasContainer> andOrHasContainers, SqlgComparatorHolder sqlgComparatorHolder, List<org.javatuples.Pair<org.apache.tinkerpop.gremlin.process.traversal.Traversal.Admin<?, ?>, Comparator<?>>> dbComparators, SqlgRangeHolder sqlgRangeHolder, SchemaTableTree.STEP_TYPE stepType, boolean emit, boolean untilFirst, boolean optionalLeftJoin, boolean drop, int replacedStepDepth, Set<String> labels, org.apache.commons.lang3.tuple.Pair<String, List<String>> aggregateFunction, List<String> groupBy, boolean idOnly, RecursiveRepeatStepConfig recursiveRepeatStepConfig) This constructor is called for the root SchemaTableTree(s) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
close()
closing the SchemaTableTree indicates that this SchemaTableTree is complete and that no moore changing of its state it allowed.static void
constructDistinctEmitBeforeQueries
(SchemaTableTree current, List<LinkedList<SchemaTableTree>> result) static void
constructDistinctOptionalQueries
(SchemaTableTree current, List<org.apache.commons.lang3.tuple.Pair<LinkedList<SchemaTableTree>, Set<SchemaTableTree>>> result) constructDropSql
(LinkedList<SchemaTableTree> distinctQueryStack) constructSql
(LinkedList<SchemaTableTree> distinctQueryStack) constructSqlForOptional
(LinkedList<SchemaTableTree> innerJoinStack, Set<SchemaTableTree> leftJoinOn) boolean
duplicatesInStack
(LinkedList<SchemaTableTree> distinctQueryStack) Checks if the stack has the same element more than once.boolean
List<org.apache.tinkerpop.gremlin.process.traversal.step.util.HasContainer>
org.apache.tinkerpop.gremlin.structure.Direction
List<org.apache.tinkerpop.gremlin.process.traversal.step.util.HasContainer>
org.apache.commons.collections4.set.ListOrderedSet<String>
List<org.apache.commons.lang3.tuple.Pair<RecordId.ID,
Long>> int
int
boolean
boolean
int
hashCode()
boolean
boolean
boolean
isDrop()
boolean
isEmit()
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
lastMappedAliasIdentifier
(String identifier) void
void
loadEdgeInOutVertices
(ResultSet resultSet, SqlgEdge sqlgEdge) loadIdentifierObjects
(Map<String, Integer> idColumnCountMap, ResultSet resultSet) void
loadProperty
(ResultSet resultSet, SqlgElement sqlgElement) void
loadProperty
(ResultSet resultSet, SqlgElement sqlgElement, List<LinkedHashMap<ColumnList.Column, String>> columnsStack) void
void
schemaTableTreeForLabel
(String label) void
setAliasMapHolder
(AliasMapHolder aliasMapHolder) void
setFakeEmit
(boolean fakeEmit) void
setParentIdsAndIndexes
(List<org.apache.commons.lang3.tuple.Pair<RecordId.ID, Long>> parentIdsAndIndexes) void
setUntilTraversalRootSchemaTableTree
(SchemaTableTree untilTraversalRootSchemaTableTree) boolean
shouldSelectProperty
(String property) should we select the given property?static List<LinkedList<SchemaTableTree>>
splitIntoSubStacks
(LinkedList<SchemaTableTree> distinctQueryStack) int
toString()
-
Field Details
-
ALIAS_SEPARATOR
- See Also:
-
-
Constructor Details
-
SchemaTableTree
public SchemaTableTree(SqlgGraph sqlgGraph, SchemaTableTree parent, SchemaTable schemaTable, int stepDepth, List<org.apache.tinkerpop.gremlin.process.traversal.step.util.HasContainer> hasContainers, List<AndOrHasContainer> andOrHasContainers, SqlgComparatorHolder sqlgComparatorHolder, List<org.javatuples.Pair<org.apache.tinkerpop.gremlin.process.traversal.Traversal.Admin<?, ?>, Comparator<?>>> dbComparators, SqlgRangeHolder sqlgRangeHolder, SchemaTableTree.STEP_TYPE stepType, boolean emit, boolean untilFirst, boolean optionalLeftJoin, boolean drop, int replacedStepDepth, Set<String> labels, org.apache.commons.lang3.tuple.Pair<String, List<String>> aggregateFunction, List<String> groupBy, boolean idOnly, RecursiveRepeatStepConfig recursiveRepeatStepConfig) This constructor is called for the root SchemaTableTree(s)This is invoked from
ReplacedStep
when creating the rootSchemaTableTree
s. The hasContainers at this stage contains theTopologyStrategy
from or without hasContainer. After doing the filtering it must be removed from the hasContainers as it must not partake in sql generation.
-
-
Method Details
-
constructDistinctOptionalQueries
public static void constructDistinctOptionalQueries(SchemaTableTree current, List<org.apache.commons.lang3.tuple.Pair<LinkedList<SchemaTableTree>, Set<SchemaTableTree>>> result) -
constructDistinctEmitBeforeQueries
public static void constructDistinctEmitBeforeQueries(SchemaTableTree current, List<LinkedList<SchemaTableTree>> result) -
splitIntoSubStacks
public static List<LinkedList<SchemaTableTree>> splitIntoSubStacks(LinkedList<SchemaTableTree> distinctQueryStack) -
loadEager
public void loadEager() -
addLabel
-
getPropertyDefinitions
-
getAliasMapHolder
-
setAliasMapHolder
-
getColumnNameAliasMap
-
getAliasColumnNameMap
-
getAllIdentifiers
-
isEmit
public boolean isEmit() -
isOptionalLeftJoin
public boolean isOptionalLeftJoin() -
isOuterLeftJoin
public boolean isOuterLeftJoin() -
resetColumnAliasMaps
public void resetColumnAliasMaps() -
getSchemaTable
-
constructSql
-
constructSqlForOptional
public String constructSqlForOptional(LinkedList<SchemaTableTree> innerJoinStack, Set<SchemaTableTree> leftJoinOn) -
constructDropSql
public List<SqlgSqlExecutor.DropQuery> constructDropSql(LinkedList<SchemaTableTree> distinctQueryStack) -
constructDistinctQueries
-
hasBulkWithinOrOut
public boolean hasBulkWithinOrOut() -
getRecursiveRepeatStepConfig
-
isRecursiveQuery
public boolean isRecursiveQuery() -
setUntilTraversalRootSchemaTableTree
-
duplicatesInStack
Checks if the stack has the same element more than once.- Parameters:
distinctQueryStack
- The stack to check for duplicates- Returns:
- true is there are duplicates else false
-
labeledAliasId
-
lastMappedAliasIdentifier
-
toString
-
toTreeString
-
getDirection
public org.apache.tinkerpop.gremlin.structure.Direction getDirection() -
getHasContainers
public List<org.apache.tinkerpop.gremlin.process.traversal.step.util.HasContainer> getHasContainers() -
getAdditionalPartitionHasContainers
public List<org.apache.tinkerpop.gremlin.process.traversal.step.util.HasContainer> getAdditionalPartitionHasContainers() -
getAndOrHasContainers
-
getSqlgComparatorHolder
-
getStepDepth
public int getStepDepth() -
getReplacedStepDepth
public int getReplacedStepDepth() -
testHashCode
public int testHashCode() -
close
public void close()closing the SchemaTableTree indicates that this SchemaTableTree is complete and that no moore changing of its state it allowed. This allows us to cache the hashCode for performance reasons. -
isHasIdentifierPrimaryKeyInHierarchy
public boolean isHasIdentifierPrimaryKeyInHierarchy() -
hashCode
public int hashCode() -
equals
-
getLabels
-
hasLabels
public boolean hasLabels() -
getRealLabelsCache
-
isUntilFirst
public boolean isUntilFirst() -
loadProperty
- Throws:
SQLException
-
loadProperty
public void loadProperty(ResultSet resultSet, SqlgElement sqlgElement, List<LinkedHashMap<ColumnList.Column, String>> columnsStack) throws SQLException- Throws:
SQLException
-
loadEdgeInOutVertices
- Throws:
SQLException
-
loadIdentifierObjects
public List<Comparable> loadIdentifierObjects(Map<String, Integer> idColumnCountMap, ResultSet resultSet) throws SQLException- Throws:
SQLException
-
isLocalStep
public boolean isLocalStep() -
isLocalBarrierStep
public boolean isLocalBarrierStep() -
isFakeEmit
public boolean isFakeEmit() -
setFakeEmit
public void setFakeEmit(boolean fakeEmit) -
getStepType
-
getParentIdsAndIndexes
-
setParentIdsAndIndexes
public void setParentIdsAndIndexes(List<org.apache.commons.lang3.tuple.Pair<RecordId.ID, Long>> parentIdsAndIndexes) -
removeDbComparators
public void removeDbComparators() -
isDrop
public boolean isDrop() -
isHasIDPrimaryKey
public boolean isHasIDPrimaryKey() -
getIdentifiers
-
getRootColumnListStack
-
getRestrictedProperties
-
shouldSelectProperty
should we select the given property?- Parameters:
property
- the property name- Returns:
- true if the property should be part of the select clause, false otherwise
-
hasAggregateFunction
public boolean hasAggregateFunction() -
getAggregateFunction
-
getGroupBy
-
hasLeafNodes
public boolean hasLeafNodes() -
schemaTableTreeForLabel
-