在 Hive 中,我有四个表:
temp_output 为空。
现在,我想将其他三个表中的相应字段传输到 temp_output 中。 likes_and_music 有多个相同 ID 的实例,与不同的名称和页面配对,因此我必须将它们放入一个数组中。
我的预计输出如下:
0001 msisdn1 male 21 1 2 92 0 College [Jeep, soccer, PC games, etc...]
这是我迄今为止的查询:
Select a.ID, a.MSISDN, a.GENDER, a.AGE, a.DAY, a.MONTH, a.YEAR, a.RELATIONSHIPSTATUS, b.EDUCATION, COLLECT_SET(c.NAME) FROM temp_basic_info a JOIN temp_education b ON (a.ID = b.ID) JOIN likes_and_music c ON (c.ID = b.ID) GROUP BY a.ID, a.MSISDN, a.GENDER, a.AGE, a.DAY, a.MONTH, a.YEAR, a.RELATIONSHIPSTATUS, b.EDUCATION, c.name limit 10;
但后者返回以下错误:
失败:SemanticException [错误 10002]:第 1 行:311 列引用“教育”无效
我错过了什么?
temp_education (ID, NAME)
我没有看到表格
b.education
的列
temp_education b