Package com.arcadedb.query.sql.parser
Class Expression
- java.lang.Object
-
- com.arcadedb.query.sql.parser.SimpleNode
-
- com.arcadedb.query.sql.parser.Expression
-
- All Implemented Interfaces:
Node
- Direct Known Subclasses:
ArrayConcatExpressionElement
,ValueExpression
public class Expression extends SimpleNode
-
-
Field Summary
Fields Modifier and Type Field Description protected ArrayConcatExpression
arrayConcatExpression
protected Boolean
booleanValue
protected Boolean
doubleQuotes
protected boolean
isNull
protected Json
json
protected MathExpression
mathExpression
protected Rid
rid
protected Boolean
singleQuotes
-
Fields inherited from class com.arcadedb.query.sql.parser.SimpleNode
children, firstToken, id, lastToken, parent, parser, value
-
-
Constructor Summary
Constructors Constructor Description Expression(int id)
Expression(Identifier identifier)
Expression(Identifier identifier, Modifier modifier)
Expression(RecordAttribute attr, Modifier modifier)
Expression(SqlParser p, int id)
-
Method Summary
-
Methods inherited from class com.arcadedb.query.sql.parser.SimpleNode
childrenAccept, dump, getValue, jjtAccept, jjtAddChild, jjtClose, jjtGetChild, jjtGetFirstToken, jjtGetLastToken, jjtGetNumChildren, jjtGetParent, jjtGetValue, jjtOpen, jjtSetFirstToken, jjtSetLastToken, jjtSetParent, jjtSetValue, toString, toString
-
-
-
-
Field Detail
-
singleQuotes
protected Boolean singleQuotes
-
doubleQuotes
protected Boolean doubleQuotes
-
isNull
protected boolean isNull
-
rid
protected Rid rid
-
mathExpression
protected MathExpression mathExpression
-
arrayConcatExpression
protected ArrayConcatExpression arrayConcatExpression
-
json
protected Json json
-
booleanValue
protected Boolean booleanValue
-
-
Constructor Detail
-
Expression
public Expression(int id)
-
Expression
public Expression(SqlParser p, int id)
-
Expression
public Expression(Identifier identifier)
-
Expression
public Expression(Identifier identifier, Modifier modifier)
-
Expression
public Expression(RecordAttribute attr, Modifier modifier)
-
-
Method Detail
-
execute
public Object execute(Identifiable iCurrentRecord, CommandContext ctx)
-
execute
public Object execute(Result iCurrentRecord, CommandContext ctx)
-
isBaseIdentifier
public boolean isBaseIdentifier()
-
isEarlyCalculated
public boolean isEarlyCalculated()
-
getDefaultAlias
public Identifier getDefaultAlias()
-
toString
public void toString(Map<String,Object> params, StringBuilder builder)
- Overrides:
toString
in classSimpleNode
-
supportsBasicCalculation
public boolean supportsBasicCalculation()
-
isIndexedFunctionCal
public boolean isIndexedFunctionCal()
-
estimateIndexedFunction
public long estimateIndexedFunction(FromClause target, CommandContext context, BinaryCompareOperator operator, Object right)
-
executeIndexedFunction
public Iterable<Record> executeIndexedFunction(FromClause target, CommandContext context, BinaryCompareOperator operator, Object right)
-
canExecuteIndexedFunctionWithoutIndex
public boolean canExecuteIndexedFunctionWithoutIndex(FromClause target, CommandContext context, BinaryCompareOperator operator, Object right)
tests if current expression is an indexed function AND that function can also be executed without using the index- Parameters:
target
- the query targetcontext
- the execution contextoperator
-right
-- Returns:
- true if current expression is an indexed funciton AND that function can also be executed without using the index, false otherwise
-
allowsIndexedFunctionExecutionOnTarget
public boolean allowsIndexedFunctionExecutionOnTarget(FromClause target, CommandContext context, BinaryCompareOperator operator, Object right)
tests if current expression is an indexed function AND that function can be used on this target- Parameters:
target
- the query targetcontext
- the execution contextoperator
-right
-- Returns:
- true if current expression involves an indexed function AND that function can be used on this target, false otherwise
-
executeIndexedFunctionAfterIndexSearch
public boolean executeIndexedFunctionAfterIndexSearch(FromClause target, CommandContext context, BinaryCompareOperator operator, Object right)
tests if current expression is an indexed function AND the function has also to be executed after the index search. In some cases, the index search is accurate, so this condition can be excluded from further evaluation. In other cases the result from the index is a superset of the expected result, so the function has to be executed anyway for further filtering- Parameters:
target
- the query targetcontext
- the execution context- Returns:
- true if current expression involves an indexed function AND the function has also to be executed after the index search.
-
isExpand
public boolean isExpand()
-
getExpandContent
public Expression getExpandContent()
-
isAggregate
public boolean isAggregate()
-
splitForAggregation
public Expression splitForAggregation(AggregateProjectionSplit aggregateSplit)
-
getAggregationContext
public AggregationContext getAggregationContext(CommandContext ctx)
-
copy
public Expression copy()
- Overrides:
copy
in classSimpleNode
-
setMathExpression
public void setMathExpression(MathExpression mathExpression)
-
extractSubQueries
public void extractSubQueries(SubQueryCollector collector)
-
extractSubQueries
public void extractSubQueries(Identifier letAlias, SubQueryCollector collector)
-
refersToParent
public boolean refersToParent()
-
getRid
public Rid getRid()
-
setRid
public void setRid(Rid rid)
-
getMathExpression
public MathExpression getMathExpression()
-
applyRemove
public void applyRemove(ResultInternal result, CommandContext ctx)
-
isCount
public boolean isCount()
-
getArrayConcatExpression
public ArrayConcatExpression getArrayConcatExpression()
-
setArrayConcatExpression
public void setArrayConcatExpression(ArrayConcatExpression arrayConcatExpression)
-
serialize
public Result serialize()
-
deserialize
public void deserialize(Result fromResult)
-
isDefinedFor
public boolean isDefinedFor(Result currentRecord)
-
isDefinedFor
public boolean isDefinedFor(Record currentRecord)
-
isCacheable
public boolean isCacheable()
-
-