Doris 添加order by后,默认加上了 limit 65535 问题记录

Doris 添加order by后,默认加上了 limit 65535

执行explain SELECT year, month, std_province, std_city, std_brand_name, SUM(p_count) AS num FROM m_allweb_week_sales_h_agg GROUP BY year, month, std_province, std_city, std_brand_name
获得如下结果:
PLAN FRAGMENT 0
OUTPUT EXPRS:<slot 6> | <slot 7> | <slot 8> | <slot 9> | <slot 10> | <slot 11> |
PARTITION: UNPARTITIONED

RESULT SINK

4:EXCHANGE
tuple ids: 1

PLAN FRAGMENT 1
OUTPUT EXPRS:
PARTITION: HASH_PARTITIONED: <slot 6>, <slot 7>, <slot 8>, <slot 9>, <slot 10>

STREAM DATA SINK
EXCHANGE ID: 04
UNPARTITIONED

3:AGGREGATE (merge finalize)
| output: sum(<slot 11>)
| group by: <slot 6>, <slot 7>, <slot 8>, <slot 9>, <slot 10>
| tuple ids: 1
|
2:EXCHANGE
tuple ids: 1

PLAN FRAGMENT 2
OUTPUT EXPRS:
PARTITION: RANDOM

STREAM DATA SINK
EXCHANGE ID: 02
HASH_PARTITIONED: <slot 6>, <slot 7>, <slot 8>, <slot 9>, <slot 10>

1:AGGREGATE (update serialize)
| output: sum(p_count)
| group by: year, month, std_province, std_city, std_brand_name
| tuple ids: 1
|
0:OlapScanNode
TABLE: m_allweb_week_sales_h_agg
PREAGGREGATION: ON
partitions=41/41
rollup: grab_car_sum_total
buckets=1312/1312
tuple ids: 0

执行explain SELECT year, month, std_province, std_city, std_brand_name, SUM(p_count) AS num FROM m_allweb_week_sales_h_agg GROUP BY year, month, std_province, std_city, std_brand_name order by year, month;
获得如下结果:
PLAN FRAGMENT 0
OUTPUT EXPRS:<slot 12> | <slot 13> | <slot 14> | <slot 15> | <slot 16> | <slot 17> |
PARTITION: UNPARTITIONED

RESULT SINK

5:MERGING-EXCHANGE
limit: 65535
tuple ids: 2

PLAN FRAGMENT 1
OUTPUT EXPRS:
PARTITION: HASH_PARTITIONED: <slot 6>, <slot 7>, <slot 8>, <slot 9>, <slot 10>

STREAM DATA SINK
EXCHANGE ID: 05
UNPARTITIONED

2:TOP-N
| order by: <slot 12> ASC, <slot 13> ASC
| offset: 0
| limit: 65535
| tuple ids: 2
|
4:AGGREGATE (merge finalize)
| output: sum(<slot 11>)
| group by: <slot 6>, <slot 7>, <slot 8>, <slot 9>, <slot 10>
| tuple ids: 1
|
3:EXCHANGE
tuple ids: 1

PLAN FRAGMENT 2
OUTPUT EXPRS:
PARTITION: RANDOM

STREAM DATA SINK
EXCHANGE ID: 03
HASH_PARTITIONED: <slot 6>, <slot 7>, <slot 8>, <slot 9>, <slot 10>

1:AGGREGATE (update serialize)
| output: sum(p_count)
| group by: year, month, std_province, std_city, std_brand_name
| tuple ids: 1
|
0:OlapScanNode
TABLE: m_allweb_week_sales_h_agg
PREAGGREGATION: ON
partitions=41/41
rollup: grab_car_sum_total
buckets=1312/1312
tuple ids: 0

莫名其妙加上了一个limit限制。

我手动修改limit
explain SELECT year, month, std_province, std_city, std_brand_name, SUM(p_count) AS num FROM m_allweb_week_sales_h_agg GROUP BY year, month, std_province, std_city, std_brand_name order by year, month limit 100000000;
结果如下:
PLAN FRAGMENT 0
OUTPUT EXPRS:<slot 12> | <slot 13> | <slot 14> | <slot 15> | <slot 16> | <slot 17> |
PARTITION: UNPARTITIONED

RESULT SINK

5:MERGING-EXCHANGE
limit: 100000000
tuple ids: 2

PLAN FRAGMENT 1
OUTPUT EXPRS:
PARTITION: HASH_PARTITIONED: <slot 6>, <slot 7>, <slot 8>, <slot 9>, <slot 10>

STREAM DATA SINK
EXCHANGE ID: 05
UNPARTITIONED

2:TOP-N
| order by: <slot 12> ASC, <slot 13> ASC
| offset: 0
| limit: 100000000
| tuple ids: 2
|
4:AGGREGATE (merge finalize)
| output: sum(<slot 11>)
| group by: <slot 6>, <slot 7>, <slot 8>, <slot 9>, <slot 10>
| tuple ids: 1
|
3:EXCHANGE
tuple ids: 1

PLAN FRAGMENT 2
OUTPUT EXPRS:
PARTITION: RANDOM

STREAM DATA SINK
EXCHANGE ID: 03
HASH_PARTITIONED: <slot 6>, <slot 7>, <slot 8>, <slot 9>, <slot 10>

1:AGGREGATE (update serialize)
| output: sum(p_count)
| group by: year, month, std_province, std_city, std_brand_name
| tuple ids: 1
|
0:OlapScanNode
TABLE: m_allweb_week_sales_h_agg
PREAGGREGATION: ON
partitions=41/41
rollup: grab_car_sum_total
buckets=1312/1312
tuple ids: 0

最终结果导致我查询到的数据不完整。

Palo会默认的为order by加上limit65535,如果想要order by更多的数据可以手动写一个order by 更大的数字。
这里我们处理的不是很好,后续我们会去掉这个选项

文章来源 :https://github.com/apache/doris/issues/219

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值