Skip to content

Aliased aggregation expressions not visible in physical explain output #19685

@pepijnve

Description

@pepijnve

Describe the bug

When the an aggregation expression has been aliased the original expression is visible in the logical plan explain output. In the physical output only the alias is printed making it hard to interpret.

To Reproduce

Here's an example logic plan constructed using the data frame API. The problematic line is

AggregateExec: mode=Single, gby=[], aggr=[agg]
Logical plan
============
Aggregate: groupBy=[[]], aggr=[[sum(column1) FILTER (WHERE column2 <= Int64(0)) AS agg]]
  Values: (Int64(1), Int64(100)), (Int64(2), Int64(200)), (Int64(3), Int64(314))

Optimized logical plan
======================
Aggregate: groupBy=[[]], aggr=[[sum(column1) FILTER (WHERE column2 <= Int64(0)) AS agg]]
  Values: (Int64(1), Int64(100)), (Int64(2), Int64(200)), (Int64(3), Int64(314))

Physical plan
=============
AggregateExec: mode=Single, gby=[], aggr=[agg]
  DataSourceExec: partitions=1, partition_sizes=[1]

Expected behavior

Rather than

AggregateExec: mode=Single, gby=[], aggr=[agg]

the explain output should show something like

AggregateExec: mode=Single, gby=[], aggr=[sum(column1@0) FILTER (WHERE column2@1 <= Int64(0)) as agg]

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions