4paradigm / 4paradigm/OpenMLDB
feat(ResultSetBuilder): construct `ResultSet` directly from client, support all basic data type
- Ngôn ngữ chính
- C++
- Star
- 1.7k
- Fork
- 331
- Merge trung bình
- 12 ngày 12 giờ
- Pull request đã merge (30 ngày)
- 1
Mô tả
**Is your feature request related to a problem? Please describe.**
There are three ways to construct a `ResultSet`, https://github.com/4paradigm/OpenMLDB/blob/420398b8349880bce262db06c3b143d023b56862/src/sdk/result_set_sql.h#L45-L56, the first two approach rely on protobuf structures, and the third approach assume all fields as string.
So there is no ease way to construct a `ResultSet` from scratch. E.g. I'd like to construct a `ResultSet` with the schema of `id int, buf string, ts timestamp`, and assert result set data in unit tests.
**Describe the solution you'd like**
TBD
An example (may not accurate):
```cpp
ResultSetBuilder()
.schema(schema)
.data(rows)
.build();
```
**other context**
hybridse's test use `Row` to assert test results: https://github.com/4paradigm/OpenMLDB/blob/420398b8349880bce262db06c3b143d023b56862/hybridse/include/codec/row.h#L36-L38. Let's see if we can reuse few or more
Hướng dẫn đóng góp
Hướng nghiên cứu
Review the existing ResultSet constructors in src/sdk/result_set_sql.h and the Row class in hybridse/include/codec/row.h. Understand the schema representation and data types (int, string, timestamp). Design a builder API that can create a ResultSet directly from a schema and rows of data, then implement it in the C++ SDK.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- cpp
- Lĩnh vực
- database, testing
- Loại issue
- Tính năng
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 45/100