0: jdbc:hive2://192.168.64.182:10000> SELECT c.ID, on.community, on.build_area, c.build_year, c.building_num, c.house_num, on.has_elevator FROM onsale on JOIN Community c ON on.ID_Community = c.ID limit 6; FAILED: ParseException line 1:11 missing EOF at ',' near 'ID' Error: Error while compiling statement: FAILED: ParseException line 1:11 missing EOF at ',' near 'ID' (state=42000,code=40000)
时间: 2024-02-15 08:02:48 浏览: 169
Hive Beeline连接报错:Could not open client transport with JDBC Uri: jdbc:hive2://hcmaster:10000/default
5星 · 资源好评率100%
这个错误提示表明在SQL语句的第1行第11个字符处附近出现了错误,可能是因为在这个位置附近有一个非法的字符或者缺少了一些必要的字符。具体而言,这个错误可能是由于下面的这个子句产生的:
```
SELECT c.ID, on.community, on.build_area, c.build_year, c.building_num, c.house_num, on.has_elevator FROM onsale on JOIN Community c ON on.ID_Community = c.ID limit 6;
```
这里使用了JOIN子句连接了两个表,但是在连接条件中使用了"on.ID_Community = c.ID"的语法,这个语法在Hive中是不支持的,应该使用"on.ID_Community == c.ID"的语法来代替。另外,也可以使用等价的USING子句来代替ON子句,例如:
```
SELECT c.ID, on.community, on.build_area, c.build_year, c.building_num, c.house_num, on.has_elevator
FROM onsale on
JOIN Community c USING (ID_Community)
LIMIT 6;
```
这里使用了USING子句来连接两个表,使用"ID_Community"作为连接条件,该语法在Hive中是支持的,可以正确执行查询语句了。
阅读全文