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

mustafa Erkoç commented on DRILL-7490:
--------------------------------------

this issue has a two problems

1. does not push down all limit values ​​except limit 10 (only limit 10 
pushdown)

2. pushdown only when a single column is selected. does not pushdown when 
multiple columns are selected

The following query:

!image-2020-07-24-17-45-27-357.png!

!image-2020-07-24-17-46-05-219.png!

!image-2020-07-24-17-46-59-584.png!

!image-2020-07-24-17-48-53-740.png!

N

> limit is not pushed to JDBC storage plugin
> ------------------------------------------
>
>                 Key: DRILL-7490
>                 URL: https://issues.apache.org/jira/browse/DRILL-7490
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Query Planning & Optimization, Storage - JDBC
>    Affects Versions: 1.11.0
>            Reporter: Vova Vysotskyi
>            Assignee: Vova Vysotskyi
>            Priority: Major
>              Labels: ready-to-commit
>             Fix For: 1.17.0
>
>         Attachments: image-2020-07-24-17-31-02-589.png, 
> image-2020-07-24-17-31-48-831.png, image-2020-07-24-17-35-28-912.png, 
> image-2020-07-24-17-45-27-357.png, image-2020-07-24-17-46-05-219.png, 
> image-2020-07-24-17-46-59-584.png, image-2020-07-24-17-48-53-740.png
>
>
> The limit is not pushed to JDBC storage plugin. 
> The following query:
> {code:sql}
> select person_id from mysql.`drill_mysql_test`.person limit 10
> {code}
> Returns plan:
> {noformat}
> 00-00    Screen
> 00-01      Project(person_id=[$0])
> 00-02        SelectionVectorRemover
> 00-03          Limit(fetch=[10])
> 00-04            Limit(fetch=[10])
> 00-05              Jdbc(sql=[SELECT `person_id` FROM 
> `drill_mysql_test`.`person` ])
> {noformat}
> This issue happens since incorrect row count is calculated for {{JdbcSort}}.
> Drill enforces to use {{RelNode.estimateRowCount(mq)}} for calculating row 
> count for all inheritants of {{Sort}} rel node (see {{DrillRelMdRowCount}}), 
> but {{JdbcSort}} doesn't override this method and uses parent one which 
> returns row count of input. So planner choses {{DrillLimitRel}} since it has 
> less row count.



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

Reply via email to