HIVE-12473 has added an incorrect comment and also lacks a test case.
Benefits of this fix:
- Does not say: "Probably doesn't work"
- Does not use grammar like "subquery columns and such"
- Adds test cases, that let you verify the fix
- Doesn't rely on certain structure of key expr, just takes the type at compile time
- Doesn't require an additional walk of each key expression
- Shows the type used in explain