You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/12/09 08:01:36 UTC

[GitHub] [superset] prs1022 opened a new issue #17701: v1.3.superset clickhouse database,server paging query compile limit m offset n to limit 0,n

prs1022 opened a new issue #17701:
URL: https://github.com/apache/superset/issues/17701


   as the title display, when  I develop based on V1.3 superset , I have a clickhouse database,
   create a chart using the viz_type table , there is an experimental function : server paging
   
   So I choose it for my query. But I found the bug:
   
   for example , I choose page limit 10,when I choose the second page, it show me 20 results.
   
   So I debug find that clickhouse engine compile limit m offset n  to limit 0 ,n to lead this result.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] srinify commented on issue #17701: v1.3.superset clickhouse database,server paging query compile limit m offset n to limit 0,n

Posted by GitBox <gi...@apache.org>.
srinify commented on issue #17701:
URL: https://github.com/apache/superset/issues/17701#issuecomment-991822005


   hey there @prs1022 -- I'm having trouble following your original issue. Can you post a screen recording?
   
   What's your recommended course of action and are you able to contribute a fix?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] srinify commented on issue #17701: v1.3.superset clickhouse database,server paging query compile limit m offset n to limit 0,n

Posted by GitBox <gi...@apache.org>.
srinify commented on issue #17701:
URL: https://github.com/apache/superset/issues/17701#issuecomment-991822005


   hey there @prs1022 -- I'm having trouble following your original issue. Can you post a screen recording?
   
   What's your recommended course of action and are you able to contribute a fix?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] prs1022 commented on issue #17701: v1.3.superset clickhouse database,limit and offset are not working as expected.

Posted by GitBox <gi...@apache.org>.
prs1022 commented on issue #17701:
URL: https://github.com/apache/superset/issues/17701#issuecomment-993080744


   > Just change sqlalchemy-clickhouse to [clickhouse-sqlalchemy](https://github.com/xzkostyan/clickhouse-sqlalchemy) will solve your problem. This pr is not necessary at all. #17721
   
   @save-my-heart thank you for reply, I remove sqlalchemy-clickhouse ,it seems good. I close pr now.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] prs1022 commented on issue #17701: v1.3.superset clickhouse database,server paging query compile limit m offset n to limit 0,n

Posted by GitBox <gi...@apache.org>.
prs1022 commented on issue #17701:
URL: https://github.com/apache/superset/issues/17701#issuecomment-992033740


   > hey there @prs1022 -- I'm having trouble following your original issue. Can you post a screen recording?
   > 
   > What's your recommended course of action and are you able to contribute a fix?
   
   Thank you for your reply,I do a test , Here is my test program, you can find the reason for this bug.
   when I want limit 5 offset 10, mysql is good, but clickhouse get a bad result.
   ```
   def test_sql():
       t = table('t', column('x'))
       sa = select([t])
       LIMIT = 5
       OFFSET = 10
       s = sa.where(t.c.x == 5).limit(LIMIT).offset(OFFSET)
   
       engine = create_engine("mysql://root:123456@127.0.0.1:3306/aaaa")
       print(s.compile(engine,compile_kwargs={"literal_binds": True}))
       print("==="*10)
       engine = create_engine("clickhouse://root:123456@127.0.0.1:8123/test")
       sql = str(s.compile(engine,compile_kwargs={"literal_binds": True}))
       print(sql)
   ```
   here is the result
   ```
   SELECT t.x 
   FROM t 
   WHERE t.x = 5 
    LIMIT 10, 5
   ==============================
   SELECT x 
   FROM t 
   WHERE x = 5
    LIMIT 0,10
   
   ```
   I have a temporary solution for the clickhouse database:
   `sql.replace(f'LIMIT 0,{OFFSET}', f'LIMIT {OFFSET},{LIMIT}')`
   
    and I haven't found this bug with other data sources.  I record this in my [zhihu blog](https://zhuanlan.zhihu.com/p/443630138).
   
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] prs1022 closed issue #17701: v1.3.superset clickhouse database,limit and offset are not working as expected.

Posted by GitBox <gi...@apache.org>.
prs1022 closed issue #17701:
URL: https://github.com/apache/superset/issues/17701


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] save-my-heart commented on issue #17701: v1.3.superset clickhouse database,limit and offset are not working as expected.

Posted by GitBox <gi...@apache.org>.
save-my-heart commented on issue #17701:
URL: https://github.com/apache/superset/issues/17701#issuecomment-992193006


   Just change sqlalchemy-clickhouse to [clickhouse-sqlalchemy](https://github.com/xzkostyan/clickhouse-sqlalchemy) will solve your problem.
   This pr is not necessary at all. #17721 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org