4paradigm / OpenMLDB

OpenMLDB is an open-source machine learning database that provides a feature platform computing consistent features for training and inference.
https://openmldb.ai
Apache License 2.0
1.6k stars 320 forks source link

Support SQL syntax of limit with parameter #3179

Open tobegit3hub opened 1 year ago

tobegit3hub commented 1 year ago

Now we are using Python SDK and get this error.

[SQL: SELECT employees.name, employees.age 
FROM employees
 LIMIT ?]
[parameters: (1,)]
SQLQuery:W0331 15:00:52.237329 1441265280 sql_compiler.cc:329] Fail create sql plan: Un-support LIMIT with expression type LimitOffset
    (At /Users/tobe/code/4pd/OpenMLDB/hybridse/src/planv2/planner_v2.cc:40)
    (At /Users/tobe/code/4pd/OpenMLDB/hybridse/src/planv2/ast_node_converter.cc:1811)
    (At /Users/tobe/code/4pd/OpenMLDB/hybridse/src/planv2/ast_node_converter.cc:536)
    (At /Users/tobe/code/4pd/OpenMLDB/hybridse/src/planv2/ast_node_converter.cc:1243)
    (At /Users/tobe/code/4pd/OpenMLDB/hybridse/src/planv2/ast_node_converter.cc:1215)
    (Caused by) Un-support LIMIT with expression type LimitOffset
W0331 15:00:52.237375 1441265280 sql_cluster_router.cc:1053] Status: [1002] fail to explain SELECT employees.name, employees.age 
FROM employees
 LIMIT ?--Un-support LIMIT with expression type LimitOffset
aceforeverd commented 1 year ago

we don't supports convert LIMIT ?:

https://github.com/4paradigm/OpenMLDB/blob/87f1fc757c1ca61f256f0f6f743cf31c3cb611e6/hybridse/src/planv2/ast_node_converter.cc#L1209-L1216