You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@age.apache.org by "dehowef (via GitHub)" <gi...@apache.org> on 2023/11/02 00:15:13 UTC

[PR] Implement EXISTS subquery for CASE [age]

dehowef opened a new pull request, #1345:
URL: https://github.com/apache/age/pull/1345

   Modified logic of EXISTS to wrap itself in a agtype cast. This allows EXISTS to work with in CASE statements, among other implementations that may require an agtype.
   
   Also renamed the wrapper function to be more generic to denote its usage in other implementations if need be.
   
   Added regression tests for EXISTS.


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


Re: [PR] Implement EXISTS subquery for CASE [age]

Posted by "jrgemignani (via GitHub)" <gi...@apache.org>.
jrgemignani commented on code in PR #1345:
URL: https://github.com/apache/age/pull/1345#discussion_r1381780383


##########
src/backend/parser/cypher_gram.y:
##########
@@ -1742,12 +1742,17 @@ expr_func_subexpr:
             n->operName = NIL;
             n->subselect = (Node *) sub;
             n->location = @1;
-            $$ = (Node *) n;
+            $$ = (Node *)node_to_agtype((Node *)n, "boolean", @1);
         }
     | EXISTS '(' property_value ')'
         {
-            $$ = make_function_expr(list_make1(makeString("exists")),
-                                    list_make1($3), @2);
+            FuncCall *n;
+            n = makeFuncCall(list_make1(makeString("exists")),
+                                    list_make1($3), COERCE_SQL_SYNTAX, @2);
+
+            $$ = (Node *)node_to_agtype((Node *)n, "boolean", @2);
+

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

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


Re: [PR] Implement EXISTS subquery for CASE [age]

Posted by "dehowef (via GitHub)" <gi...@apache.org>.
dehowef commented on code in PR #1345:
URL: https://github.com/apache/age/pull/1345#discussion_r1382230343


##########
src/backend/parser/cypher_gram.y:
##########
@@ -1742,12 +1742,17 @@ expr_func_subexpr:
             n->operName = NIL;
             n->subselect = (Node *) sub;
             n->location = @1;
-            $$ = (Node *) n;
+            $$ = (Node *)node_to_agtype((Node *)n, "boolean", @1);
         }
     | EXISTS '(' property_value ')'
         {
-            $$ = make_function_expr(list_make1(makeString("exists")),
-                                    list_make1($3), @2);
+            FuncCall *n;
+            n = makeFuncCall(list_make1(makeString("exists")),
+                                    list_make1($3), COERCE_SQL_SYNTAX, @2);
+
+            $$ = (Node *)node_to_agtype((Node *)n, "boolean", @2);
+

Review Comment:
   addressed



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


Re: [PR] Implement EXISTS subquery for CASE [age]

Posted by "jrgemignani (via GitHub)" <gi...@apache.org>.
jrgemignani merged PR #1345:
URL: https://github.com/apache/age/pull/1345


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