phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lishuang0826 <lishuang0...@gmail.com>
Subject Re: COALESCE Function Not Working With NULL Values
Date Tue, 21 May 2019 07:46:09 GMT
<html>
<head>
    <meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>
</head>
<body>
<style>
    font{
        line-height: 1.6;
    }
    ul,ol{
        padding-left: 20px;
        list-style-position: inside;
    }
</style>
<div style = 'font-family:Helvetica,Helvetica,微软雅黑, 宋体; line-height:1.6;'>
    <div ></div><div>
    <div>
        <span>Hi,</span></div><div><span><br></span></div><div><span>I
wonder what will the phoenix roadmap be since it has been nearly a year since the last office
release publised.</span></div><div><br></div><div>Thanks&nbsp;</div>
    <div>
        <span>
            <br>
        </span>
    </div>
    <div id="ntes-pcmac-signature" style="font-family:'Helvetica','Microsoft Yahei', '微软雅黑'">
    
    <div style="font-size:14px; padding: 0;  margin:0;">

    </div>
</div>
    <br>
</div><div class="J-reply" style="background-color:#f2f2f2;color:black;padding-top:6px;padding-bottom:6px;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;margin-top:45px;margin-bottom:20px;font-family:''Helvetica','Microsoft
Yahei', '微软雅黑'';">
    <div style="font-size:12px;line-height:1.6;word-break:break-all;margin-left:10px;margin-right:10px">On
<span class="mail-date">05/15/2019 13:03</span>,<a class="mail-to" style="text-decoration:none;color:#2a83f2;"
href="mailto:francischuang@apache.org">Francis Chuang&lt;francischuang@apache.org&gt;</a>
wrote: </div>
</div>
<blockquote id="ntes-pcmail-quote" style="margin: 0; padding: 0; font-size: 14px; font-family:
''Helvetica','Microsoft Yahei', '微软雅黑'';">
Due to the incompatibility, you will need to wait for a new release in <br>the 5.x branch
to get 5.x working with HBase 2.0.x.<br><br>Phoenix 5.0.0 is also only compatible
with 2.0.0 (found this out a few <br>months ago) as PHOENIX-4826[1] adds support for
HBase 2.0.1, but is <br>currently unreleased.<br><br>My suggestion would
be to wait for the 5.1.0 release if you're able to. <br>If you really need to deploy
something right now, I'd suggest using the <br>latest version of the 4.x.x branch (4.14.1)
and HBase 1.4.x.<br><br>Francis<br><br>[1] https://issues.apache.org/jira/browse/PHOENIX-4826<br><br>On
15/05/2019 2:50 pm, Jestan Nirojan wrote:<br> <blockquote class="mmbqc1">Hi Jaanai,<br>
<br> Sorry I could not understand much from <br> https://issues.apache.org/jira/browse/PHOENIX-5268<br>
Because of this recent change, there will not be a Phoenix release for <br> HBase 2.0.x
in future Or there is an existing&nbsp; compatibility issue ?<br> What is the Phoenix
version recommended for a new deployment ? :) ,<br> <br> thanks and regards,<br>
-Jestan Nirojan<br> <br> On Wed, May 15, 2019 at 7:04 AM Jaanai Zhang &lt;cloud.poster@gmail.com
<br> &lt;mailto:cloud.poster@gmail.com&gt;&gt; wrote:<br> <br>
    Hi, Jestan<br> <br>     Now Phoenix 5.0.0 is not compatible with HBase 2.0.5,<br>
    https://issues.apache.org/jira/browse/PHOENIX-5268<br> <br>     ----------------------------------------<br>
     &nbsp; &nbsp;Jaanai Zhang<br>      &nbsp; &nbsp;Best regards!<br>
<br> <br> <br>     Jestan Nirojan &lt;jestannirojan@gmail.com<br>
    &lt;mailto:jestannirojan@gmail.com&gt;&gt; 于2019年5月15日周三 上午5:04写道:<br>
<br>         Hi William,<br> <br>         Thanks, It is working with<br>
        coalesce(functionThatMightReturnNull(), now()) without an<br>         explicit
null;<br>         Phoenix Version is 5.0.0.0 which uses HBase 2.0.5<br>      
  I have not opened any issue for this, I am not sure how it is<br>         suppose
to work.<br> <br>         I am developing&nbsp; a phoenix driver for metabase<br>
        &lt;https://metabase.com/&gt;&nbsp;(which is a BI/DataViz tool).<br>
        It seems for optional query parameter, null values are directly<br>        
set by the base metabase driver which I am trying to extend.<br> <br>        
I wish if phoenix can support explicit null values.<br> <br>         thanks and
regards,<br>         -Jestan<br> <br> <br>         On Tue, May 14,
2019 at 11:52 PM William Shen<br>         &lt;willshen@marinsoftware.com &lt;mailto:willshen@marinsoftware.com&gt;&gt;<br>
        wrote:<br> <br>             Just took a look at the implementation, seems
like Phoenix<br>             relies on the first expression to not be an expression
that<br>             is not just an explicit "null" because it needs to evaluate<br>
            for data type coercion. What's the use case for specifying<br>         
   an explicit null?<br> <br>             On the other hand, the following should
work:<br>             select coalesce(functionThatMightReturnNull(), now()) as date;<br>
<br>             On Tue, May 14, 2019 at 11:14 AM William Shen<br>           
 &lt;willshen@marinsoftware.com<br>             &lt;mailto:willshen@marinsoftware.com&gt;&gt;
wrote:<br> <br>                 Jestan,<br>                 It seems like
a bug to me. What version of Phoenix are<br>                 you using, and did you
create a ticket already?<br> <br>                 On Tue, May 14, 2019 at 10:26
AM Jestan Nirojan<br>                 &lt;jestannirojan@gmail.com<br>    
            &lt;mailto:jestannirojan@gmail.com&gt;&gt; wrote:<br> <br>
                    Hi,<br> <br>                     I am trying to use&nbsp;COALESCE
function to handle<br>                     default value in WHERE condition like below.<br>
<br>                     select&nbsp; * from table1 where created_date &gt;=<br>
                    coalesce(null, trunc(now(), 'day'));<br> <br>            
        But it throws NullPointerException<br> <br>                     Caused
by: java.lang.NullPointerException<br>                     at<br>            
        org.apache.phoenix.schema.types.PDataType.equalsAny(PDataType.java:326)<br>
                    at<br>                     org.apache.phoenix.schema.types.PDate.isCoercibleTo(PDate.java:111)<br>
                    at<br>                     org.apache.phoenix.expression.function.CoalesceFunction.&lt;init&gt;(CoalesceFunction.java:68)<br>
                    ... 47 more<br> <br>                     I was able to reproduce
the same error with<br>                     following query<br> <br>   
                 select coalesce(null, now()) as date;<br> <br>              
      Here are some other variant of same issue<br> <br>                     1.&nbsp;select
coalesce(now(), now()) as date; //<br>                     returns&nbsp;2019-05-14<br>
                    2.&nbsp;select coalesce(now(), null) as date; // returns<br>
                    empty<br>                     3.&nbsp;select coalesce(null,
now()) as date; // throws<br>                     exception<br> <br>   
                 I have tried the same for INT and VARCHAR, same outcome<br>       
             Am I doing something wrong here or is coalesce<br>                    
suppose to return a non null value ?<br> <br>                     thanks and regards,<br>
                    -Jestan Nirojan<br> <br></blockquote></blockquote><!--�-->
</div>
</body>
</html>
Mime
View raw message