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

Lars Hofhansl commented on PHOENIX-2965:
----------------------------------------

Wait... The NPE doesn't come out of my code. Stock 4.8 Phoenix throws an NPE 
for a query like this: {{SELECT COUNT(DISINCT p1, p2) FROM table}}
{code}
java.lang.NullPointerException
        at 
org.apache.phoenix.parse.FunctionParseNode.validate(FunctionParseNode.java:136)
        at 
org.apache.phoenix.compile.ExpressionCompiler.visitLeave(ExpressionCompiler.java:325)
        at 
org.apache.phoenix.compile.ProjectionCompiler$SelectClauseVisitor.visitLeave(ProjectionCompiler.java:680)
        at 
org.apache.phoenix.compile.ProjectionCompiler$SelectClauseVisitor.visitLeave(ProjectionCompiler.java:576)
        at 
org.apache.phoenix.parse.FunctionParseNode.accept(FunctionParseNode.java:86)
        at 
org.apache.phoenix.compile.ProjectionCompiler.compile(ProjectionCompiler.java:408)
        at 
org.apache.phoenix.compile.QueryCompiler.compileSingleFlatQuery(QueryCompiler.java:564)
        at 
org.apache.phoenix.compile.QueryCompiler.compileSingleQuery(QueryCompiler.java:510)
        at 
org.apache.phoenix.compile.QueryCompiler.compileSelect(QueryCompiler.java:205)
        at 
org.apache.phoenix.compile.QueryCompiler.compile(QueryCompiler.java:157)
{code}

Again, this is stock Phoenix. I'll file a separate bug.

> Use DistinctPrefixFilter logic for COUNT(DISTINCT ...) and COUNT(...) GROUP BY
> ------------------------------------------------------------------------------
>
>                 Key: PHOENIX-2965
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2965
>             Project: Phoenix
>          Issue Type: Sub-task
>            Reporter: Lars Hofhansl
>             Fix For: 4.8.0
>
>         Attachments: 2965.txt
>
>
> Parent uses skip scanning to optimize DISTINCT and certain GROUP BY 
> operations along the row key.
> COUNT queries are optimized differently, could be sped up significantly as 
> well.
> [~giacomotaylor], I might need to help into where COUNT(DISTINCT) queries are 
> planned and optimized.



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

Reply via email to