[ 
https://issues.apache.org/jira/browse/KYLIN-4157?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16938622#comment-16938622
 ] 

ASF subversion and git services commented on KYLIN-4157:
--------------------------------------------------------

Commit 699158af217821ea902c3db04924241b3521deb7 in kylin's branch 
refs/heads/2.6.x from mawu2
[ https://gitbox.apache.org/repos/asf?p=kylin.git;h=699158a ]

KYLIN-4157 When using PrepareStatement query, functions within WHERE will cause 
InternalErrorException


> When using PrepareStatement query, functions within WHERE will cause 
> InternalErrorException
> -------------------------------------------------------------------------------------------
>
>                 Key: KYLIN-4157
>                 URL: https://issues.apache.org/jira/browse/KYLIN-4157
>             Project: Kylin
>          Issue Type: Bug
>          Components: Query Engine
>    Affects Versions: v2.6.3
>            Reporter: Marc Wu
>            Assignee: Marc Wu
>            Priority: Major
>             Fix For: v3.0.0-beta, v2.6.4
>
>         Attachments: image-2019-09-04-15-39-52-867.png, 
> image-2019-09-04-15-39-58-276.png, image-2019-09-04-20-57-46-121.png
>
>
> Hi Kylin Team:
> I found a bug when I'm using PreparedStatement query.
> Let me use table KYLIN_SALES to explain the scenario.
> There is a SQL like:
>  select LSTG_FORMAT_NAME, sum(PRICE) from KYLIN_SALES where 
> lower(LSTG_FORMAT_NAME) = 'fp-gtc' group by LSTG_FORMAT_NAME
> In some cases, user doesn't know the LSTG_FORMAT_NAME is upper case or lower 
> case, or they just want to query data ignoring cases.
>  So assume they use lower(LSTG_FORMAT_NAME) = 'fp-gtc', it's a function 
> within the filter.
> When I execute this SQL on Kylin web console, it can get the right result, 
> but when I tried to execute it by PreparedStatement query on Postman, it 
> threw InternalErrorException.  !image-2019-09-04-15-39-58-276.png!
>  
> !image-2019-09-04-15-39-52-867.png!
>  
> ----------------------------------------------------------------------------
> h2. Root Cause
> I debugged Kylin to find the root cause, it turns out when the filter 
> contains function, compFilter.getColumn is null, and the 
> compFilter.getFunction contains lower(LSTG_FORMAT_NAME), so that 
> compFilter.getColumn().getType().isDateTimeFamily() will throw 
> NullPointerException, that's the root cause for this 500 error.
>  
> h2. !image-2019-09-04-20-57-46-121.png! Solution
> I suggest to check nullable first before using compFilter.getColumn.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to