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/10/26 21:36:34 UTC
[PR] Modify COUNT() to output agtype [age]
dehowef opened a new pull request, #1311:
URL: https://github.com/apache/age/pull/1311
Modified the make_function_expr logic to wrap the PG COUNT() function with a cast to agtype. This enables COUNT() to be used as a subquery in CASE.
Also added logic for casting for future PG function additions.
This modification passes all regression tests. Also added regression tests for COUNT in CASE statements.
--
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] Modify COUNT() to output agtype [age]
Posted by "dehowef (via GitHub)" <gi...@apache.org>.
dehowef commented on PR #1311:
URL: https://github.com/apache/age/pull/1311#issuecomment-1783615716
> One minor issue with else missing {}
>
> Also, would it be possible to combine `make_function_expr`, `make_star_function_expr`, and `make_distinct_function_expr `into one? with flags passed? There appears to be a lot of duplicate code between them.
Added the parentheses
--
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] Modify COUNT() to output agtype [age]
Posted by "jrgemignani (via GitHub)" <gi...@apache.org>.
jrgemignani merged PR #1311:
URL: https://github.com/apache/age/pull/1311
--
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] Modify COUNT() to output agtype [age]
Posted by "jrgemignani (via GitHub)" <gi...@apache.org>.
jrgemignani commented on code in PR #1311:
URL: https://github.com/apache/age/pull/1311#discussion_r1374975397
##########
src/backend/parser/cypher_gram.y:
##########
@@ -2274,25 +2274,180 @@ static Node *make_function_expr(List *func_name, List *exprs, int location)
* could be many.
*/
if (pg_strcasecmp(name, "count") == 0)
+ {
+ funcname = SystemFuncName("count");
+
+ /* build the function call */
+ fnode = makeFuncCall(funcname, exprs, COERCE_SQL_SYNTAX, location);
+
+ /* build the cast to wrap the function call to return agtype. */
+ fnode = wrap_pg_funccall_to_agtype((Node *)fnode, "integer", location);
+
+ return (Node *)fnode;
+ }
+ else
+ {
+ /*
+ * We don't qualify AGE functions here. This is done in the
+ * transform layer and allows us to know which functions are ours.
+ */
+ funcname = func_name;
+
+ /* build the function call */
+ fnode = makeFuncCall(funcname, exprs, COERCE_SQL_SYNTAX, location);
+ }
+ }
+ /* all other functions are passed as is */
+ else
Review Comment:
Missing {}
--
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