Repository navigation
Closed
Description
ArcadeDB Version: v22.9.1 (build d082adc/1664822987697/main)
JDK Version: openjdk 11.0.16 2022-07-19
OS: Ubuntu 22.04
Expected behavior
2
Actual behavior
Cannot execute command Unknown function name :eval
Trace
<ArcadeDB_0> Error on command execution (PostCommandHandler)
com.arcadedb.exception.CommandExecutionException: Unknown function name :eval
at com.arcadedb.query.sql.function.SQLFunctionFactoryTemplate.createFunction(SQLFunctionFactoryTemplate.java:64)
at com.arcadedb.query.sql.executor.SQLEngine.getFunction(SQLEngine.java:89)
at com.arcadedb.query.sql.parser.FunctionCall.isAggregateFunction(FunctionCall.java:318)
at com.arcadedb.query.sql.parser.FunctionCall.isAggregate(FunctionCall.java:260)
at com.arcadedb.query.sql.parser.LevelZeroIdentifier.isAggregate(LevelZeroIdentifier.java:176)
at com.arcadedb.query.sql.parser.BaseIdentifier.isAggregate(BaseIdentifier.java:181)
at com.arcadedb.query.sql.parser.BaseExpression.isAggregate(BaseExpression.java:273)
at com.arcadedb.query.sql.parser.Expression.isAggregate(Expression.java:385)
at com.arcadedb.query.sql.parser.ProjectionItem.isAggregate(ProjectionItem.java:198)
at com.arcadedb.query.sql.executor.SelectExecutionPlanner.isAggregate(SelectExecutionPlanner.java:839)
at com.arcadedb.query.sql.executor.SelectExecutionPlanner.splitProjectionsForGroupBy(SelectExecutionPlanner.java:803)
at com.arcadedb.query.sql.executor.SelectExecutionPlanner.optimizeQuery(SelectExecutionPlanner.java:650)
at com.arcadedb.query.sql.executor.SelectExecutionPlanner.createExecutionPlan(SelectExecutionPlanner.java:131)
at com.arcadedb.query.sql.parser.SelectStatement.createExecutionPlan(SelectStatement.java:217)
at com.arcadedb.query.sql.parser.Statement.createExecutionPlan(Statement.java:105)
at com.arcadedb.database.EmbeddedDatabase.executeInternal(EmbeddedDatabase.java:1275)
at com.arcadedb.database.EmbeddedDatabase.execute(EmbeddedDatabase.java:1244)
at com.arcadedb.server.ServerDatabase.execute(ServerDatabase.java:415)
at com.arcadedb.server.http.handler.PostCommandHandler.executeScript(PostCommandHandler.java:100)
at com.arcadedb.server.http.handler.PostCommandHandler.execute(PostCommandHandler.java:71)
at com.arcadedb.server.http.handler.DatabaseAbstractHandler.execute(DatabaseAbstractHandler.java:85)
at com.arcadedb.server.http.handler.AbstractHandler.handleRequest(AbstractHandler.java:111)
at io.undertow.server.RoutingHandler.handleRequest(RoutingHandler.java:93)
at io.undertow.server.handlers.PathHandler.handleRequest(PathHandler.java:104)
at io.undertow.server.Connectors.executeRootHandler(Connectors.java:387)
at io.undertow.server.protocol.http.HttpReadListener.handleEventWithNoRunningRequest(HttpReadListener.java:256)
at io.undertow.server.protocol.http.HttpReadListener.handleEvent(HttpReadListener.java:136)
at io.undertow.server.protocol.http.HttpReadListener.handleEvent(HttpReadListener.java:59)
at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)
at org.xnio.conduits.ReadReadyHandler$ChannelListenerHandler.readReady(ReadReadyHandler.java:66)
at org.xnio.nio.NioSocketConduit.handleReady(NioSocketConduit.java:89)
at org.xnio.nio.WorkerThread.run(WorkerThread.java:591)
Steps to reproduce
SELECT eval('1 + 1');
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity
lvca commentedon Oct 13, 2022
Trying to ask to the contributors why
eval()is not in our codebase (from OrientDB). I guesseval()is an old function and in the past years our SQL engine is able to compute math without using the eval function. @antarcticgiraffe any idea?lvca commentedon Oct 13, 2022
I guess you should be able to do
select 1 + 1with no problem.gramian commentedon Oct 13, 2022
SELECT 1 + 1;works indeed, I tried to resort toeval()insideSELECTwhen testing comparisons, see #564 .lvca commentedon Oct 13, 2022
I guess we should remove
eval()from the docs, or add the function from OrientDB. I prefer updating the docs, but in case we find some interesting use case, we could evaluate adding it back.Removed docs about `eval()` because not part of ArcadeDB code base
gramian commentedon Oct 13, 2022
I agree, that removing
eval()is the better path.lvca commentedon Feb 1, 2023
I can see it could still be useful having a dynamic function called
eval()like with OrientDB. So reopening this issue.feat: supported `eval()` function, fixed function `if()`
lvca commentedon Feb 1, 2023
Fixed.
feat: supported `eval()` function, fixed function `if()`