I am trying to get the average of a column from Datastore table using ZCQL query. The column is of Boolean Datatype. When I tried executing the ZCQL query from Query Console, I am the getting the proper response. Refer Screenshot below ZCQL
But when I try the same query from the Node function I am getting the following error: Function
"Request failed with status 400 and code : ZCQL QUERY ERROR , message : Error occured during query processing"
I double checked the query but I am still getting the same error. Can someone help me resolve this?
From the query console screenshot, I can see you are trying to execute the ZCQL query using "API Version 2"(V2). But the default ZCQL version when executing your Catalyst function will be ZCQL V1(API Version 1) which caused this issue. You can try replicating this error from query console by changing the API version to "API Version 1" and try executing the query again.
To resolve this issue, you can try adding the env variable
"ZOHO_CATALYST_ZCQL_PARSER":"V2"
in your catalyst-config.json file inside your function folder which will allow to execute your ZCQL query on ZCQL V2. You can find the official help documentation for the ZCQL V2 Parser here.