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 <
[email protected]> 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
>
> [email protected] | C: 512.423.7447 | skype: michael.mcallister.ha
> <[email protected]> | 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:[email protected]]
> *Sent:* Monday, June 13, 2016 12:58 PM
> *To:* [email protected]
> *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
>
>
>