IMPALA-5191 is not a bug, it was a change in behaviour to make Impala more standard conforming. The SQL standard doesn't allow references to select list aliases within HAVING expressions and the old Impala behaviour prevented a bunch of valid SQL queries from running. It's expected although unfortunate that some non-standard queries like yours that previously worked now no longer work after the change.
On Mon, May 20, 2019 at 7:27 PM Darren Hoo <[email protected]> wrote: > https://issues.apache.org/jira/browse/IMPALA-5191 says it is fixed in > impala-3.0 > > while in CDH6 , the version of impala we are using is v3.2.0-cdh6.2.0 > > is it a regression? > > On Sun, May 19, 2019 at 2:00 AM Greg Rahn <[email protected]> wrote: > >> This is due to >> https://issues.apache.org/jira/browse/IMPALA-5191 >> >> >> On Sat, May 18, 2019 at 9:32 AM Darren Hoo <[email protected]> wrote: >> >>> reply to myself: >>> >>> juse use ndv(uuid), not using alias >>> >>> >>> select >>> >>> contentid, >>> >>> parse_url(refer, 'HOST') as domain, >>> >>> ndv(uuid) as uv >>> >>> from domain_logs and keywords is null group by contentid, >>> domain having ndv(uuid) > 3; >>> >>> On Sun, May 19, 2019 at 12:14 AM Darren Hoo <[email protected]> >>> wrote: >>> >>>> This Query works in CDH5 but fails in CDH6: >>>> >>>> select >>>> >>>> contentid, >>>> >>>> parse_url(refer, 'HOST') as domain, >>>> >>>> ndv(uuid) uv >>>> >>>> from domain_logs and keywords is null group by contentid, >>>> domain having uv > 3; >>>> >>>> >>>> ERROR: AnalysisException: Could not resolve column/field reference: 'uv' >>>> >>>> >>>> >>>> Impala Version: Server version: impalad version 3.2.0-cdh6.2.0 RELEASE >>>> (build edc19942b4debdbfd485fbd26098eef435003f5d) >>>> >>>> >>>> >>>> How to write this SQL in impala 3.2? >>>> >>>
