While going through the documentation (data-types) of Apache AGE, I ran into some interesting queries that demonstrated the input/output format of data types. Such as: -
SELECT *
FROM cypher('graph_name', $$
RETURN 1
$$) AS (int_result agtype);
Which as expected outputs
int_result
1
(1 row)
However, if the query is modified to
SELECT *
FROM cypher('graph_name', $$
RETURN 1.4
$$) AS (int_result agtype);
It still outputs
int_result
1.4
(1 row)
The behavior is also noticed in boolean datatype in which you can enter any numeric value, and it outputs it as it is, for an instance
SELECT *
FROM cypher('graph_name', $$
RETURN 1.5
$$) AS (boolean_result agtype);
Will output
boolean_result
1.5
(1 row)
It is also interesting to note that any other input (except numeric, true, or false), for example 't' gives an error for the same boolean query.
SELECT *
FROM cypher('graph_name', $$
RETURN t
$$) AS (boolean_result agtype);
Will output
ERROR: could not find rte for t
I was expecting similar behavior for other inputs that did not match the data types, however, they proceeded just fine. What may be the developmental reason for such behavior?