dukeofhazardz opened a new issue, #972:
URL: https://github.com/apache/age/issues/972

   I encountered an issue while performing a hybrid query using an SQL table 
and an AGE graph. The query is intended to retrieve rows from the SQL table 
that match the city values returned by a Cypher query on the AGE graph. 
However, the query does not return any results, even though there are matching 
city values present in both the SQL table and the AGE graph.
   I created the SQL Table `Persons`.
   
   **Steps to Reproduce:**
   
   - Create an SQL table named `Persons` with columns: `id`, `name`, `city`, 
and `hired_year`.
   - Insert sample data into the `Persons` table.
   - Create an AGE graph named `test` with label: `Person` and properties: 
`name`, `city`, and `role`.
   - Perform the hybrid query, matching the `city` values from the SQL table 
with the `city` values returned by the Cypher query.
   ```
   demo=# SELECT * FROM Persons;
    id  |    name    |  city  | hired_year
   -----+------------+--------+------------
    123 | "Daniel"   | Lagos  |       2023
    124 | "Emmanuel" | Vancouver  |       2018
    125 | "Grace"  | Sydney |       2021
    127 | "Sam"      | Lisbon  |       2020
    121 | "Precious" | Toronto |       2021
    122 | "Fred"     | Phoenix  |       2023
   (6 rows)
   ```
   And the AGE Graph `test` 
   ```
   demo=# SELECT * FROM cypher('test', $$
   demo$# Match (u)
   demo$# RETURN u
   demo$# $$) as (a agtype);
                                                                   a
   
---------------------------------------------------------------------------------------------------------------------------------
    {"id": 844424930131969, "label": "Person", "properties": {"city": "Lagos", 
"name": "Daniel", "role": "Developer"}}::vertex
    {"id": 844424930131970, "label": "Person", "properties": {"city": 
"Vancouver", "name": "Emmanuel", "role": "Data Analyst"}}::vertex
    {"id": 844424930131971, "label": "Person", "properties": {"city": "Sydney", 
"name": "Grace", "role": "Accountant"}}::vertex
    {"id": 844424930131972, "label": "Person", "properties": {"city": "Lisbon", 
"name": "Sam", "role": "Designer"}}::vertex
    {"id": 844424930131973, "label": "Person", "properties": {"city": 
"Toronto", "name": "Precious", "role": "Designer"}}::vertex
    {"id": 844424930131974, "label": "Person", "properties": {"city": 
"Phoenix", "name": "Fred", "role": "Manager"}}::vertex
   (6 rows)
   ```
   While performing this hybrid query using an SQL Table and AGE graph
   ```
   demo=# SELECT * FROM Persons AS p
   demo-# WHERE p.city in (SELECT city FROM cypher('test', $$
   demo$# MATCH (c: Person {city: 'Lagos'})
   demo$# RETURN c.city
   demo$# $$) AS (city VARCHAR));
    id | name | city | hired_year
   ----+------+------+------------
   (0 rows)
   ```
   It returns an empty table.
   
   **Expected Behavior:**
   The hybrid query should return the rows from the `Persons` table that have 
matching city values with the city values returned by the Cypher query. The 
result should not be an empty table.
   
   **Actual Behavior:**
   The hybrid query does not return any results. The table is empty, despite 
the existence of matching city values in both the SQL table and the AGE graph.
   
   **Additional Information:**
   
   PostgreSQL version: 11.17
   AGE extension version: 1.3.0
   Environment: Command Line


-- 
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]

Reply via email to