MuhammadTahaNaveed commented on code in PR #1022:
URL: https://github.com/apache/age/pull/1022#discussion_r1260559330
##########
src/backend/parser/cypher_clause.c:
##########
@@ -2786,7 +2811,7 @@ static void setNamespaceLateralState(List *namespace,
bool lateral_only,
* Code borrowed and inspired by PG's transformFromClauseItem. Static function
* to add in the VLE function as a FROM clause entry.
*/
-static RangeTblEntry *append_VLE_Func_to_FromClause(cypher_parsestate *cpstate,
+static ParseNamespaceItem *append_VLE_Func_to_FromClause(cypher_parsestate
*cpstate,
Review Comment:
[formatting] exceeds 80 columns
##########
src/backend/parser/cypher_clause.c:
##########
@@ -3658,11 +3684,12 @@ static transform_entity
*transform_VLE_edge_entity(cypher_parsestate *cpstate,
/*
* Add the RangeFunction to the FROM clause
*/
- rte = append_VLE_Func_to_FromClause(cpstate, (Node*)rf);
- Assert(rte != NULL);
+ pnsi = append_VLE_Func_to_FromClause(cpstate, (Node*)rf);
+ Assert(pnsi != NULL);
/* Get the var node for the VLE functions column name. */
- var = scanRTEForColumn(pstate, rte, "edges", -1, 0, NULL);
+ Assert(pnsi != NULL);
Review Comment:
duplicate assertion
##########
src/backend/parser/cypher_clause.c:
##########
@@ -4874,18 +4908,20 @@ static Node *make_edge_expr(cypher_parsestate *cpstate,
RangeTblEntry *rte)
InvalidOid, COERCE_EXPLICIT_CALL);
label_name_func_expr->location = -1;
- props = scanRTEForColumn(pstate, rte, AG_EDGE_COLNAME_PROPERTIES, -1, 0,
- NULL);
+ props = scanNSItemForColumn(pstate, pnsi, 0, AG_EDGE_COLNAME_PROPERTIES,
-1);
- args = list_make5(id, start_id, end_id, label_name_func_expr, props);
+ args = list_make4(id, start_id, end_id, label_name_func_expr);
+ args = lappend(args, props);
func_expr = makeFuncExpr(func_oid, AGTYPEOID, args, InvalidOid, InvalidOid,
COERCE_EXPLICIT_CALL);
func_expr->location = -1;
return (Node *)func_expr;
}
-static Node *make_vertex_expr(cypher_parsestate *cpstate, RangeTblEntry *rte)
+static Node *make_vertex_expr(cypher_parsestate *cpstate,
+ ParseNamespaceItem *pnsi,
+ char *label)
Review Comment:
Why is label parameter added here. I can't see its use in the function. Is
there any specific reason I am overseeing ?
##########
src/backend/parser/cypher_clause.c:
##########
@@ -6719,10 +6762,12 @@ static void handle_prev_clause(cypher_parsestate
*cpstate, Query *query,
cypher_clause *clause, bool first_rte)
{
ParseState *pstate = (ParseState *) cpstate;
- RangeTblEntry *rte;
+
Review Comment:
[formatting] extra line ?
##########
src/backend/parser/cypher_clause.c:
##########
@@ -5093,7 +5131,7 @@ transform_cypher_create_path(cypher_parsestate *cpstate,
List **target_list,
else
{
ereport(ERROR,
- (errmsg_internal("unrecognized node in create pattern")));
+ (errmsg_internal("unrecognized node in create pattern")));
Review Comment:
[formatting] extra whitespace ?
##########
src/backend/parser/cypher_clause.c:
##########
@@ -4837,7 +4871,9 @@ static Expr *transform_cypher_node(cypher_parsestate
*cpstate,
return expr;
}
-static Node *make_edge_expr(cypher_parsestate *cpstate, RangeTblEntry *rte)
+static Node *make_edge_expr(cypher_parsestate *cpstate,
+ ParseNamespaceItem *pnsi,
+ char *label)
Review Comment:
Why is label parameter added here. I can't see its use in the function. Is
there any specific reason I am overseeing ?
--
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]