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

Aron Attila Meszaros edited comment on PHOENIX-7109 at 11/20/23 10:36 AM:
--------------------------------------------------------------------------

It seems that the problem is somewhere around OffsetResultIterator.
During debugging I noticed that it's possible to get empty tuple from the 
delegate itarator's next function (Line 50). 
After modifying 
{code:java}
if (isDummy(tuple)){code}
condition to 
{code:java}
if (isDummy(tuple) || tuple.isEmpty()) {code}
looks like everything is working fine.

Not sure if this is the root cause of the issue, or the underlying iterator 
should not return the empty tuples.


was (Author: JIRAUSER293246):
It seems that the problem is somewhere around OffsetResultIterator.
During debugging I noticed that it's possible to get empty tuple from the 
delegate itarator's next function (Line 50). 
Modifying 
{code:java}
if (isDummy(tuple)){code}
condition to 
{code:java}
if (isDummy(tuple) || tuple.isEmpty()) {code}
Not sure if this is the root cause of the issue, or the underlying iterator 
should not return the empty tuples.

> Incorrect query results when using OFFSET
> -----------------------------------------
>
>                 Key: PHOENIX-7109
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-7109
>             Project: Phoenix
>          Issue Type: Bug
>          Components: phoenix
>    Affects Versions: 5.1.3
>            Reporter: Aron Attila Meszaros
>            Assignee: Aron Attila Meszaros
>            Priority: Major
>
> Steps to reproduce:
>  # create table test (i1 integer not null, i2 integer not null, i3 integer, 
> i4 integer, CONSTRAINT pk PRIMARY KEY (i1, i2));
>  # upsert into test select rand()*40, rand()*10000000, null, rand()*100 from 
> SYSTEM.CATALOG limit 130000;
>  # upsert into test select rand()*40, rand()*10000000, null, rand()*100 from 
> test limit 130000;
> Repeat step 3 a few times, then run
> {noformat}
> select * from test where i1=10 and i4=20 offset X;{noformat}
> where X is bigger than the number of rows satisfying the condition.
> There are rows returned by phoenix (expected result is empty set.)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to