Github user njayaram2 commented on a diff in the pull request:

    https://github.com/apache/incubator-madlib/pull/141#discussion_r125086122
  
    --- Diff: src/ports/postgres/modules/graph/bfs.sql_in ---
    @@ -0,0 +1,435 @@
    +/* ----------------------------------------------------------------------- 
*//**
    + *
    + * 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 bfs.sql_in
    + *
    + * @brief SQL functions for graph analytics
    + * @date Nov 2016
    + *
    + * @sa Provides Breadth First Search graph algorithm.
    + *
    + *//* 
----------------------------------------------------------------------- */
    +m4_include(`SQLCommon.m4')
    +/**
    +@addtogroup grp_bfs
    +
    +<div class="toc"><b>Contents</b>
    +<ul>
    +<li><a href="#bfs">Breadth-first Search</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 Finds the nodes reachable from a given source vertex using a 
breadth-first approach.
    +
    +Given a graph and a source vertex, the Breadth-first Search (BFS) algorithm
    +finds all nodes reachable from the source vertex by searching / traversing 
the graph 
    +in a breadth-first manner.
    +
    +@anchor bfs
    +@par BFS
    +<pre class="syntax">
    +graph_bfs( vertex_table,
    +           vertex_id,
    +           edge_table,
    +           edge_args,
    +           source_vertex,
    +           out_table,
    +           max_distance,
    +           directed,
    +           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, destination vertex and edge weight.
    +Column naming convention is described below in the 'edge_args' 
parameter.</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'.
    +  (Not to be confused with the source_vertex argument passed to the BFS 
function)
    +  - dest (INTEGER): Name of the column containing the destination vertex 
ids in 
    +  the edge table. Default column name is 'dest'.
    +  
    +<dt>source_vertex</dt>
    +<dd>INTEGER. The source vertex id for the algorithm to start. This vertex 
id must
    +exist in the 'vertex_id' column of 'vertex_table'.</dd>
    +
    +<dt>out_table</dt>
    +<dd>TEXT. Name of the table to store the result of BFS.
    +It contains a row for every vertex that is reachable from the 
source_vertex.
    +In the presence of grouping columns, only those edges are used for which 
there are no NULL values 
    +in any grouping column.
    +The output table will have the following columns (in addition to the 
grouping columns):
    +  - vertex_id : The id for any node reachable from source_vertex. 
    +                Will use the input parameter 'vertex_id' for column naming.
    +  - dist      : The number of edges (or hops) from the source_vertex to 
where this vertex is located. 
    +  - parent    : The parent of this vertex in BFS traversal of the graph 
from source_vertex. 
    +                Will use 'parent' for column naming. For the 
    +                case where vertex_id = source_vertex, the value for parent 
is NULL.
    +
    +A summary table named <out_table>_summary is also created. This is an 
internal table that keeps a record of the input parameters.
    +</dd>
    +
    +<dt>max_distance</dt>
    +<dd>INT, default = NULL. Maximum distance (number of edges) from 
source_vertex to search through in the graph.</dd>
    +
    +<dt>directed</dt>
    +<dd>BOOLEAN, default = FALSE. If TRUE the graph will be treated as 
directed, else it will be treated as an undirected graph.</dd>
    +
    +<dt>grouping_cols</dt>
    +<dd>TEXT, default = NULL. List of columns used to group the input into 
discrete subgraphs. These columns must exist in the edge table. When this value 
is NULL, no grouping is used and a single BFS result is generated. </dd>
    +</dl>
    --- End diff --
    
    Does this implementation support expressions for grouping_cols? If not, we 
should make a note here stating we don't support expressions for grouping 
columns (please check pagerank/sssp docs for reference).


---
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.
---

Reply via email to