Github user njayaram2 commented on a diff in the pull request: https://github.com/apache/incubator-madlib/pull/144#discussion_r124682389 --- Diff: src/ports/postgres/modules/graph/wcc.sql_in --- @@ -0,0 +1,261 @@ +/* ----------------------------------------------------------------------- *//** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + * + * @file graph.sql_in + * + * @brief SQL functions for graph analytics + * @date June 2017 + * + * @sa Provides various graph algorithms. + * + *//* ----------------------------------------------------------------------- */ +m4_include(`SQLCommon.m4') + + +/** +@addtogroup grp_wcc + +<div class="toc"><b>Contents</b> +<ul> +<li><a href="#wcc">Weakly Connected Components</a></li> +<li><a href="#notes">Notes</a></li> +<li><a href="#examples">Examples</a></li> +<li><a href="#literature">Literature</a></li> +</ul> +</div> + +@brief Find all weakly connected components of a graph. + +Given a directed graph, a weakly connected component is a subgraph of the original +graph where all vertices are connected to each other by some path, ignoring the +direction of edges. In case of an undirected graph, a weakly connected component is +also a strongly connected component. + +@anchor wcc +@par Weakly Connected Components +<pre class="syntax"> +weakly_connected_components( vertex_table, + vertex_id, + edge_table, + edge_args, + out_table, + grouping_cols + ) +</pre> + +\b Arguments +<dl class="arglist"> +<dt>vertex_table</dt> +<dd>TEXT. Name of the table containing the vertex data for the graph. Must contain the +column specified in the 'vertex_id' parameter below.</dd> + +<dt>vertex_id</dt> +<dd>TEXT, default = 'id'. Name of the column in 'vertex_table' containing +vertex ids. The vertex ids are of type INTEGER with no duplicates. +They do not need to be contiguous.</dd> + +<dt>edge_table</dt> +<dd>TEXT. Name of the table containing the edge data. The edge table must +contain columns for source vertex and destination vertex.</dd> + +<dt>edge_args</dt> +<dd>TEXT. A comma-delimited string containing multiple named arguments of +the form "name=value". The following parameters are supported for +this string argument: + - src (INTEGER): Name of the column containing the source vertex ids in the edge table. + Default column name is 'src'. + - dest (INTEGER): Name of the column containing the destination vertex ids in the edge table. + Default column name is 'dest'.</dd> + +<dt>out_table</dt> +<dd>TEXT. Name of the table to store the component ID associated with each vertex. +It will contain a row for every vertex from 'vertex_table' with +the following columns: + - vertex_id : The id of a vertex. Will use the input parameter 'vertex_id' for column naming. + - component_id : The vertex's component. + - grouping_cols : Grouping column (if any) values associated with the vertex_id.</dd> + +<dt>grouping_cols (optional)</dt> --- End diff -- Will do.
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. ---