Get error "mismatched input 'as' expecting FROM near ')' in from clause" when run sql query Hadoop Java
As requested in Answer form:Hadoop seems to have problems with aliases via AS
keyword on subqueries and you can easily assign the alias without the AS
Keyword.
Example can be found here: https://www.inkling.com/read/hadoop-definitive-guide-tom-white-3rd/chapter-12/querying-data
And quoted for future visitors ( see mt
alias for subquery ):
SELECT station, year, AVG(max_temperature)FROM ( SELECT station, year, MAX(temperature) AS max_temperature FROM records2 WHERE temperature != 9999 AND (quality = 0 OR quality = 1 OR quality = 4 OR quality = 5 OR quality = 9) GROUP BY station, year) mtGROUP BY station, year;