rafsun42 commented on code in PR #1064:
URL: https://github.com/apache/age/pull/1064#discussion_r1269770466
##########
src/backend/utils/adt/agtype.c:
##########
@@ -6250,7 +6406,45 @@ Datum age_reverse(PG_FUNCTION_ARGS)
/* get the agtype argument */
agt_arg = DATUM_GET_AGTYPE_P(arg);
- if (!AGT_ROOT_IS_SCALAR(agt_arg))
+ /* if it is a binary container, check for a VLE vpc */
+ if (AGT_ROOT_IS_BINARY(agt_arg))
Review Comment:
Can this expression be generalized into a function since it repeats in many
places?
```c
/* if it is a binary container, check for a VLE vpc */
if (AGT_ROOT_IS_BINARY(agt_arg))
{
if (AGT_ROOT_BINARY_FLAGS(agt_arg) == AGT_FBINARY_TYPE_VLE_PATH)
{
/* retrieve an array of edges from the vpc */
agt_arg = agtype_value_to_agtype(
agtv_materialize_vle_edges(agt_arg));
}
else
{
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("binary container must be a VLE vpc")));
}
}
```
--
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]