Commit 78a6521
authored
Add ability to set statistics in the SQLExecutor (#134)
The current `SQLExecutor` does not allow us to provide statistics, meaning that the result sets using `datafusion-federation` will always have `Rows=Absent, ...`. This can be a problem when joining large amounts of data in Datafusion, as a suboptimal plan is often selected.
This PR adds the `statistics` function to `SQLExecutor`, so it can be implemented to provide more information to the planner. It also adds it to `VirtualExecutionPlan` and `SchemaCastScanExec`, so it can reach Datafusion.
By default, it simply returns `Statistics::new_unknown`, so existing implementations of `SQLExecutor` can continue to work as normal.1 parent e0496b3 commit 78a6521
File tree
3 files changed
+25
-2
lines changed- datafusion-federation/src
- schema_cast
- sql
3 files changed
+25
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
113 | 114 | | |
114 | 115 | | |
115 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
116 | 121 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
46 | 54 | | |
47 | 55 | | |
48 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
140 | 141 | | |
141 | 142 | | |
142 | 143 | | |
| 144 | + | |
| 145 | + | |
143 | 146 | | |
144 | | - | |
| 147 | + | |
145 | 148 | | |
| 149 | + | |
146 | 150 | | |
147 | 151 | | |
148 | 152 | | |
| |||
154 | 158 | | |
155 | 159 | | |
156 | 160 | | |
| 161 | + | |
157 | 162 | | |
158 | 163 | | |
159 | 164 | | |
160 | | - | |
| 165 | + | |
161 | 166 | | |
162 | 167 | | |
163 | 168 | | |
| |||
169 | 174 | | |
170 | 175 | | |
171 | 176 | | |
| 177 | + | |
172 | 178 | | |
173 | 179 | | |
174 | 180 | | |
| |||
343 | 349 | | |
344 | 350 | | |
345 | 351 | | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
346 | 356 | | |
347 | 357 | | |
348 | 358 | | |
| |||
0 commit comments