#2027·datafusion

beautify default column names

Author: xudong963Created Mar 17, 2022Updated Sep 29, 2026
Labelsenhancementgood first issue

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 https://github.com/apache/arrow-datafusion/issues/1818.
  2. Makes the printed table unattractive and may be very wide, such as
sql
❯ 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:
sql
postgres=# select 1, 2;
 ?column? | ?column?
----------+----------
        1 |        2
(1 row)