Skip to content

Commit

Permalink
[MXP-3068](https://jira.tools.sap/browse/MXP-3068). Broken alias with…
Browse files Browse the repository at this point in the history
… is calc view
  • Loading branch information
CoKueb committed Nov 21, 2024
1 parent efeb2cd commit d3c0e60
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1839,7 +1839,7 @@ private Builder builder(RelNode rel, Set<Clause> clauses) {
case AS:
final SqlCall asCall = (SqlCall) selectItem;
SqlNode alias = asCall.operand(1);
if (aliasRef && !SqlUtil.isGeneratedAlias(((SqlIdentifier) alias).getSimple())) {
if ((aliasRef && !SqlUtil.isGeneratedAlias(((SqlIdentifier) alias).getSimple())) || RelOptUtil.hasCalcViewHint(rel)) {
// For BigQuery, given the query
// SELECT SUM(x) AS x FROM t HAVING(SUM(t.x) > 0)
// we can generate
Expand Down

0 comments on commit d3c0e60

Please sign in to comment.