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

James Taylor edited comment on PHOENIX-3054 at 9/2/16 4:40 PM:
---------------------------------------------------------------

That's a good catch with the MergeSortResultIterator, [[email protected]]. Were 
the ProductMetricsIT tests failing because there were no iterators in the merge 
sort? Is this the same, but slightly more efficient?
{code}
     private PriorityQueue<MaterializedComparableResultIterator> getMinHeap() 
throws SQLException {
         if (minHeap == null) {
             List<PeekingResultIterator> iterators = 
resultIterators.getIterators();
-            minHeap = new 
PriorityQueue<MaterializedComparableResultIterator>(iterators.size());
+            minHeap = new 
PriorityQueue<MaterializedComparableResultIterator>(Math.max(1, 
iterators.size()));
             for (PeekingResultIterator itr : iterators) {
                 if (itr.peek() == null) {
                     itr.close();
{code}

+1 on your patch, pending your opinion on the above. Thanks for trying the no 
group case in other database - I think that's good verification.


was (Author: jamestaylor):
That's a good catch with the MergeSortResultIterator, [[email protected]]. Were 
the ProductMetricsIT tests failing because there were no iterators in the merge 
sort? Is this the same, but slightly more efficient?
{code}
     private PriorityQueue<MaterializedComparableResultIterator> getMinHeap() 
throws SQLException {
         if (minHeap == null) {
             List<PeekingResultIterator> iterators = 
resultIterators.getIterators();
-            minHeap = new 
PriorityQueue<MaterializedComparableResultIterator>(iterators.size());
+            minHeap = new 
PriorityQueue<MaterializedComparableResultIterator>(Math.max(1, 
iterators.size()));
             for (PeekingResultIterator itr : iterators) {
                 if (itr.peek() == null) {
                     itr.close();
{code}

> Counting zero null rows returns an empty result set
> ---------------------------------------------------
>
>                 Key: PHOENIX-3054
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-3054
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 4.7.0
>            Reporter: Kevin Liew
>            Assignee: Ankit Singhal
>            Priority: Minor
>              Labels: count, count(*), null, sql
>             Fix For: 4.9.0, 4.8.1
>
>         Attachments: PHOENIX-3054.patch, PHOENIX-3054_v1.patch
>
>
> Execute the following query on a table with zero null cells.
> {code}
> select count(*) from table where column1 = null
> {code}
> The result set should consist of one cell with the value `0` but the result 
> set is empty.



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

Reply via email to