(t *testing.T)
| 21 | } |
| 22 | |
| 23 | func TestRenderTreeUsingTestdataPlans(t *testing.T) { |
| 24 | for _, test := range []struct { |
| 25 | title string |
| 26 | file string |
| 27 | want []QueryPlanRow |
| 28 | }{ |
| 29 | { |
| 30 | // Original Query: |
| 31 | // SELECT s.LastName FROM (SELECT s.LastName FROM Singers AS s WHERE s.FirstName LIKE 'A%' LIMIT 3) s WHERE s.LastName LIKE 'Rich%'; |
| 32 | title: "With Filter Operator", |
| 33 | file: "testdata/plans/filter.input.json", |
| 34 | want: []QueryPlanRow{ |
| 35 | { |
| 36 | ID: 0, |
| 37 | Text: "Serialize Result", |
| 38 | }, |
| 39 | { |
| 40 | ID: 1, |
| 41 | Text: "+- Filter", |
| 42 | Predicates: []string{"Condition: STARTS_WITH($LastName, 'Rich')"}, |
| 43 | }, |
| 44 | { |
| 45 | ID: 2, |
| 46 | Text: " +- Global Limit", |
| 47 | }, |
| 48 | { |
| 49 | ID: 3, |
| 50 | Text: " +- Distributed Union", |
| 51 | Predicates: []string{"Split Range: STARTS_WITH($FirstName, 'A')"}, |
| 52 | }, |
| 53 | { |
| 54 | ID: 4, |
| 55 | Text: " +- Local Limit", |
| 56 | }, |
| 57 | { |
| 58 | ID: 5, |
| 59 | Text: " +- Local Distributed Union", |
| 60 | }, |
| 61 | { |
| 62 | ID: 6, |
| 63 | Text: " +- FilterScan", |
| 64 | Predicates: []string{"Seek Condition: STARTS_WITH($FirstName, 'A')"}, |
| 65 | }, |
| 66 | { |
| 67 | ID: 7, |
| 68 | Text: " +- Index Scan (Index: SingersByFirstLastName)", |
| 69 | }, |
| 70 | }, |
| 71 | }, |
| 72 | { |
| 73 | /* |
| 74 | Original Query: |
| 75 | SELECT a.AlbumTitle, s.SongName |
| 76 | FROM Albums AS a HASH JOIN Songs AS s |
| 77 | ON a.SingerId = s.SingerId AND a.AlbumId = s.AlbumId; |
| 78 | */ |
| 79 | title: "Hash Join", |
| 80 | file: "testdata/plans/hash_join.input.json", |
nothing calls this directly
no test coverage detected