Commit 5dc5764
authored
feat(sqllogictest): use serde derived structs for schedule parsing (#1953)
This PR refactors the schedule file parsing in the sqllogictest crate to
use serde-derived structs instead of manual TOML parsing, as requested
in #1952.
### Changes
- **New structs with serde derives:**
- `ScheduleConfig` - top-level configuration parsed from TOML
- `EngineConfig` - per-engine configuration with `#[serde(flatten)]` for
extensibility
- `EngineType` - enum of supported engine types
- **Refactored parsing flow:**
- `Schedule::from_file()` now uses `toml::from_str()` directly
- Added `instantiate_engines()` to separate parsing from engine creation
- Removed manual `parse_engines()` and `parse_steps()` functions
- **Forward-compatibility:**
- Uses `#[serde(flatten)]` to capture extra fields in
`EngineConfig.extra`
- This enables PR #1943 to easily add `catalog_type` and
`catalog_properties` support
### Relation to #1943
This PR was suggested by @liurenjie1024 as a prerequisite to #1943
(dynamic catalog configuration). The `#[serde(flatten)]` approach allows
#1943 to simply extract the catalog configuration from
`EngineConfig.extra` without modifying the parsing logic.
### Testing
- All existing tests pass
- Added new unit tests for deserialization behavior
- Integration test with `df_test.toml` passes unchanged
Closes #19521 parent bc86d10 commit 5dc5764
File tree
3 files changed
+207
-105
lines changed- crates/sqllogictest/src
- engine
3 files changed
+207
-105
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | 30 | | |
32 | | - | |
| 31 | + | |
33 | 32 | | |
34 | 33 | | |
35 | 34 | | |
| |||
59 | 58 | | |
60 | 59 | | |
61 | 60 | | |
62 | | - | |
| 61 | + | |
63 | 62 | | |
64 | 63 | | |
65 | 64 | | |
66 | 65 | | |
67 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
68 | 70 | | |
69 | 71 | | |
70 | 72 | | |
71 | 73 | | |
72 | 74 | | |
73 | 75 | | |
74 | 76 | | |
75 | | - | |
76 | | - | |
77 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
78 | 82 | | |
79 | 83 | | |
80 | 84 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| 24 | + | |
23 | 25 | | |
24 | | - | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
29 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
30 | 50 | | |
31 | 51 | | |
32 | 52 | | |
33 | 53 | | |
34 | 54 | | |
35 | 55 | | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
43 | 59 | | |
44 | 60 | | |
45 | 61 | | |
| |||
65 | 81 | | |
66 | 82 | | |
67 | 83 | | |
68 | | - | |
| 84 | + | |
69 | 85 | | |
70 | | - | |
71 | | - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
72 | 121 | | |
73 | | - | |
74 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
75 | 126 | | |
76 | | - | |
77 | | - | |
78 | 127 | | |
79 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
80 | 134 | | |
81 | 135 | | |
82 | 136 | | |
83 | 137 | | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
| 138 | + | |
90 | 139 | | |
| 140 | + | |
91 | 141 | | |
92 | 142 | | |
93 | 143 | | |
0 commit comments