Skip to content

beautify default column names #2027

Description

@xudong963

Is your feature request related to a problem or challenge? Please describe what you are trying to do.
Currently, DataFusion creates column names by https://github.com/apache/arrow-datafusion/blob/7be0e268a69ffecbf06823c98ca572733dddb29e/datafusion/src/physical_plan/planner.rs#L91.
The approach has two existing problems:

  1. result in potential bugs, such as A corner bug in union #1818.
  2. Makes the printed table unattractive and may be very wide, such as
select COALESCE(null, null, null, null);
+-------------------------------------------------------+
| coalesce(Utf8(NULL),Utf8(NULL),Utf8(NULL),Utf8(NULL)) |
+-------------------------------------------------------+
|                                                       |
+-------------------------------------------------------+
1 row in set. Query took 0.002 seconds.

Describe the solution you'd like

  1. Simplify default column names by modifying https://github.com/apache/arrow-datafusion/blob/7be0e268a69ffecbf06823c98ca572733dddb29e/datafusion/src/physical_plan/planner.rs#L91.
  2. Directly define a default column name, such as ?column? in postgres:
postgres=# select 1, 2;
 ?column? | ?column?
----------+----------
        1 |        2
(1 row)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions