Skip to content

Unknown function eval() #563

Closed
Closed

Description

@gramian

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');

Activity

  1. lvca commented on Oct 13, 2022

    @lvca
    Member

    Trying to ask to the contributors why eval() is not in our codebase (from OrientDB). I guess eval() 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?

  2. lvca commented on Oct 13, 2022

    @lvca
    Member

    I guess you should be able to do select 1 + 1 with no problem.

  3. added
    documentation
    on Oct 13, 2022
  4. self-assigned this
    on Oct 13, 2022
  5. added this to the 22.10.1 milestone on Oct 13, 2022
  6. gramian commented on Oct 13, 2022

    @gramian
    CollaboratorAuthor

    SELECT 1 + 1; works indeed, I tried to resort to eval() inside SELECT when testing comparisons, see #564 .

  7. lvca commented on Oct 13, 2022

    @lvca
    Member

    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.

  8. gramian commented on Oct 13, 2022

    @gramian
    CollaboratorAuthor

    I agree, that removing eval() is the better path.

  9. reopened this on Feb 1, 2023
  10. lvca commented on Feb 1, 2023

    @lvca
    Member

    I can see it could still be useful having a dynamic function called eval() like with OrientDB. So reopening this issue.

  11. modified the milestones: 22.10.1, 23.1.2 on Feb 1, 2023
  12. added
    enhancement
    and removed
    documentation
    on Feb 1, 2023
  13. lvca commented on Feb 1, 2023

    @lvca
    Member

    Fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions