Description
select sum(value1) as total_1, total_1 from values(1, 'name', 100, 50) AS data(id, name, value1, value2) having total_1 > 0 SparkException: [INTERNAL_ERROR] Found the unresolved operator: 'UnresolvedHaving (total_1#353L > cast(0 as bigint))
To trigger the issue, the having condition need to be (can be resolved by) an attribute in the select.
Without the LCA total_1, the query works fine.