4paradigm / 4paradigm/OpenMLDB

Support SQL syntax of limit with parameter

未关闭
#3,179 1 条评论 0 个 reaction 已指派 1 人 已被 @aceforeverd 认领 在 GitHub 查看
execute-engine
主要语言
C++
星标
1.7k
派生
331
平均合并
12 天 12 小时
30 天内合并 PR
1

描述

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
```

贡献指南

打开贡献指南

调研方向

The error originates in hybridse/src/planv2/ast_node_converter.cc and sql_compiler.cc, indicating unsupported LIMIT with parameter expression. Start by examining the SQL parser and planner code to understand how LIMIT clauses are currently handled. Look for where LimitOffset expressions are processed and extend support for parameterized limits. Testing involves running SQL queries with parameterized LIMIT through the Python SDK to verify the fix.

由索引模型根据 Issue 内容生成。

评估

技术栈
python, sql
领域
backend, databases, machine-learning
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。