Hive:无效的列引用

问题描述 投票:0回答:1

在 Hive 中,我有四个表:

  • temp_basic_info(ID、MSISDN、性别、年龄、日、月、年、关系状态)
  • temp_education(ID,教育)
  • 喜欢和音乐(ID、名称、页面)
  • temp_output(ID、MSISDN、性别、年龄、日、月、年、关系状态、教育程度、喜欢和偏好)

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 列引用“教育”无效

我错过了什么?

sql hadoop hive
1个回答
0
投票
temp_education (ID, NAME)

我没有看到表格

b.education
 的列 
temp_education b

© www.soinside.com 2019 - 2024. All rights reserved.