Github user iyerr3 commented on a diff in the pull request:
https://github.com/apache/incubator-madlib/pull/119#discussion_r112534924
--- Diff: src/ports/postgres/modules/graph/sssp.py_in ---
@@ -314,9 +314,13 @@ def graph_sssp(schema_madlib, vertex_table, vertex_id, edge_table,
{checkg_oo})
UNION
SELECT {grp_comma} id, {weight}, parent FROM {oldupdate};
- DROP TABLE {out_table};
- ALTER TABLE {temp_table} RENAME TO {out_table};
- CREATE TABLE {temp_table} AS (
+ """
+ plpy.execute(sql.format(**locals()))
+ sql = "DROP TABLE {out_table}"
+ plpy.execute(sql.format(**locals()))
--- End diff --
The above two lines can easily be merged to single statement (same for the ones below).
Also avoid using locals() if there are only few variables in the format list. Explicitly
adding the variables makes it easy to see their usage.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
|