蜂巢查询错误



我正在尝试使用以下查询来运行地图减少作业,

SELECT  b.userId, a.movieId, a.title, a.genre, b.rating
FROM streaming.movies a JOIN streaming.ratings b
ON a.movieId = b.movieId
WHERE a.genre LIKE '%Adventure%' OR a.genre LIKE '%Children% OR a.genre LIKE '%Action%' OR a.genre LIKE '%Fantasy%' OR a.genre LIKE '%Mystery%' OR a.genre LIKE '%Thriller%' OR a.genre LIKE '%Drama%' OR a.genre LIKE '%Romance%' OR a.genre LIKE '%Sci-Fi%' OR a.genre LIKE '%Comedy%' OR a.genre LIKE '%Horror%'
LIMIT 10;

Hive引发错误,

Error: Error while compiling statement: FAILED: ParseException line 5:6 cannot recognize input near 'LIMIT' '10' '<EOF>' in expression specification (state=42000,code=40000)

有人可以帮我吗?预先感谢。

注意:我已经成功地使用" Rlike"来运行工作。我正在尝试使用"喜欢"锻炼。我的" Rlike"版本的代码是

WHERE a.genre RLIKE '.*(Adventure|Children|Action|Fantasy|Mystery|Thriller|Drama|Romance|Sci-Fi|Comedy|Horror).*'

尝试运行此查询

SELECT  b.userId, a.movieId, a.title, a.genre, b.rating
FROM streaming.movies a JOIN streaming.ratings b
ON a.movieId = b.movieId
WHERE a.genre LIKE '%Adventure%' OR a.genre LIKE '%Children%' OR a.genre LIKE '%Action%' OR a.genre LIKE '%Fantasy%' OR a.genre LIKE '%Mystery%' OR a.genre LIKE '%Thriller%' OR a.genre LIKE '%Drama%' OR a.genre LIKE '%Romance%' OR a.genre LIKE '%Sci-Fi%' OR a.genre LIKE '%Comedy%' OR a.genre LIKE '%Horror%'
LIMIT 10;

您在LIKE '%Children%

中缺少'

最新更新