4paradigm / 4paradigm/OpenMLDB
Support SQL syntax of limit with parameter
- Lenguaje dominante
- C++
- Estrellas
- 1.7k
- Forks
- 331
- Merge medio
- 12 d 12 h
- PR fusionados (30 d)
- 1
Descripción
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
```
Guía de contribución
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python, sql
- Área
- backend, databases, machine-learning
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 45/100