Skip to content

Commit 44a1d8a

Browse files
committed
[MXP-3068](https://jira.tools.sap/browse/MXP-3068). Broken alias with is calc view
1 parent 268bfcd commit 44a1d8a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/main/java/org/apache/calcite/rel/rel2sql/SqlImplementor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1791,7 +1791,7 @@ private Builder builder(RelNode rel, Set<Clause> clauses) {
17911791
case AS:
17921792
final SqlCall asCall = (SqlCall) selectItem;
17931793
SqlNode alias = asCall.operand(1);
1794-
if (aliasRef && !SqlUtil.isGeneratedAlias(((SqlIdentifier) alias).getSimple())) {
1794+
if ((aliasRef && !SqlUtil.isGeneratedAlias(((SqlIdentifier) alias).getSimple())) || RelOptUtil.hasCalcViewHint(rel)) {
17951795
// For BigQuery, given the query
17961796
// SELECT SUM(x) AS x FROM t HAVING(SUM(t.x) > 0)
17971797
// we can generate

0 commit comments

Comments
 (0)