Repository navigation
Commit 1be095e
[fix](nereids) Reject score() over a table stream
### What problem does this PR solve?
Issue Number: None
Related PR: apache#69292
Problem Summary:
Review of 73497b3 found that score() over a table stream fails to plan:
SELECT id, score() AS relevance FROM s
WHERE c1 MATCH 'apple' ORDER BY relevance DESC LIMIT 10;
-- column __score not found in child output
LogicalOlapTableStreamScan is a LogicalOlapScan, so BindScoreToOlapScan
added the score column to it. NormalizeOlapTableStreamScan then replaces the
stream with new scans of its table and of its changes, possibly unioned,
which do not have that column. A table stream is not the one table that
score() is computed for, so the binder now rejects it with the
unsupported-SELECT error.
### Release note
None
### Check List (For Author)
- Test: Unit Test
- BindScoreToOlapScanTest.testUnsupportedSelectIsRejected covers the query
above on an append-only stream; all 75 tests pass. Checkstyle passes.
The regression suites were not run again: none of them reads a table
stream.
- Behavior changed: Yes. score() over a table stream, an experimental
feature, fails with the unsupported-SELECT error instead of a planning
error.
- Does this need documentation: No
Co-Authored-By: Claude Opus 5.5 <[email protected]>1 parent 73497b3 commit 1be095e
2 files changed
Lines changed: 28 additions & 2 deletions
File tree
- fe/fe-core/src
- main/java/org/apache/doris/nereids/rules/rewrite
- test/java/org/apache/doris/nereids/rules/rewrite
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
176 | 177 | | |
177 | 178 | | |
178 | 179 | | |
179 | | - | |
| 180 | + | |
| 181 | + | |
180 | 182 | | |
181 | 183 | | |
182 | 184 | | |
| |||
193 | 195 | | |
194 | 196 | | |
195 | 197 | | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
196 | 201 | | |
197 | 202 | | |
198 | 203 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| 46 | + | |
| 47 | + | |
45 | 48 | | |
46 | 49 | | |
47 | 50 | | |
| |||
66 | 69 | | |
67 | 70 | | |
68 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
69 | 88 | | |
70 | 89 | | |
71 | 90 | | |
| |||
266 | 285 | | |
267 | 286 | | |
268 | 287 | | |
269 | | - | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
270 | 291 | | |
271 | 292 | | |
272 | 293 | | |
| |||
0 commit comments