bmuraykhi commented on code in PR #45793:
URL: https://github.com/apache/superset/pull/45793#discussion_r4399560250


##########
superset/db_engine_specs/clickhouse.py:
##########
@@ -72,6 +73,22 @@ class ClickHouseQueryStoppedBeforeDispatchError(Exception):
     """
 
 
+class AggregateFunctionState(types.UserDefinedType):
+    cache_ok = True
+
+    def get_col_spec(self, **kw: Any) -> str:
+        return "AggregateFunction"
+
+    def coerce_compared_value(self, op: Any, value: Any) -> 
types.TypeEngine[Any]:
+        return types.NullType().coerce_compared_value(op, value)
+
+    def column_expression(self, colexpr: ColumnElement) -> ColumnElement:
+        element = colexpr.element if isinstance(colexpr, Label) else colexpr
+        if isinstance(element, ColumnClause) and not element.is_literal:
+            return func.finalizeAggregation(colexpr)

Review Comment:
   you're right, fixed in 78b61fd. the finalized column now gets a 
non-shadowing alias (rtt__) through rename_shadowing_aliases, and the test 
selects rtt next to rtt_p50 and next to a merge metric. side effect: a filter 
or order by on rtt hits the raw state again, same as master



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to