4paradigm / 4paradigm/OpenMLDB
ConstNode GetAsXXXX methods refactor
- Vorherrschende Sprache
- C++
- Sterne
- 1.7k
- Forks
- 331
- Ø Merge
- 12 T. 12 Std.
- Gemergte PRs (30 T.)
- 1
Beschreibung
**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.
Beitragsleitfaden
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- cpp
- Bereich
- backend
- Issue-Typ
- Refactoring
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100