2014-04-02 65 views
1

在蜂房,我有四個表:蜂巢:無效列引用

  • temp_basic_info(ID,MSISDN,性別,年齡,日,月,年,RELATIONSHIPSTATUS)
  • temp_education(ID,教育)
  • likes_and_music(ID,NAME,PAGE)
  • temp_output(ID,MSISDN,性別,年齡,日,月,年,RELATIONSHIPSTATUS,教育,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無效的列引用'EDUCATION'

我錯過了什麼?

回答

0
temp_education (ID, NAME) 

我沒有看到列b.education爲表temp_education b

+0

哦,對不起,這是一個錯字。應該是(身份證,教育) –