[
https://issues.apache.org/jira/browse/MADLIB-1003?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15367008#comment-15367008
]
ASF GitHub Bot commented on MADLIB-1003:
----------------------------------------
GitHub user njayaram2 opened a pull request:
https://github.com/apache/incubator-madlib/pull/55
Path: Handling multiple expressions in partition_expr
JIRA: MADLIB-1003
The various expressions in the partition_expr parameter are now
quoted and renamed. These expressions were not renamed earlier,
which led to an error when there were multiple expressions in the
parameter. Renaming them using ' AS ' fixes this issue.
This commit also includes an update to the install check, which
now includes multiple expressions in partition_expr.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/njayaram2/incubator-madlib bugfix/jira_1003
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-madlib/pull/55.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 #55
----
commit ee8a0a842a41e6d2f2f3db9ad0e77bb1ab82c773
Author: Nandish Jayaram <[email protected]>
Date: 2016-07-08T00:19:00Z
Path: Handling multiple expressions in partition_expr
JIRA: MADLIB-1003
The various expressions in the partition_expr parameter are now
quoted and renamed. These expressions were not renamed earlier,
which led to an error when there were multiple expressions in the
parameter. Renaming them using ' AS ' fixes this issue.
This commit also includes an update to the install check, which
now includes multiple expressions in partition_expr.
----
> Partition expression in path function fails on multiple conditions
> ------------------------------------------------------------------
>
> Key: MADLIB-1003
> URL: https://issues.apache.org/jira/browse/MADLIB-1003
> Project: Apache MADlib
> Issue Type: Bug
> Components: Module: Utilities
> Reporter: Nandish Jayaram
> Fix For: v1.9.1
>
>
> The path function in utilities is supposed to accept expressions for the
> partition_expr parameter, but there are two aspects of the partition
> expression that are not handled currently:
> 1) If there are more than one condition in the partition expression, path()
> fails to run successfully. For instance, consider the input table present in
> the install check file for path, the following function call results in an
> error:
> {code:sql}
> SELECT madlib.path('"Weblog"',
> '"Path_output"',
> 'user_id, age_group > 1, income_group > 1',
> 'event_timestamp ASC',
> 'I:="Click_event"=0 AND purchase_event=0, Click:="Click_event"=1 AND
> purchase_event=0, Conv:=purchase_event=1',
> 'I(click){1}(CONV){1}',
> 'COUNT(*)',
> TRUE);
> ERROR: spiexceptions.DuplicateColumn: column "?column?" specified more than
> once
> CONTEXT: Traceback (most recent call last):
> PL/Python function "path", line 23, in <module>
> return path.path(**globals())
> PL/Python function "path", line 276, in path
> PL/Python function "path"
> {code}
> 2) We cannot rename a particular condition/column name in the partition
> expression using "AS". For example, we get the following error with the
> function call shown below:
> {code:sql}
> SELECT madlib.path('"Weblog"',
> '"Path_output"',
> 'user_id AS uid,
> 'event_timestamp ASC',
> 'I:="Click_event"=0 AND purchase_event=0, Click:="Click_event"=1 AND
> purchase_event=0, Conv:=purchase_event=1',
> 'I(click){1}(CONV){1}',
> 'COUNT(*)',
> TRUE);
> ERROR: spiexceptions.SyntaxError: syntax error at or near "AS"
> QUERY: �
> CONTEXT: Traceback (most recent call last):
> PL/Python function "path", line 23, in <module>
> return path.path(**globals())
> PL/Python function "path", line 114, in path
> PL/Python function "path"
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)