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

    https://github.com/apache/incubator-madlib/pull/152#discussion_r129096107
  
    --- Diff: src/ports/postgres/modules/graph/test/measures.sql_in ---
    @@ -0,0 +1,150 @@
    +/* ----------------------------------------------------------------------- 
*//**
    + *
    + * 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.
    + *
    + */
    +/* ----------------------------------------------------------------------- 
*/
    +
    +-- Create vertex and edge tables to represent the graph:
    +DROP TABLE IF EXISTS vertex, edge;
    +CREATE TABLE vertex(
    +        id INTEGER,
    +        name TEXT
    +        );
    +CREATE TABLE edge(
    +        src_id INTEGER,
    +        dest_id INTEGER,
    +        edge_weight FLOAT8
    +        );
    +INSERT INTO vertex VALUES
    +(0, 'A'),
    +(1, 'B'),
    +(2, 'C'),
    +(3, 'D'),
    +(4, 'E'),
    +(5, 'F'),
    +(6, 'G'),
    +(7, 'H');
    +INSERT INTO edge VALUES
    +(0, 1, 1.0),
    +(0, 2, 1.0),
    +(0, 4, 10.0),
    +(1, 2, 2.0),
    +(1, 3, 10.0),
    +(2, 3, 1.0),
    +(2, 5, 1.0),
    +(2, 6, 3.0),
    +(3, 0, 1.0),
    +(4, 0, -2.0),
    +(5, 6, 1.0),
    +(6, 7, 1.0);
    +
    +-- Calculate the all-pair shortest paths:
    +DROP TABLE IF EXISTS out_apsp, out_apsp_summary;
    +SELECT graph_apsp('vertex',      -- Vertex table
    +                  'id',          -- Vertix id column (NULL means use 
default naming)
    +                  'edge',        -- Edge table
    +                  'src=src_id, dest=dest_id, weight=edge_weight',
    +                                 -- Edge arguments (NULL means use default 
naming)
    +                  'out_apsp');   -- Output table of shortest paths
    +
    +-- Compute the closeness measure for all nodes:
    +DROP TABLE IF EXISTS out_closeness;
    +SELECT graph_closeness('out_apsp', 'out_closeness');
    +SELECT * FROM out_closeness;
    +
    +SELECT assert(relative_error(inverse_sum_dist, 0.04347) < 1e-2 and
    +              relative_error(inverse_avg_dist, 0.3043) < 1e-2 and
    +              relative_error(sum_inverse_dist, 3.6833) < 1e-2 and
    +              k_degree = 7,
    +              'Incorrect value for closeness')
    +FROM out_closeness
    +WHERE src_id = 0;
    +
    +-- Compute the diameter measure for graph
    +DROP TABLE IF EXISTS out_diameter;
    +SELECT graph_diameter('out_apsp', 'out_diameter');
    --- End diff --
    
    Fails on PG9.4:
    ```
    SELECT graph_diameter('out_apsp', 'out_diameter');
    psql:/tmp/madlib.pw7L2w/graph/test/measures.sql_in.tmp:87: ERROR:  
spiexceptions.UndefinedObject: could not find array type for data type integer[]
    CONTEXT:  Traceback (most recent call last):
      PL/Python function "graph_diameter", line 23, in <module>
        return measures.graph_diameter(**globals())
      PL/Python function "graph_diameter", line 310, in graph_apsp_measures
      PL/Python function "graph_diameter", line 273, in diameter
    PL/Python function "graph_diameter"
    ```


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