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

Yaqian Zhang commented on KYLIN-5000:
-------------------------------------

Hi:
In my opinion, in the first case, because the two SQL is executed twice, their 
order may be inconsistent, resulting in duplicate records returned . You can 
try to add "order by ID" to SQL, so that the values of the two queries are 
sorted in the same order. After paging, there should be no duplicate values.
The second case is the one-time execution of SQL. The processing in kylin is 
consistent, and the result is normal without duplicate values.

> kylin query分页多次请求间返回结果有重复
> -------------------------
>
>                 Key: KYLIN-5000
>                 URL: https://issues.apache.org/jira/browse/KYLIN-5000
>             Project: Kylin
>          Issue Type: Task
>          Components: Query Engine
>    Affects Versions: v3.1.1
>            Reporter: star_dev
>            Priority: Major
>         Attachments: 0-1000.csv, 0-4000.csv, 1000-2000.csv, 
> image-2021-06-02-13-31-44-052.png, image-2021-06-02-13-33-02-400.png
>
>
> 请以分页形式分多次请求kylin查询时,如第一次
> SELECT 分组条件, COUNT (1) as kkk FROM table
> WHERE 过滤条件
> GROUP BY 分组条件
> LIMIT 1000 OFFSET 0
> 第二次
> SELECT 分组条件, COUNT (1) as kkk FROM table
> WHERE 过滤条件
> GROUP BY 分组条件
> LIMIT 1000 OFFSET 1000
> 两次查询的结果有重复数据
>  
> 但当执行
> SELECT 分组条件, COUNT (1) as kkk FROM table
> WHERE 过滤条件
> GROUP BY 分组条件
> LIMIT 1000 OFFSET 0
> union 
> SELECT 分组条件, COUNT (1) as kkk FROM table
> WHERE 过滤条件
> GROUP BY 分组条件
> LIMIT 1000 OFFSET 1000
> 时,返回了2000条不重复的数据
>  
> 问题:
>  # 当以分页形式分别独立请求kylin查询时,为何不同的请求间会有重复数据?
>  # 当以union 形式请求kylin查询时,能按照需求返回不重复的满足条数的数据,和1有什么不同吗?



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

Reply via email to