You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] JSQLParser Version 5.1-SNAPSHOT: Lateral View with two aliases recognizes second alias as table #2088
When using a LATERAL VIEW with two aliases, the second alias is incorrectly being interpreted as a JOIN with a table. Instead, it should be detected as a second alias for the exploded data.
The LateralView class currently has a method getColumnAlias that returns only one alias. This behavior could be incorrect because in cases where there are multiple aliases, such as with exploded arrays or maps, the method should return a list of aliases, not just one.
SQL Example:
SELECT k, v
FROM table
LATERAL VIEW EXPLODE(a) exploded_data AS k, v;
In this query, the alias k is correctly detected as the first alias for the exploded data. However, the alias v is mistakenly identified as a table named v, instead of being treated as the second alias for the exploded data.
The expected behavior is that both k and v should be recognized as aliases for the exploded data, with no table join implied.
Would that not be a Struct based Alias? We support this already, but not in the form of a plain comma separated column list.
We support compound aliases like A(k,v).
Activity
manticore-projects commentedon Oct 18, 2024
Greetings!
Would that not be a
Structbased Alias? We support this already, but not in the form of a plain comma separated column list.We support compound aliases like
A(k,v).manticore-projects commentedon Oct 18, 2024
A bit quick and dirty, but it works now. Cheers!
arodriguezdlc commentedon Oct 18, 2024
Thank you @manticore-projects !! We are testing with the new snapshot. Any plans for a 5.1 release? Cheers!
feat: `LATERAL VIEW` supports multiple alias columns
fix: allow arbitrary column aliases in LATERAL VIEW (#2452)