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
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSchemaTableTree(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 TypeMethodDescriptionvoidvoidclose()closing the SchemaTableTree indicates that this SchemaTableTree is complete and that no moore changing of its state it allowed.static voidconstructDistinctEmitBeforeQueries(SchemaTableTree current, List<LinkedList<SchemaTableTree>> result) static voidconstructDistinctOptionalQueries(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) booleanduplicatesInStack(LinkedList<SchemaTableTree> distinctQueryStack) Checks if the stack has the same element more than once.booleanList<org.apache.tinkerpop.gremlin.process.traversal.step.util.HasContainer>org.apache.tinkerpop.gremlin.structure.DirectionList<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>> intintbooleanbooleaninthashCode()booleanbooleanbooleanisDrop()booleanisEmit()booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanlastMappedAliasIdentifier(String identifier) voidvoidloadEdgeInOutVertices(ResultSet resultSet, SqlgEdge sqlgEdge) loadIdentifierObjects(Map<String, Integer> idColumnCountMap, ResultSet resultSet) voidloadProperty(ResultSet resultSet, SqlgElement sqlgElement) voidloadProperty(ResultSet resultSet, SqlgElement sqlgElement, List<LinkedHashMap<ColumnList.Column, String>> columnsStack) voidvoidschemaTableTreeForLabel(String label) voidsetAliasMapHolder(AliasMapHolder aliasMapHolder) voidsetFakeEmit(boolean fakeEmit) voidsetParentIdsAndIndexes(List<org.apache.commons.lang3.tuple.Pair<RecordId.ID, Long>> parentIdsAndIndexes) voidsetUntilTraversalRootSchemaTableTree(SchemaTableTree untilTraversalRootSchemaTableTree) booleanshouldSelectProperty(String property) should we select the given property?static List<LinkedList<SchemaTableTree>>splitIntoSubStacks(LinkedList<SchemaTableTree> distinctQueryStack) inttoString()
-
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
ReplacedStepwhen creating the rootSchemaTableTrees. The hasContainers at this stage contains theTopologyStrategyfrom 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
-