4paradigm / 4paradigm/OpenMLDB
api server: query with null input
- Dominant language
- C++
- Stars
- 1.7k
- Forks
- 331
- Avg merge
- 12d 12h
- Merged PRs (30d)
- 1
Description
```sh
> curl -X POST http://127.0.0.1:9527/dbs/test_db -d '{"mode":"online","sql": "select * from tx where id = ?", "input": {"schema": ["int16"], "data": [null]}}'
{"code":-1,"msg":"Json parse failed, INVALID_ARGUMENT: append failed on 0 type 1"}⏎
```
Contributor guide
Research direction
The issue shows a curl command that fails when querying with a null input parameter. Start by examining the API server code that handles POST requests to /dbs/{db_name}, likely in a file like server/api_server.cc. Look for the SQL parsing and parameter binding logic, particularly how the 'input' field with schema and data is processed. The error message suggests a type mismatch or append failure when handling null for an int16 parameter. Check the data type handling and null value serialization in the database engine. Running the provided curl command against a local instance will reproduce the error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- sql
- Domain
- api, backend, databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100