I am facing issues when trying to group the values based on the key in Alibaba MaxCompute. I used similar queries before in Alibaba Cloud MaxCompute but now it throws me an error.
For instance,
SELECT * FROM table GROUP BY key;
It should work but it throws me error like
FAILED: ODPS-0130071:[1,8] Semantic analysis exception - column reference table.value should appear in GROUP BY key
Anyone could help me with this to understand why this error occurs.
In the earlier version of MaxCompute,
select * from group by key
is supported even when the columns that match * are not included in the GROUP BY key. Compatible with Hive, MaxCompute 2.0 prohibits this syntax unless the GROUP BY list is a column in all source tablesExamples:
Incorrect Syntax:
Correct Syntax:
Not recommended syntax:
Recommended syntax: