ontologiae opened a new issue #172:
URL: https://github.com/apache/incubator-age/issues/172


   **Describe the bug**
   Syntax error using MERGE command.
   This request is valid in Neo4j context.
   
   **How are you accessing AGE (Command line, driver, etc.)?**
   - psql command line
   
   **What data setup do we need to do?**
   Nothing
   
   **What is the necessary configuration info needed?**
   - Just PorgreSQL 11 and AGE (docker image)
   
   **What is the command that caused the error?**
   ```pgsql
   SELECT * from cypher('my_graph_test', $$
     match (fr:FieldRef) with  split(fr.fieldname,"#") as l, fr with head(l) as 
className, head(tail(l)) as fieldname, fr  match (c:Class)-[:field]-(f:Field) 
where f.fieldname = fieldname and c.className = className merge (fr)-[:REF]->(f)
   $$) as (a agtype);
   ```
   ```
   ERROR:  syntax error at or near "merge"
   LINE 2: ...fieldname = fieldname and c.className = className merge (fr)
   ```
   
   **Expected behavior**
   We should have this (semantic not syntax) error : 
   ```
   ERROR:  label FieldRef does not exists
   LINE 2:   match (fr:FieldRef) with  split(fr.fieldname,"#") as l, fr...
   ```
   
   **Environment (please complete the following information):**
   - Version: 0.6.0 tag
   
   **Additional context**
   Just started the docker instance and did
   
   ```
   
   postgres=# CREATE EXTENSION age;
   CREATE EXTENSION
   postgres=# LOAD 'age';
   LOAD
   postgres=# SET search_path = ag_catalog, "$user", public;
   SET
   postgres=# SELECT create_graph('my_graph_test');
   NOTICE:  graph "my_graph_test" has been created
    create_graph 
   --------------
    
   (1 row)
   
   
   postgres=# SELECT * from cypher('my_graph_test', $$
     CREATE (a:Part {part_num: '123'}),
            (b:Part {part_num: '345'}),
            (c:Part {part_num: '456'}),
            (d:Part {part_num: '789'})
   $$) as (a agtype);
    a 
   ---
   (0 rows)
   
   postgres=# SELECT * from cypher('my_graph_test', $$
     Match (a) return a                
   $$) as (a agtype);
                                             a                                  
        
   
-------------------------------------------------------------------------------------
    {"id": 844424930131969, "label": "Part", "properties": {"part_num": 
"123"}}::vertex
    {"id": 844424930131970, "label": "Part", "properties": {"part_num": 
"345"}}::vertex
    {"id": 844424930131971, "label": "Part", "properties": {"part_num": 
"456"}}::vertex
    {"id": 844424930131972, "label": "Part", "properties": {"part_num": 
"789"}}::vertex
   (4 rows)
   
   postgres=# SELECT * from cypher('my_graph_test', $$
     UNWIND [1, 2, 3, null] AS x
   RETURN x, 'val' AS y
   $$) as (a agtype);
   ERROR:  syntax error at or near "UNWIND"
   LINE 2:   UNWIND [1, 2, 3, null] AS x
   
   
   ```
   


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