public class OCommandExecutorSQLTraverse extends OCommandExecutorSQLResultsetAbstract
SYNTAX: TRAVERSE
In the command context you've access to the variable $depth containing the depth level from
the root node. This is useful to limit the traverse up to a level. For example to consider from
the first depth level (0 is root node) to the third use:
TRAVERSE children FROM #5:23 WHERE $depth BETWEEN 1 AND 3
. To filter traversed records use
it combined with a SELECT statement:
SELECT FROM (TRAVERSE children FROM #5:23 WHERE $depth BETWEEN 1 AND 3) WHERE city.name = 'Rome'
OCommandDistributedReplicateRequest.DISTRIBUTED_EXECUTION_MODE, OCommandDistributedReplicateRequest.DISTRIBUTED_RESULT_MGMT, OCommandDistributedReplicateRequest.QUORUM_TYPE
Modifier and Type | Field and Description |
---|---|
static String |
KEYWORD_MAXDEPTH |
static String |
KEYWORD_STRATEGY |
static String |
KEYWORD_TRAVERSE |
static String |
KEYWORD_WHILE |
compiledFilter, KEYWORD_FROM_2FIND, KEYWORD_LET_2FIND, lazyIteration, let, parsedTarget, request, resultCount, serialTempRID, skip, target, tempResult
CLASS_PREFIX, CLUSTER_PREFIX, DEFAULT_PARAM_USER, DICTIONARY_PREFIX, INDEX_PREFIX, INDEX_VALUES_ASC_PREFIX, INDEX_VALUES_DESC_PREFIX, INDEX_VALUES_PREFIX, KEYWORD_FROM, KEYWORD_KEY, KEYWORD_LET, KEYWORD_LIMIT, KEYWORD_LOCK, KEYWORD_OFFSET, KEYWORD_RETURN, KEYWORD_RID, KEYWORD_SKIP, KEYWORD_TIMEOUT, KEYWORD_UNSAFE, KEYWORD_WHERE, METADATA_DATABASE, METADATA_INDEXMGR, METADATA_PREFIX, METADATA_SCHEMA, METADATA_STORAGE, preParsedStatement, timeoutMs, timeoutStrategy
context, limit, parameters, progressListener
parserText, parserTextUpperCase
Constructor and Description |
---|
OCommandExecutorSQLTraverse() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
assignTarget(Map<Object,Object> iArgs)
Assign the right TARGET if found.
|
Object |
execute(Map<Object,Object> iArgs)
Execute the requested command parsed previously.
|
OCommandContext |
getContext() |
OCommandDistributedReplicateRequest.QUORUM_TYPE |
getQuorumType()
Returns the quorum type for the command:
NONE: no quorum
READ: configured Read quorum
WRITE: configured Write quorum
ALL: all nodes
|
String |
getSyntax() |
Iterator<OIdentifiable> |
iterator() |
Iterator<OIdentifiable> |
iterator(Map<Object,Object> iArgs) |
OCommandExecutorSQLTraverse |
parse(OCommandRequest iRequest)
Compile the filter conditions only the first time.
|
protected int |
parseFields() |
protected boolean |
parseMaxDepth(String w) |
protected boolean |
parseStrategy(String w)
Parses the strategy keyword if found.
|
protected void |
warnDeprecatedWhere() |
applyLimitAndSkip, assignLetClauses, evaluateRecord, filter, getDistributedExecutionMode, getDistributedResultManagement, getRange, getResult, getResultInstance, getTarget, handleResult, isCacheable, isIdempotent, isLazyIteration, isUseCache, mergeResults, optimize, optimizeBranch, optimizeFunction, parseLet, parseLimit, parseSkip, pushResult, searchInClasses, searchInClasses, searchInClasses, searchInClusters, setCompiledFilter, setLazyIteration, setParsedTarget, setRequest, setTarget
bindDefaultContextVariables, checkClusterAccess, decodeClassName, getInvolvedClustersOfClasses, getInvolvedClustersOfClusters, getInvolvedClustersOfIndex, parseLock, parseTimeout, preParse, throwParsingException, throwParsingException, throwSyntaxErrorException
checkInterruption, checkInterruption, getDatabase, getDistributedTimeout, getFetchPlan, getInvolvedClusters, getLimit, getParameters, getProgressListener, getSecurityOperationType, getUndoCommand, init, involveSchema, isDistributedExecutingOnLocalNodeFirst, isLocalExecution, setContext, setLimit, setProgressListener, toString, upperCase
getLastWordLength, getWordStatic, nextWord, nextWord, parseOptionalWord, parserGetCurrentChar, parserGetCurrentPosition, parserGetLastSeparator, parserGetLastWord, parserGetPreviousPosition, parserGoBack, parserIsEnded, parserMoveCurrentPosition, parserNextChars, parserNextWord, parserNextWord, parserNextWord, parserOptionalKeyword, parserOptionalWord, parserRequiredKeyword, parserRequiredWord, parserRequiredWord, parserRequiredWord, parserSetCurrentPosition, parserSetEndOfText, parserSetLastSeparator, parserSkipWhiteSpaces
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getDistributedTimeout, getUndoCommand, isDistributedExecutingOnLocalNodeFirst
forEach, spliterator
public static final String KEYWORD_WHILE
public static final String KEYWORD_TRAVERSE
public static final String KEYWORD_STRATEGY
public static final String KEYWORD_MAXDEPTH
public OCommandExecutorSQLTraverse parse(OCommandRequest iRequest)
parse
in interface OCommandExecutor
parse
in class OCommandExecutorSQLResultsetAbstract
iRequest
- Command request implementation.#execute(Map
protected boolean parseMaxDepth(String w) throws OCommandSQLParsingException
OCommandSQLParsingException
public Object execute(Map<Object,Object> iArgs)
OCommandExecutor
iArgs
- Optional variable arguments to pass to the command.OCommandExecutor.parse(OCommandRequest)
public OCommandContext getContext()
getContext
in interface OCommandExecutor
getContext
in class OCommandExecutorAbstract
public Iterator<OIdentifiable> iterator()
public Iterator<OIdentifiable> iterator(Map<Object,Object> iArgs)
public String getSyntax()
getSyntax
in interface OCommandExecutor
getSyntax
in class OBaseParser
protected void warnDeprecatedWhere()
protected boolean assignTarget(Map<Object,Object> iArgs)
OCommandExecutorSQLResultsetAbstract
assignTarget
in class OCommandExecutorSQLResultsetAbstract
iArgs
- Parameters to bindprotected int parseFields()
protected boolean parseStrategy(String w) throws OCommandSQLParsingException
OCommandSQLParsingException
public OCommandDistributedReplicateRequest.QUORUM_TYPE getQuorumType()
OCommandDistributedReplicateRequest
Copyright © 2009–2020 OrientDB. All rights reserved.