4paradigm / 4paradigm/OpenMLDB
ConstNode GetAsXXXX methods refactor
- 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.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
This issue is going to to Refactor ConstNode's GetAsXXXX methods, e.g. `GetAsString()`, `GetAsDouble` etc, since it is hard to know if these GetAsXXXX methods go well or not. So we have to re-design the methods as follows:
```
bool GetAsInt(int* output);
bool GetAsString(std::string* str)
```
Also, we will support GetAsString for types like `kBool`, `kDate`, `kTimestamp`.
1. kBool: `true` -> `"true"`, kBool: `false` -> `"false"`
2. kTimestamp: `1590115420000` -> `"1590115420000L"`
3. kDate:
```
Date date(2020, 05, 22);
to_string(date.date_)
```
need to discuss what `kDate` string looks like. `yyyy-mm-dd` pattern string will be far more reasonable.
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
Hướng dẫn đóng góp
Hướng nghiên cứu
Look for ConstNode class in the codebase, likely in a header file. Examine existing GetAsXXXX methods to understand their signatures and usage. The refactor changes return types to bool and uses output parameters. Also need to implement GetAsString for kBool, kDate, kTimestamp types, deciding on string format for kDate. Check for any existing tests for ConstNode to update.
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
- backend
- Loại issue
- Tái cấu trúc
- Độ 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