madlib-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mktal <...@git.apache.org>
Subject [GitHub] incubator-madlib pull request #56: Path: Add support for overlapping pattern...
Date Mon, 25 Jul 2016 20:45:39 GMT
Github user mktal commented on a diff in the pull request:

    https://github.com/apache/incubator-madlib/pull/56#discussion_r72141186
  
    --- Diff: src/ports/postgres/modules/utilities/path.py_in ---
    @@ -155,15 +158,26 @@ def path(schema_madlib, source_table, output_table, partition_expr,
             p_col_orig_name_str = ','.join(
                 [i + " AS " + j for i, j in zip(split_p_cols, quoted_split_p_cols)])
             if agg_func:
    -            plpy.execute("""
    -                CREATE TABLE {output_table} AS
    -                   SELECT
    -                        {p_col_orig_name_str},
    -                        {match_id_name},
    -                        {agg_func}
    -                   FROM {matched_rows}
    -                   GROUP BY {as_partition_expr}, {match_id_name}
    -                """.format(**locals()))
    +            if partition_expr == '1 = 1':
    +                # no partition
    +                plpy.execute("""
    +                    CREATE TABLE {output_table} AS
    +                       SELECT
    +                            {match_id_name},
    +                            {agg_func}
    +                       FROM {matched_rows}
    +                       GROUP BY {match_id_name}
    +                    """.format(**locals()))
    +            else:
    +                plpy.execute("""
    +                    CREATE TABLE {output_table} AS
    +                       SELECT
    +                            {p_col_orig_name_str},
    +                            {match_id_name},
    +                            {agg_func}
    +                       FROM {matched_rows}
    +                       GROUP BY {partition_expr}, {match_id_name}
    +                    """.format(**locals()))
    --- End diff --
    
    Good catch. I removed it in the latest commit that also included updates on docs.


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

Mime
View raw message