apache / apache/datafusion

[DISCUSSION] Naming convention for non-aliased columns

Open
#3,990 8 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
9.3k
Forks
2.4k
Avg merge
3d 7h
Merged PRs (30d)
344

Description

**Is your feature request related to a problem or challenge? Please describe what you are trying to do.**
Related to #3882 #3722
As of now, not aliased column names gets their name generated using function, arguments and other information ending up with not user-friendly aliases like `btrim(test.a,Utf8(\"ab\"))`

**Describe the solution you'd like**
Discuss the naming convention for non-aliased columns.
As an example we can consider
- Postgres based
```
select trim("123")
trim |
-----+
123 |
```

- Trino based
```
select t.*, 'col_again' from ( select 'col', 2 a, count(1) ) t

_col0|a|_col2|_col3 |
-----+-+-----+---------+
col |2| 1|col_again|
```
- Or any other solutions contributors considers as better solutions

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.

Contributor guide

Open the contributing guide

Research direction

Begin by reviewing related issues #3882 and #3722, then compare the PostgreSQL and Trino naming examples in this discussion. The work is not ready for implementation until a convention for non-aliased columns is agreed upon; done would mean documenting that decision and applying it consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, sql
Domain
data-engineering
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.