[ 
https://issues.apache.org/jira/browse/MADLIB-1287?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16717154#comment-16717154
 ] 

ASF GitHub Bot commented on MADLIB-1287:
----------------------------------------

GitHub user iyerr3 opened a pull request:

    https://github.com/apache/madlib/pull/340

    Validation: Support other 'relkind' for input tables

    JIRA: MADLIB-1287
    
    Within `validate_args.py_in:table_exists()` we checked if a table existed 
within
    `pg_class` but limited the input table to specific `relkind`s. This limited
    scope is unnecessary and precluded MADlib functions from accepting partition
    tables.
    
    This commit removes the `relkind` check, effectively adding 'partition',
    'index' and 'sequence' tables as valid input tables.
    
    Closes #340

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/iyerr3/madlib bugfix/support_partition_tables

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/madlib/pull/340.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #340
    
----
commit 88d53fdf22a5e79120580c171279f077b36b267d
Author: Rahul Iyer <riyer@...>
Date:   2018-12-11T13:24:17Z

    Validation: Support other 'relkind' for input tables
    
    JIRA: MADLIB-1287
    
    Within `validate_args.py_in:table_exists()` we checked if a table existed 
within
    `pg_class` but limited the input table to specific `relkind`s. This limited
    scope is unnecessary and precluded MADlib functions from accepting partition
    tables.
    
    This commit removes the `relkind` check, effectively adding 'partition',
    'index' and 'sequence' tables as valid input tables.
    
    Closes #340

----


> MADLib 1.15 does not recognize Postgres 10 declarative partitioned table
> ------------------------------------------------------------------------
>
>                 Key: MADLIB-1287
>                 URL: https://issues.apache.org/jira/browse/MADLIB-1287
>             Project: Apache MADlib
>          Issue Type: Bug
>            Reporter: cchsu
>            Assignee: Rahul Iyer
>            Priority: Minor
>             Fix For: v1.16
>
>
> Hi,
> Recently I test MADLib on PostgreSQL 10.6, installing MADLib with RPM.
> I followed [https://madlib.apache.org/docs/latest/group__grp__linreg.html] 
> and import the sample data in this page to run the function.
> And I find that MADLib can not recognize declarative partitioned tables.
> {code:java}
> postgres=# \d+ houses_1gb 
>                                      Table "public.houses_1gb"
>  Column  |       Type       | Collation | Nullable | Default | Storage | 
> Stats target | Description 
> ---------+------------------+-----------+----------+---------+---------+--------------+-------------
>  id      | integer          |           |          |         | plain   |      
>         | 
>  tax     | integer          |           |          |         | plain   |      
>         | 
>  bedroom | integer          |           |          |         | plain   |      
>         | 
>  bath    | double precision |           |          |         | plain   |      
>         | 
>  price   | integer          |           |          |         | plain   |      
>         | 
>  size    | integer          |           |          |         | plain   |      
>         | 
>  lot     | integer          |           |          |         | plain   |      
>         | 
> Partition key: LIST (mod(id, 4))
> Partitions: houses_0 FOR VALUES IN (0),
>             houses_1 FOR VALUES IN (1),
>             houses_2 FOR VALUES IN (2),
>             houses_3 FOR VALUES IN (3)
> postgres=# 
> postgres=# SELECT madlib.linregr_train(
>     'houses_1gb', 'houses_linregr', 'price', 'array[1, tax, bath, size]');
> ERROR:  plpy.Error: Linregr error: Data table does not exist!
> CONTEXT:  Traceback (most recent call last):
>   PL/Python function "linregr_train", line 19, in <module>
>     return linear.linregr_train(**globals())
>   PL/Python function "linregr_train", line 22, in linregr_train
>   PL/Python function "linregr_train", line 160, in _validate_args
>   PL/Python function "linregr_train", line 77, in _assert
> PL/Python function "linregr_train"
> postgres=# 
> {code}
> I used the following modified table DDL to create the partitioned table.
> {code:java}
> CREATE TABLE houses_1gb (
>    id INT, 
>    tax INT, 
>    bedroom INT, 
>    bath FLOAT, 
>    price INT,
>    size INT, 
>    lot INT)
> PARTITIONED BY list(mod(id,4));
> CREATE TABLE houses_0
>     PARTITION OF houses_1gb 
> FOR VALUES IN (0);
> CREATE TABLE houses_1
>     PARTITION OF houses_1gb 
> FOR VALUES IN (1);
> CREATE TABLE houses_2
>     PARTITION OF houses_1gb 
> FOR VALUES IN (2);
> CREATE TABLE houses_3
>     PARTITION OF houses_1gb 
> FOR VALUES IN (3);
> {code}
> Maybe MADLib team can consider to support declarative partitioned tables for 
> Postgres 10+.
>  
>  
> Best Regards.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to