You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Fabian Hueske (JIRA)" <ji...@apache.org> on 2018/05/23 10:01:00 UTC

[jira] [Created] (FLINK-9419) UNION should not be treated as retraction producing operator

Fabian Hueske created FLINK-9419:
------------------------------------

             Summary: UNION should not be treated as retraction producing operator
                 Key: FLINK-9419
                 URL: https://issues.apache.org/jira/browse/FLINK-9419
             Project: Flink
          Issue Type: Bug
          Components: Table API &amp; SQL
            Reporter: Fabian Hueske


The following query fails 

{code}
SELECT
    user_id,
    count(msg),
    HOP_END(rowtime, INTERVAL '1' second, INTERVAL '1' minute)
FROM (SELECT rowtime, user_id, action_name AS msg FROM
          event_client_action
        WHERE /* various clauses */
        UNION SELECT rowtime, user_id, action_type AS msg FROM
           event_server_action
           WHERE /* various clauses */
      )
GROUP BY
HOP(rowtime, INTERVAL '1' second, INTERVAL '1' minute), user_id
{code}

with 

{quote}Retraction on windowed GroupBy aggregation is not supported yet. Note: Windowed GroupBy aggregation should not follow a non-windowed GroupBy aggregation.{quote}

The problem is that the {{UNION}} operator is translated into a {{UNION ALL}} and a subsequent {{GROUP BY}} on all attributes without an aggregation function. Currently, all {{GROUP BY}} operators are treated as retraction-producing operators. However, this is only true for grouping operators with aggregation functions. If the operator groups on all attributes and has no aggregation functions, it does not produce retractions but only forwards them (similar to a filter operator).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)