You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@phoenix.apache.org by Marek Wiewiorka <ma...@gmail.com> on 2016/06/13 17:57:44 UTC

Coalesce function returns nulls?

Hi All - I came across a very strange issue when using COALESCE function.
It appears to me that it returns null values - please consider a following
query:
select length(coalesce(V_RS_DBSNP142,'N/A')) from TABLE1 limit 10;
+------------------------------------------+
| LENGTH(COALESCE("V_RS_DBSNP142", 'N/A')) |
+------------------------------------------+
| null                                     |
| null                                     |
| null                                     |
| null                                     |
| null                                     |
| null                                     |
| null                                     |
| null                                     |
| null                                     |
| null                                     |
+------------------------------------------+
10 rows selected (0.056 seconds)

Am I doing sth wrong or there is a bug in that function?
I'm using Phoenix 4.6.

Many thanks in advance.
Marek

Re: Coalesce function returns nulls?

Posted by James Taylor <ja...@apache.org>.
Thanks for bringing this to our attention, Marek. I took a look and found
an issue with the coalesce function. I filed PHOENIX-2994 with a patch
there. Please let us know if it fixes the issue you're seeing (and if not,
then please get us a unit test).

    James


On Mon, Jun 13, 2016 at 2:02 PM, Michael McAllister <
mmcallister@homeaway.com> wrote:

> Perhaps you could create a test case with table creation, upsert and then
> the select that reproduces and illustrates the problem?
>
>
>
> Michael McAllister
>
> Staff Data Warehouse Engineer | Decision Systems
>
> mmcallister@HomeAway.com | C: 512.423.7447 | skype: michael.mcallister.ha
> <zi...@hotmail.com> | webex: https://h.a/mikewebex
>
> [image: Description: Description: cid:3410354473_30269081]
>
> This electronic communication (including any attachment) is confidential.
> If you are not an intended recipient of this communication, please be
> advised that any disclosure, dissemination, distribution, copying or other
> use of this communication or any attachment is strictly prohibited.  If you
> have received this communication in error, please notify the sender
> immediately by reply e-mail and promptly destroy all electronic and printed
> copies of this communication and any attachment.
>
>
>
> *From:* Marek Wiewiorka [mailto:marek.wiewiorka@gmail.com]
> *Sent:* Monday, June 13, 2016 12:58 PM
> *To:* user@phoenix.apache.org
> *Subject:* Coalesce function returns nulls?
>
>
>
> Hi All - I came across a very strange issue when using COALESCE function.
>
> It appears to me that it returns null values - please consider a following
> query:
>
> select length(coalesce(V_RS_DBSNP142,'N/A')) from TABLE1 limit 10;
> *+------------------------------------------+*
> *| LENGTH(COALESCE("V_RS_DBSNP142", 'N/A')) |*
> *+------------------------------------------+*
> *| *null                                    * |*
> *| *null                                    * |*
> *| *null                                    * |*
> *| *null                                    * |*
> *| *null                                    * |*
> *| *null                                    * |*
> *| *null                                    * |*
> *| *null                                    * |*
> *| *null                                    * |*
> *| *null                                    * |*
> *+------------------------------------------+*
> 10 rows selected (0.056 seconds)
>
> Am I doing sth wrong or there is a bug in that function?
>
> I'm using Phoenix 4.6.
>
>
>
> Many thanks in advance.
>
> Marek
>
>
>

RE: Coalesce function returns nulls?

Posted by Michael McAllister <mm...@homeaway.com>.
Perhaps you could create a test case with table creation, upsert and then the select that reproduces and illustrates the problem?

Michael McAllister
Staff Data Warehouse Engineer | Decision Systems
mmcallister@HomeAway.com<ma...@HomeAway.com> | C: 512.423.7447 | skype: michael.mcallister.ha<ma...@hotmail.com> | webex: https://h.a/mikewebex
[Description: Description: cid:3410354473_30269081]
This electronic communication (including any attachment) is confidential.  If you are not an intended recipient of this communication, please be advised that any disclosure, dissemination, distribution, copying or other use of this communication or any attachment is strictly prohibited.  If you have received this communication in error, please notify the sender immediately by reply e-mail and promptly destroy all electronic and printed copies of this communication and any attachment.

From: Marek Wiewiorka [mailto:marek.wiewiorka@gmail.com]
Sent: Monday, June 13, 2016 12:58 PM
To: user@phoenix.apache.org
Subject: Coalesce function returns nulls?

Hi All - I came across a very strange issue when using COALESCE function.
It appears to me that it returns null values - please consider a following query:
select length(coalesce(V_RS_DBSNP142,'N/A')) from TABLE1 limit 10;
+------------------------------------------+
| LENGTH(COALESCE("V_RS_DBSNP142", 'N/A')) |
+------------------------------------------+
| null                                     |
| null                                     |
| null                                     |
| null                                     |
| null                                     |
| null                                     |
| null                                     |
| null                                     |
| null                                     |
| null                                     |
+------------------------------------------+
10 rows selected (0.056 seconds)
Am I doing sth wrong or there is a bug in that function?
I'm using Phoenix 4.6.

Many thanks in advance.
Marek