Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom functions stop working #9888

Closed
johny65 opened this issue Oct 27, 2022 · 2 comments
Closed

Custom functions stop working #9888

johny65 opened this issue Oct 27, 2022 · 2 comments
Assignees
Labels
Milestone

Comments

@johny65
Copy link

johny65 commented Oct 27, 2022

OrientDB Version: 3.2.11

Java Version: openjdk 11.0.16 2022-07-19

OS: Ubuntu 22.04.1

Expected behavior

Calling custom functions from SQL without problems.

Actual behavior

Some custom functions (not all, I don't know what it depends) don't work anymore, now it throws an exception "OCommandExecutorNotFoundException". Pre existing functions working fine stop working now. This is broke in 3.2.11.

Steps to reproduce

create function test_function "let $b = true; console.log($b);" IDEMPOTENT true language sql;
select test_function();

The previous throws the following exception in 3.2.11:

com.orientechnologies.orient.core.command.OCommandExecutorNotFoundException: Cannot find a command executor for the command request: sql.true
	DB name="my_db"
	at com.orientechnologies.orient.core.sql.OCommandExecutorSQLDelegate.parse(OCommandExecutorSQLDelegate.java:53)
	at com.orientechnologies.orient.core.sql.OCommandExecutorSQLDelegate.parse(OCommandExecutorSQLDelegate.java:38)
	at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.command(OAbstractPaginatedStorage.java:4326)
	at com.orientechnologies.orient.core.command.OCommandRequestTextAbstract.execute(OCommandRequestTextAbstract.java:63)
	at com.orientechnologies.orient.core.command.script.OCommandExecutorScript.executeCommand(OCommandExecutorScript.java:553)
	at com.orientechnologies.orient.core.command.script.OCommandExecutorScript.executeLet(OCommandExecutorScript.java:682)
	at com.orientechnologies.orient.core.command.script.OCommandExecutorScript.executeSQLScript(OCommandExecutorScript.java:348)
	at com.orientechnologies.orient.core.command.script.OCommandExecutorScript.executeSQL(OCommandExecutorScript.java:266)
	at com.orientechnologies.orient.core.command.script.OCommandExecutorScript.executeInContext(OCommandExecutorScript.java:123)
	at com.orientechnologies.orient.core.command.script.OCommandExecutorScript.execute(OCommandExecutorScript.java:106)
	at com.orientechnologies.orient.core.command.OSqlScriptExecutor.executeFunction(OSqlScriptExecutor.java:146)
	at com.orientechnologies.orient.core.metadata.function.OFunction.executeInContext(OFunction.java:173)
	at com.orientechnologies.orient.core.metadata.function.ODatabaseFunction.execute(ODatabaseFunction.java:46)
	at com.orientechnologies.orient.core.sql.parser.OFunctionCall.execute(OFunctionCall.java:131)
	at com.orientechnologies.orient.core.sql.parser.OFunctionCall.execute(OFunctionCall.java:82)
	at com.orientechnologies.orient.core.sql.parser.OLevelZeroIdentifier.execute(OLevelZeroIdentifier.java:52)
	at com.orientechnologies.orient.core.sql.parser.OBaseIdentifier.execute(OBaseIdentifier.java:62)
	at com.orientechnologies.orient.core.sql.parser.OBaseExpression.execute(OBaseExpression.java:111)
	at com.orientechnologies.orient.core.sql.parser.OExpression.execute(OExpression.java:102)
	at com.orientechnologies.orient.core.sql.parser.OProjectionItem.execute(OProjectionItem.java:155)
	at com.orientechnologies.orient.core.sql.parser.OProjection.calculateSingle(OProjection.java:123)
	at com.orientechnologies.orient.core.sql.executor.ProjectionCalculationStep.calculateProjections(ProjectionCalculationStep.java:64)
	at com.orientechnologies.orient.core.sql.executor.ProjectionCalculationStep.access$000(ProjectionCalculationStep.java:10)
	at com.orientechnologies.orient.core.sql.executor.ProjectionCalculationStep$1.next(ProjectionCalculationStep.java:39)
	at com.orientechnologies.orient.core.sql.parser.OLocalResultSet.next(OLocalResultSet.java:70)

In 3.2.10 it works fine logging "true" in server console.

@tglman tglman self-assigned this Oct 27, 2022
@tglman tglman added the bug label Oct 27, 2022
@tglman tglman added this to the 3.2.x milestone Oct 27, 2022
@tglman
Copy link
Member

tglman commented Oct 27, 2022

Hi,

Thanks, to report this, work has been done in 3.2.11 for completely support javascript functions with the graal executor, this may have introduced a regression.

We will have a look if you have a simple copy and past unit test will be very helpful.

Regards

@tglman
Copy link
Member

tglman commented Nov 10, 2022

Hi,

The release 3.2.12 contains the fix for this case, closing this, feel free to reopen if you still experience the problem.

Regards

@tglman tglman closed this as completed Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants