You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (Jira)" <ji...@apache.org> on 2024/07/09 14:40:00 UTC

[jira] [Commented] (CALCITE-6461) Metadata provider for determining if columns originate from aggregate functions

    [ https://issues.apache.org/jira/browse/CALCITE-6461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17864239#comment-17864239 ] 

Julian Hyde commented on CALCITE-6461:
--------------------------------------

Would it be possible to extend one of the existing metadata types? I think that would be preferable, even if it means a minor change in behavior. 

> Metadata provider for determining if columns originate from aggregate functions
> -------------------------------------------------------------------------------
>
>                 Key: CALCITE-6461
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6461
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>            Reporter: Stamatis Zampetakis
>            Assignee: Stamatis Zampetakis
>            Priority: Major
>
> Add a new metadata provider for determining whether a set of columns originates from aggregate functions.
> In Apache Hive, we have a use-case where we need to determine if the columns in the result of a query originate from aggregate functions. Along with other things, it is used for deciding when to materialize common table expressions.
> {code:sql}
> SELECT job, SUM(sal) as total 
> FROM emp 
> GROUP BY job
> {code}
> For the query above, the new metadata provider should return:
> * false when the input is column 0 (job)
> * true when the input is column 1 (total)
> * false when the input is columns {0,1}
> The proposed metadata provider presents some similarities with {{ColumnOrigin}} and {{ExpressionLineage}} but the latter cannot be easily extended to provide this information.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)