Hive:无效的列引用

时间:2014-04-02 13:23:16

标签: sql hadoop hive

在Hive中,我有四张桌子:

  • temp_basic_info(ID,MSISDN,GENDER,AGE,DAY,MONTH,YEAR,RELATIONSHIPSTATUS)
  • temp_education(身份证,教育)
  • likes_and_music(ID,NAME,PAGE)
  • temp_output(ID,MSISDN,GENDER,AGE,DAY,MONTH,YEAR,RELATIONSHIPSTATUS,EDUCATION,LIKES_AND_PREFERENCES)

temp_output为空。

现在,我想将其他三个表中的相应字段传输到temp_output。 likes_and_music有多个相同ID的实例,与不同的NAME和PAGE配对,所以我必须把它们放在一个数组中。

我的预计输出如下:

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

我错过了什么?

1 个答案:

答案 0 :(得分:0)

temp_education (ID, NAME)

我没有看到表b.education

的列temp_education b