Commit 2863e50
committed
fix: allow arbitrary column aliases in LATERAL VIEW
Hive/Spark LATERAL VIEW supports an arbitrary number of column aliases
(e.g. json_tuple yielding many output columns), but the grammar only
absorbed the first two aliases (#2088). Any further aliases were
silently parsed as comma-separated tables in the FROM clause (implicit
cross joins), and because toString() re-emitted them as the join list
the broken AST round-tripped identically and was hard to detect by
inspection.
Generalise the column-alias production to consume any number of
aliases after the first two.
Fixes #2433
Signed-off-by: 付典 <fudianchn@gmail.com>1 parent f0ba123 commit 2863e50
2 files changed
Lines changed: 36 additions & 3 deletions
File tree
- src
- main/jjtree/net/sf/jsqlparser/parser
- test/java/net/sf/jsqlparser/statement/select
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5053 | 5053 | | |
5054 | 5054 | | |
5055 | 5055 | | |
| 5056 | + | |
| 5057 | + | |
| 5058 | + | |
5056 | 5059 | | |
5057 | 5060 | | |
5058 | 5061 | | |
| |||
Lines changed: 33 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | 12 | | |
16 | 13 | | |
| 14 | + | |
| 15 | + | |
17 | 16 | | |
18 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
19 | 23 | | |
20 | 24 | | |
21 | 25 | | |
| |||
54 | 58 | | |
55 | 59 | | |
56 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
57 | 87 | | |
0 commit comments