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