Query installation fail on evaluate for SYNTAX v2

Hi,

I am facing issue with evaluate in WHERE for SYNTAX v2. Syntax used as below
‘evaluate(filters,“string”)’

But its working in SYNTAX v1.

Thanks,
RK

@chintarksc

Could you post a larger chunk of your code here? What is the exact error?

CREATE QUERY testing() FOR GRAPH GraphName SYNTAX v2 {
STRING filters;
VertexSet =
SELECT alias_2
FROM Vertex1:alias_1 - (Edge1:alias_3) - Vertex2:alias_2
WHERE evaluate(filters,“string”);
}

Using GraphStudio I am able to save the query without GSQL errors shown at logs, but unable to publish it. Popping out a window as below


Using command prompt, I am not able to save the query as well. Returning as below
The query testingv2 cannot be added!

Could you also send the version written in Syntax v1 that works?

I am struggling to understand what you are using the evaluate function for, since the WHERE clause expects a BOOL value, but your evaluate() expression explicitly evaluates to a STRING type which feeds into the WHERE clause.

If you are intending to use a BOOL value, then the call should be evaluate(filters,“bool”) or even just evaluate(filters) since the type arg defaults to “bool”.

If helpful, here is the relevant documentation for evaluate().

Below is the Query using V1 SYNTAX

CREATE QUERY testing() FOR GRAPH GraphName {
STRING filters;
Start = {Vertex1.*};
VertexSet =
SELECT alias_2
FROM Start:alias_1 - (Edge1:alias_3) - Vertex2:alias_2
WHERE evaluate(filters) ;
}

@Leo_Shestakov as you mentioned Syntax V1 is allowing it, but V2 is not allowing it as its asking for two parameters to the function. I have tried using “bool” instead of “string”, but no use still facing the issue as query installation failed.

@Leo_Shestakov all I am trying to do is pass the filter values as parameter to the query and execute it.

Take this as example,

Syntax V1
#Parameter value will be “alias_1.name==“abc””
CREATE QUERY testing(STRING filters) FOR GRAPH GraphName {
Start = {Vertex1.*};
VertexSet = SELECT alias_2
FROM Start:alias_1 - (Edge1:alias_3) - Vertex2:alias_2
WHERE evaluate(filters) ; #Not mandating for two parameters
}

Syntax V2
#Parameter filters will be “alias_1.name==“abc””
CREATE QUERY testing(STRING filters) FOR GRAPH GraphName SYNTAX v2 {
VertexSet = SELECT alias_2
FROM Vertex1:alias_1 - (Edge1:alias_3) - Vertex2:alias_2
WHERE evaluate(filters,“bool”); #Mandating for two parameters
}