[ 
https://issues.apache.org/jira/browse/PHOENIX-2151?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Rajeshbabu Chintaguntla updated PHOENIX-2151:
---------------------------------------------
    Attachment: PHOENIX-2151.patch

Here is the patch fixes the issue.
The problem coming here when ignoring the same expressions if already exists. 
For scalar functions equal check just check children only. In this case the 
children is same for the both the udfs but implementation might vary. So 
implementing equals for UDFExpression solves the problem.
{code}
    public Expression addIfAbsent(Expression expression) {
        Expression existingExpression = expressionMap.get(expression);
        if (existingExpression == null) {
            expressionMap.put(expression, expression);
            return expression;
        }
        return existingExpression;
    }
{code}
[~anchal] [~nickman] Can you please try the patch and check things are fine 
from your side.

> Two different UDFs called on same column return values from first UDF only
> --------------------------------------------------------------------------
>
>                 Key: PHOENIX-2151
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2151
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 4.4.0
>         Environment: Phoenix 4.4.0
> HBase 0.98_13
> Java 7
> Ubuntu 14.04.1 X64
>            Reporter: Nicholas Whitehead
>            Assignee: Rajeshbabu Chintaguntla
>            Priority: Critical
>         Attachments: PHOENIX-2151.patch
>
>
> I have defined two different UDFs, say FOO(varchar) and BAR(varchar).
> If I execute a query such as:
> SELECT PK, FOO(NAME), BAR(NAME) FROM USERS, I get:
> ===================================================
>        PK              |              FOO                  |                
> BAR
> ===================================================
> 37546               |       <Fooed Value>         |      <Fooed Value>
> If I reverse the order, I only get the Barred value (i.e. it ignores the 2nd 
> and subsequent UDF operators)
> SELECT PK, BAR(NAME), FOO(NAME) FROM USERS, I get:
> ===================================================
>        PK              |              BAR                  |                
> FOO
> ===================================================
> 37546               |       <Bared Value>         |      <Bared Value>
> Reproduced in plain command JDBC and Squirrel SQL.
> Packaged reproduction pending.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to