You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@age.apache.org by "rafsun42 (via GitHub)" <gi...@apache.org> on 2023/10/05 16:03:12 UTC

Re: [PR] Implemented age_tail function [age]

rafsun42 commented on code in PR #1013:
URL: https://github.com/apache/age/pull/1013#discussion_r1347661465


##########
regress/expected/expr.out:
##########
@@ -6479,6 +6479,46 @@ SELECT * from cypher('list', $$RETURN range(0, null, -3)$$) as (range agtype);
 ERROR:  range(): neither start or end can be NULL
 SELECT * from cypher('list', $$RETURN range(0, -10.0, -3.0)$$) as (range agtype);
 ERROR:  range() unsupported argument type
+-- tail()
+-- should return the last elements of the list
+SELECT * FROM cypher('list', $$ RETURN tail([1,2,3,4,5]) $$) AS (tail agtype);
+     tail     
+--------------
+ [2, 3, 4, 5]
+(1 row)
+
+SELECT * FROM cypher('list', $$ RETURN tail(["a","b","c","d","e"]) $$) AS (tail agtype);
+         tail         
+----------------------
+ ["b", "c", "d", "e"]
+(1 row)
+
+-- should return null
+SELECT * FROM cypher('list', $$ RETURN tail([1]) $$) AS (tail agtype);
+ tail 
+------
+ 
+(1 row)
+
+SELECT * FROM cypher('list', $$ RETURN tail([]) $$) AS (tail agtype);
+ tail 
+------
+ 
+(1 row)
+
+-- should throw errors
+SELECT * FROM cypher('for_tail', $$ RETURN tail(123) $$) AS (tail agtype);
+ERROR:  graph "for_tail" does not exist

Review Comment:
   Is it the error we are expecting?



-- 
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: commits-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org