CapnSpek opened a new issue, #870:
URL: https://github.com/apache/age/issues/870
**Describe the bug**
While evaluating the inequality between an edge and a path, it appears that
the orderability is totally bypassed and true/false is returned based on the
sign of the inequality.
**How are you accessing AGE (Command line, driver, etc.)?**
Command line
**What data setup do we need to do?**
Apache AGE, and any graph with atleast 2 vertices and 1 edge.
...
SELECT * from cypher('my_graph_name', $$
CREATE (:Person {name: 'John'})-[:Knows]->(:Person {name: 'Jonh'})
$$) as (a agtype);
...
```
**What is the necessary configuration info needed?**
Any graph with atleast 2 vertices and 1 edge.
**What is the command that caused the error?**
0
In regards to orderability between different agtypes: -
https://age.apache.org/age-manual/master/intro/comparability.html
I was testing the orderability between path and an edge, and I found this
odd behavior: -
Comparing a path with an edge with p > e inequality: -
test=# SELECT *
FROM cypher('test', $$
WITH [{id: 0, label: "label_name_1", properties: {i: 0}}::vertex,
{id: 2, start_id: 0, end_id: 1, label: "edge_label", properties:
{i: 0}}::edge,
{id: 1, label: "label_name_2", properties: {}}::vertex
]::path as p
MATCH (n)-[e]-(m) RETURN p>e
$$) AS (e agtype);
e
------
true
true
true
true
(4 rows)
Fair enough, same result holds when we compare it with p < e inequality
test=# SELECT *
FROM cypher('test', $$
WITH [{id: 0, label: "label_name_1", properties: {i: 0}}::vertex,
{id: 2, start_id: 0, end_id: 1, label: "edge_label", properties:
{i: 0}}::edge,
{id: 1, label: "label_name_2", properties: {}}::vertex
]::path as p
MATCH (n)-[e]-(m) RETURN p<e
$$) AS (e agtype);
e
-------
false
false
false
false
(4 rows)
But look, when we change the inequality to e > p
test=# SELECT *
FROM cypher('test', $$
WITH [{id: 0, label: "label_name_1", properties: {i: 0}}::vertex,
{id: 2, start_id: 0, end_id: 1, label: "edge_label", properties:
{i: 0}}::edge,
{id: 1, label: "label_name_2", properties: {}}::vertex
]::path as p
MATCH (n)-[e]-(m) RETURN e>p
$$) AS (e agtype);
e
------
true
true
true
true
(4 rows)
We get true again, which is in direct contradiction to p > e inequality
And when we check for e < p, we get false again
test=# SELECT *
FROM cypher('test', $$
WITH [{id: 0, label: "label_name_1", properties: {i: 0}}::vertex,
{id: 2, start_id: 0, end_id: 1, label: "edge_label", properties:
{i: 0}}::edge,
{id: 1, label: "label_name_2", properties: {}}::vertex
]::path as p
MATCH (n)-[e]-(m) RETURN e<p
$$) AS (e agtype);
e
-------
false
false
false
false
(4 rows)
Again, in direct contradiction to the first 2 results.
**Expected behavior**
Would have expected p>e to be true under all scenarios.
**Environment (please complete the following information):**
- Version: [age 1.3.0]
**Additional context**
-
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]