public class OCommandExecutorSQLSelect extends OCommandExecutorSQLResultsetAbstract implements OTemporaryRidGenerator
OCommandDistributedReplicateRequest.DISTRIBUTED_EXECUTION_MODE, OCommandDistributedReplicateRequest.DISTRIBUTED_RESULT_MGMT, OCommandDistributedReplicateRequest.QUORUM_TYPE
Modifier and Type | Field and Description |
---|---|
static String |
KEYWORD_ASC |
static String |
KEYWORD_BY |
static String |
KEYWORD_DESC |
static String |
KEYWORD_FETCHPLAN |
static String |
KEYWORD_GROUP |
static String |
KEYWORD_NOCACHE |
static String |
KEYWORD_ORDER |
static String |
KEYWORD_SELECT |
static String |
KEYWORD_UNWIND |
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 |
---|
OCommandExecutorSQLSelect() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
addResult(OIdentifiable iRecord,
OCommandContext iContext) |
protected boolean |
assignTarget(Map<Object,Object> iArgs)
Assign the right TARGET if found.
|
protected Map<String,Object> |
createProjectionFromDefinition() |
Object |
execute(Map<Object,Object> iArgs)
Execute the requested command parsed previously.
|
protected void |
executeSearch(Map<Object,Object> iArgs) |
protected boolean |
executeSearchRecord(OIdentifiable id,
OCommandContext iContext,
boolean callHooks) |
protected int |
extractProjectionNameSubstringEndPosition(String projection) |
String |
getFetchPlan() |
Set<String> |
getInvolvedClusters()
Determine clusters that are used in select operation
|
Map<String,String> |
getProjectionDefinition() |
protected ORuntimeResult |
getProjectionGroup(Object fieldValue,
OCommandContext iContext) |
Map<String,Object> |
getProjections() |
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() |
int |
getTemporaryRIDCounter(OCommandContext iContext)
Returns the temporary RID counter assuring it's unique per query tree.
|
protected boolean |
handleResult(OIdentifiable iRecord,
OCommandContext iContext)
Handles the record in result.
|
boolean |
hasGroupBy() |
void |
initContext() |
boolean |
isAnyFunctionAggregates() |
protected boolean |
isUseCache() |
Iterator<OIdentifiable> |
iterator() |
Iterator<OIdentifiable> |
iterator(Map<Object,Object> iArgs) |
protected boolean |
optimizeExecution() |
OCommandExecutorSQLSelect |
parse(OCommandRequest iRequest)
Compile the filter conditions only the first time.
|
protected boolean |
parseFetchplan(String w)
Parses the fetchplan keyword if found.
|
protected void |
parseGroupBy() |
protected boolean |
parseNoCache(String w)
Parses the NOCACHE keyword if found.
|
protected void |
parseOrderBy() |
protected int |
parseProjections() |
protected void |
parseUnwind() |
protected void |
reportTip(String iMessage)
Report the tip to the profiler and collect it in context to be reported by tools like Studio
|
protected void |
revertProfiler(OCommandContext iContext,
OIndex index,
List<Object> keyParams,
OIndexDefinition indexDefinition) |
protected void |
revertSubclassesProfiler(OCommandContext iContext,
int num) |
protected void |
searchInClasses() |
void |
setFetchLimit(int fetchLimit) |
void |
setFetchPlan(String fetchPlan) |
void |
setGroupByFields(List<String> groupByFields) |
void |
setNoCache(boolean noCache) |
void |
setOrderedFields(List<OPair<String,String>> orderedFields) |
void |
setParallel(boolean parallel) |
void |
setProjectionDefinition(Map<String,String> projectionDefinition) |
void |
setProjections(Map<String,Object> projections) |
applyLimitAndSkip, assignLetClauses, evaluateRecord, filter, getDistributedExecutionMode, getDistributedResultManagement, getRange, getResult, getResultInstance, getTarget, isCacheable, isIdempotent, isLazyIteration, mergeResults, optimize, optimizeBranch, optimizeFunction, parseLet, parseLimit, parseSkip, pushResult, searchInClasses, searchInClasses, searchInClusters, setCompiledFilter, setLazyIteration, setParsedTarget, setRequest, setTarget
bindDefaultContextVariables, checkClusterAccess, decodeClassName, getInvolvedClustersOfClasses, getInvolvedClustersOfClusters, getInvolvedClustersOfIndex, parseLock, parseTimeout, preParse, throwParsingException, throwParsingException, throwSyntaxErrorException
checkInterruption, checkInterruption, getContext, getDatabase, getDistributedTimeout, 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_SELECT
public static final String KEYWORD_ASC
public static final String KEYWORD_DESC
public static final String KEYWORD_ORDER
public static final String KEYWORD_BY
public static final String KEYWORD_GROUP
public static final String KEYWORD_UNWIND
public static final String KEYWORD_FETCHPLAN
public static final String KEYWORD_NOCACHE
public boolean hasGroupBy()
protected boolean isUseCache()
isUseCache
in class OCommandExecutorSQLResultsetAbstract
public OCommandExecutorSQLSelect parse(OCommandRequest iRequest)
parse
in interface OCommandExecutor
parse
in class OCommandExecutorSQLResultsetAbstract
iRequest
- Command request implementation.#execute(Map
public Set<String> getInvolvedClusters()
getInvolvedClusters
in interface OCommandExecutor
getInvolvedClusters
in class OCommandExecutorAbstract
public boolean isAnyFunctionAggregates()
ture
if any of the sql functions perform aggregation, false
otherwisepublic Iterator<OIdentifiable> iterator()
iterator
in interface Iterable<OIdentifiable>
public Iterator<OIdentifiable> iterator(Map<Object,Object> iArgs)
iterator
in interface OIterableRecordSource
public Object execute(Map<Object,Object> iArgs)
OCommandExecutor
execute
in interface OCommandExecutor
iArgs
- Optional variable arguments to pass to the command.OCommandExecutor.parse(OCommandRequest)
public String getSyntax()
getSyntax
in interface OCommandExecutor
getSyntax
in class OBaseParser
public String getFetchPlan()
getFetchPlan
in interface OCommandExecutor
getFetchPlan
in class OCommandExecutorAbstract
protected boolean assignTarget(Map<Object,Object> iArgs)
OCommandExecutorSQLResultsetAbstract
assignTarget
in class OCommandExecutorSQLResultsetAbstract
iArgs
- Parameters to bindprotected boolean executeSearchRecord(OIdentifiable id, OCommandContext iContext, boolean callHooks)
protected boolean handleResult(OIdentifiable iRecord, OCommandContext iContext)
handleResult
in class OCommandExecutorSQLResultsetAbstract
iRecord
- Record to handlepublic int getTemporaryRIDCounter(OCommandContext iContext)
getTemporaryRIDCounter
in interface OTemporaryRidGenerator
protected boolean addResult(OIdentifiable iRecord, OCommandContext iContext)
protected void reportTip(String iMessage)
protected ORuntimeResult getProjectionGroup(Object fieldValue, OCommandContext iContext)
protected void parseGroupBy()
protected void parseUnwind()
protected void parseOrderBy()
protected void searchInClasses()
searchInClasses
in class OCommandExecutorSQLResultsetAbstract
protected int parseProjections()
protected int extractProjectionNameSubstringEndPosition(String projection)
protected boolean parseFetchplan(String w) throws OCommandSQLParsingException
OCommandSQLParsingException
protected boolean optimizeExecution()
protected void revertSubclassesProfiler(OCommandContext iContext, int num)
protected void revertProfiler(OCommandContext iContext, OIndex index, List<Object> keyParams, OIndexDefinition indexDefinition)
protected boolean parseNoCache(String w) throws OCommandSQLParsingException
OCommandSQLParsingException
public void initContext()
public void setProjectionDefinition(Map<String,String> projectionDefinition)
public void setFetchLimit(int fetchLimit)
public void setFetchPlan(String fetchPlan)
public void setParallel(boolean parallel)
public void setNoCache(boolean noCache)
public OCommandDistributedReplicateRequest.QUORUM_TYPE getQuorumType()
OCommandDistributedReplicateRequest
getQuorumType
in interface OCommandDistributedReplicateRequest
Copyright © 2009–2020 OrientDB. All rights reserved.