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

    https://github.com/apache/madlib/pull/178#discussion_r136632178
  
    --- Diff: src/ports/postgres/modules/graph/test/hits.sql_in ---
    @@ -0,0 +1,81 @@
    +/* ----------------------------------------------------------------------- 
*//**
    + *
    + * 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.
    + *
    + *//* 
----------------------------------------------------------------------- */
    +
    +DROP TABLE IF EXISTS vertex, "EDGE";
    +CREATE TABLE vertex(
    +        id INTEGER
    +        );
    +CREATE TABLE "EDGE"(
    +        src INTEGER,
    +        dest INTEGER,
    +        user_id INTEGER
    +        );
    +INSERT INTO vertex VALUES
    +(0),
    +(1),
    +(2),
    +(3),
    +(4),
    +(5),
    +(6);
    +INSERT INTO "EDGE" VALUES
    +(0, 1, 1),
    +(0, 2, 1),
    +(0, 4, 1),
    +(1, 2, 1),
    +(1, 3, 1),
    +(2, 3, 1),
    +(2, 5, 1),
    +(2, 6, 1),
    +(3, 0, 1),
    +(4, 0, 1),
    +(5, 6, 1),
    +(6, 3, 1),
    +(0, 1, 2),
    +(0, 2, 2),
    +(0, 4, 2),
    +(1, 2, 2),
    +(1, 3, 2),
    +(2, 3, 2),
    +(3, 0, 2),
    +(4, 0, 2),
    +(5, 6, 2),
    +(6, 3, 2);
    +
    +DROP TABLE IF EXISTS hits_out, hits_out_summary;
    +SELECT hits(
    +             'vertex',        -- Vertex table
    +             'id',            -- Vertex id column
    +             '"EDGE"',          -- "EDGE" table
    +             'src=src, dest=dest', -- "EDGE" args
    +             'hits_out',       -- Output table of HITS
    +             3                  -- Max number of iteration
    +             );
    +
    +-- Test Case: when max_iter=3, the authority score for node 0 should be 
close to 0.502727
    +SELECT assert(relative_error(authority, 0.502727) < 0.000001,
    +        'HITS: calculation for authority score is wrong'
    +    ) FROM hits_out WHERE id=0;
    +
    +-- Test Case: when max_iter=3, the authority score for node 0 should be 
close to 0.496400
    +SELECT assert(relative_error(hub, 0.496400) < 0.000001,
    +        'HITS: calculation for hub score is wrong'
    +    ) FROM hits_out WHERE id=0;
    --- End diff --
    
    Please end with a new line.


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